pub(crate) fn disable_raw_mode() -> Result<()> {
    let mut original_mode = TERMINAL_MODE_PRIOR_RAW_MODE.lock();

    if let Some(original_mode_ios) = original_mode.as_ref() {
        let tty = tty_fd()?;
        set_terminal_attr(tty.raw_fd(), original_mode_ios)?;
        // Keep it last - remove the original mode only if we were able to switch back
        *original_mode = None;
    }

    Ok(())
}
/// Reset the raw mode.
///
/// More precisely, reset the whole termios mode to what it was before the first call
/// to [enable_raw_mode]. If you don't mess with termios outside of crossterm, it's
/// effectively disabling the raw mode and doing nothing else.
Reset the raw mode.
More precisely, reset the whole termios mode to what it was before the first call
to [enable_raw_mode]. If you don't mess with termios outside of crossterm, it's
effectively disabling the raw mode and doing nothing else.
Reset the raw mode . More precisely reset the whole termios mode to what it was before the first call to [ enable_raw_mode ] . If you don ' t mess with termios outside of crossterm it ' s effectively disabling the raw mode and doing nothing else .
pub(crate) fn disable_raw_mode() -> Result<()> {
    let mut original_mode = TERMINAL_MODE_PRIOR_RAW_MODE.lock();
    if let Some(original_mode_ios) = original_mode.as_ref() {
        let tty = tty_fd()?;
        set_terminal_attr(tty.raw_fd(), original_mode_ios)?;
        // Keep it last - remove the original mode only if we were able to switch back
        *original_mode = None;
    }
    Ok(())
}
pub ( crate ) fn disable_raw_mode ( ) -> Result < ( ) > { let mut original_mode = TERMINAL_MODE_PRIOR_RAW_MODE . lock ( ) ; if let Some ( original_mode_ios ) = original_mode . as_ref ( ) { let tty = tty_fd ( ) ? ; set_terminal_attr ( tty . raw_fd ( ) , original_mode_ios ) ? ; // Keep it last - remove the original mode only if we were able to switch back * original_mode = None ; } Ok ( ( ) ) }
Reset the raw mode.
Reset the raw mode .