aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKirill Chibisov <contact@kchibisov.com>2024-03-09 21:50:21 +0400
committerKirill Chibisov <contact@kchibisov.com>2024-03-09 21:50:21 +0400
commit615ab7c2d1de0fbed1c073e8a62748a4a84ecc0e (patch)
tree519f4f525dd544325374e91c1719d2076dc70298
parentf5646ba352c809f78c55a9e1f6a5212aea787899 (diff)
downloadalacritty-not-reset-pixel.tar.gz
alacritty-not-reset-pixel.zip
Fix pty's pixelsize being zero until resizenot-reset-pixel
117719b3 removed the extra call for TIOCSWINSZ, however the first call was not setting the pixelsize for _unknown_ reason, which regressed some clients. Fixes: 117719b3 (Remove extra TIOCSWINSZ)
-rw-r--r--alacritty_terminal/src/tty/unix.rs15
1 files changed, 2 insertions, 13 deletions
diff --git a/alacritty_terminal/src/tty/unix.rs b/alacritty_terminal/src/tty/unix.rs
index 1034c5a9..8ce04191 100644
--- a/alacritty_terminal/src/tty/unix.rs
+++ b/alacritty_terminal/src/tty/unix.rs
@@ -4,7 +4,6 @@ use std::ffi::CStr;
use std::fs::File;
use std::io::{Error, ErrorKind, Read, Result};
use std::mem::MaybeUninit;
-use std::os::fd::OwnedFd;
use std::os::unix::io::{AsRawFd, FromRawFd};
use std::os::unix::net::UnixStream;
use std::os::unix::process::CommandExt;
@@ -38,17 +37,6 @@ macro_rules! die {
}}
}
-/// Get raw fds for master/slave ends of a new PTY.
-fn make_pty(size: Winsize) -> Result<(OwnedFd, OwnedFd)> {
- let mut window_size = size;
- window_size.ws_xpixel = 0;
- window_size.ws_ypixel = 0;
-
- let ends = openpty(None, Some(&window_size))?;
-
- Ok((ends.controller, ends.user))
-}
-
/// Really only needed on BSD, but should be fine elsewhere.
fn set_controlling_terminal(fd: c_int) {
let res = unsafe {
@@ -194,7 +182,8 @@ fn default_shell_command(shell: &str, user: &str) -> Command {
/// Create a new TTY and return a handle to interact with it.
pub fn new(config: &Options, window_size: WindowSize, window_id: u64) -> Result<Pty> {
- let (master, slave) = make_pty(window_size.to_winsize())?;
+ let pty = openpty(None, Some(&window_size.to_winsize()))?;
+ let (master, slave) = (pty.controller, pty.user);
let master_fd = master.as_raw_fd();
let slave_fd = slave.as_raw_fd();