MCPcopy
hub / github.com/charmbracelet/bubbletea / restoreInput

Method restoreInput

tty.go:41–53  ·  view source on GitHub ↗

restoreInput restores the tty input to its original state.

()

Source from the content-addressed store, hash-verified

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

Callers 1

restoreTerminalStateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected