Skip to content

Commit

Permalink
Merge pull request #724 from miraclx/miraclx/restore-terminal-mode
Browse files Browse the repository at this point in the history
fix(unix): restore terminal mode
  • Loading branch information
gwenn authored Aug 19, 2023
2 parents 35ea49a + 2fd3f2e commit 1c4091a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/tty/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ use nix::errno::Errno;
use nix::poll::{self, PollFlags};
use nix::sys::select::{self, FdSet};
use nix::unistd::{close, isatty, read, write};
use termios::{tcgetattr, tcsetattr, Termios};
use termios::{tcsetattr, Termios};
use unicode_segmentation::UnicodeSegmentation;
use utf8parse::{Parser, Receiver};

Expand Down Expand Up @@ -106,8 +106,7 @@ pub type Mode = PosixMode;
impl RawMode for PosixMode {
/// Disable RAW mode for the terminal.
fn disable_raw_mode(&self) -> Result<()> {
let mut termios = self.termios;
tcgetattr(self.tty_in, &mut termios)?;
tcsetattr(self.tty_in, termios::TCSADRAIN, &self.termios)?;
// disable bracketed paste
if let Some(out) = self.tty_out {
write_all(out, BRACKETED_PASTE_OFF)?;
Expand Down

0 comments on commit 1c4091a

Please sign in to comment.