diff options
Diffstat (limited to 'alacritty_terminal/src/tty/unix.rs')
-rw-r--r-- | alacritty_terminal/src/tty/unix.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs index 01ee1b59..9419ead0 100644 --- a/alacritty_terminal/src/tty/unix.rs +++ b/alacritty_terminal/src/tty/unix.rs @@ -135,7 +135,7 @@ fn get_pw_entry(buf: &mut [i8; 1024]) -> Passwd<'_> { pub struct Pty { child: Child, - pub fd: File, + fd: File, token: mio::Token, signals: Signals, signals_token: mio::Token, @@ -226,14 +226,14 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, window_id: Option<usize>) -> set_nonblocking(master); } - let pty = Pty { + let mut pty = Pty { child, fd: unsafe { File::from_raw_fd(master) }, token: mio::Token::from(0), signals, signals_token: mio::Token::from(0), }; - pty.fd.as_raw_fd().on_resize(size); + pty.on_resize(size); pty }, Err(err) => die!("Failed to spawn command '{}': {}", shell.program, err), @@ -350,7 +350,7 @@ impl<'a> ToWinsize for &'a SizeInfo { } } -impl OnResize for i32 { +impl OnResize for Pty { /// Resize the pty /// /// Tells the kernel that the window size changed with the new pixel @@ -358,7 +358,7 @@ impl OnResize for i32 { fn on_resize(&mut self, size: &SizeInfo) { let win = size.to_winsize(); - let res = unsafe { libc::ioctl(*self, libc::TIOCSWINSZ, &win as *const _) }; + let res = unsafe { libc::ioctl(self.fd.as_raw_fd(), libc::TIOCSWINSZ, &win as *const _) }; if res < 0 { die!("ioctl TIOCSWINSZ failed: {}", io::Error::last_os_error()); |