glink/use_stdin
Types
pub type EventEmitter
pub type ReadStream
pub type Stdin {
Stdin(
stdin: ReadStream,
set_raw_mode: fn(Bool) -> Nil,
is_raw_mode_supported: Bool,
internal_exit_on_ctrl_c: Bool,
internal_event_emitter: EventEmitter,
)
}
Constructors
-
Stdin( stdin: ReadStream, set_raw_mode: fn(Bool) -> Nil, is_raw_mode_supported: Bool, internal_exit_on_ctrl_c: Bool, internal_event_emitter: EventEmitter, )
Arguments
- stdin
-
Stdin stream passed to
render()
inoptions.stdin
orprocess.stdin
by default. Useful if your app needs to handle user input. NOTE: Not yet useable. - set_raw_mode
-
Ink exposes this function via own
<StdinContext>
to be able to handle Ctrl+C, that’s why you should use Ink’sset_raw_mode
. If thestdin
stream passed to Ink does not supportset_raw_mode
, this function does nothing. - is_raw_mode_supported
-
A boolean flag determining if the current
stdin
supportsset_raw_mode
. A component usingset_raw_mode
might want to useis_raw_mode_supported
to nicely fall back in environments where raw mode is not supported.