Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EnterAltScreen ¶ added in v0.10.0
func EnterAltScreen()
EnterAltScreen switches to the alternate screen buffer. This preserves the main terminal content which can be restored by calling ExitAltScreen.
func ExitAltScreen ¶ added in v0.10.0
func ExitAltScreen()
ExitAltScreen switches back to the main screen buffer, restoring the previous terminal content.
func NewVerboseWriter ¶
func NewVerboseWriter(lineHeight int) io.WriteCloser
NewVerboseWriter creates a new verbose writer. A verbose writer pipes the input received to the stdout while tailing the specified lines. Calling `Close` when done is recommended to clear the last uncleared output.
func WithAltScreen ¶ added in v0.10.0
WithAltScreen runs the provided function in the alternate screen buffer. The main terminal content is preserved and restored after the function completes. Handles Ctrl-C to ensure the terminal is restored even on interrupt.
If header lines are provided, they are joined with newlines and displayed as a fixed header at the top of the screen. The command output scrolls below the header. The number of header lines is computed automatically based on newlines and terminal width.
Types ¶
This section is empty.