package screenbuf
Import Path
github.com/manifoldco/promptui/screenbuf (on go.dev)
Dependency Relation
imports 3 packages, and imported by one package
Involved Source Files
screenbuf.go
Package-Level Type Names (only one, which is exported)
ScreenBuf is a convenient way to write to terminal screens. It creates,
clears and, moves up or down lines as needed to write the output to the
terminal using ANSI escape codes.
buf *bytes.Buffer
cursor int
height int
reset bool
w io.Writer
Clear clears all previous lines and the output starts from the top.
Flush writes any buffered data to the underlying io.Writer, ensuring that any pending data is displayed.
Reset truncates the underlining buffer and marks all its previous lines to be
cleared during the next Write.
Write writes a single line to the underlining buffer. If the ScreenBuf was
previously reset, all previous lines are cleared and the output starts from
the top. Lines with \r or \n will cause an error since they can interfere with the
terminal ability to move between lines.
WriteString is a convenient function to write a new line passing a string.
Check ScreenBuf.Write() for a detailed explanation of the function behaviour.
*T : io.StringWriter
*T : io.Writer
*T : net/http.http2stringWriter
func New(w io.Writer) *ScreenBuf
func github.com/manifoldco/promptui.clearScreen(sb *ScreenBuf)
Package-Level Functions (only one, which is exported)
New creates and initializes a new ScreenBuf.
Package-Level Variables (total 3, none are exported)
Package-Level Constants (only one, which is unexported)
The pages are generated with Golds v0.3.2. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |