Skip to main content

getchar

Function getchar 

Source
pub fn getchar(echo_char: bool) -> Result<char>
Expand description

Read a single character from the terminal.

§Arguments

  • echo_char - Whether to echo the character back to the terminal

§Returns

The character read from the terminal.

§Notes

This function attempts to use raw mode for immediate character reading. If raw mode is unavailable, it falls back to reading a line and returning the first character.