Add WithInputTTY ProgramOption

This commit is contained in:
Christian Rocha
2021-07-29 15:43:03 -04:00
parent e87344b791
commit 9826251f08
2 changed files with 21 additions and 0 deletions

View File

@@ -28,6 +28,13 @@ func WithInput(input io.Reader) ProgramOption {
}
}
// WithInputTTY open a new TTY for input (or console input device on Windows).
func WithInputTTY() ProgramOption {
return func(p *Program) {
p.startupOptions |= withInputTTY
}
}
// WithoutCatchPanics disables the panic catching that Bubble Tea does by
// default. If panic catching is disabled the terminal will be in a fairly
// unusable state after a panic because Bubble Tea will not perform its usual