MCPcopy Create free account
hub / github.com/charmbracelet/bubbletea / restoreInput

Method restoreInput

tty.go:44–56  ·  view source on GitHub ↗

restoreInput restores the tty input to its original state.

()

Source from the content-addressed store, hash-verified

42
43// restoreInput restores the tty input to its original state.
44func (p *Program) restoreInput() error {
45 if p.ttyInput != nil && p.previousTtyInputState != nil {
46 if err := term.Restore(p.ttyInput.Fd(), p.previousTtyInputState); err != nil {
47 return fmt.Errorf("bubbletea: error restoring console: %w", err)
48 }
49 }
50 if p.ttyOutput != nil && p.previousOutputState != nil {
51 if err := term.Restore(p.ttyOutput.Fd(), p.previousOutputState); err != nil {
52 return fmt.Errorf("bubbletea: error restoring console: %w", err)
53 }
54 }
55 return nil
56}
57
58// initInputReader (re)commences reading inputs.
59func (p *Program) initInputReader(cancel bool) error {

Callers 1

restoreTerminalStateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected