diff options
author | ii41 <23465321+ii41@users.noreply.github.com> | 2020-09-27 15:36:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-27 22:36:08 +0000 |
commit | a754d06b44139b85e8b34a71ece4477cb1caa85e (patch) | |
tree | 1733f8d17101947b6df5e1ad15b3fd64cf1db9a0 /alacritty_terminal/src/tty/windows/winpty.rs | |
parent | e9c0034f4d3ee003149fe5454942bea7ff3d98be (diff) | |
download | alacritty-a754d06b44139b85e8b34a71ece4477cb1caa85e.tar.gz alacritty-a754d06b44139b85e8b34a71ece4477cb1caa85e.zip |
Add support for single line terminals
This changes the minimum terminal dimensions from 2 lines and 2 columns,
to 1 line and 2 columns.
This also reworks the `SizeInfo` to store the number of columns and
lines and consistently has only the terminal lines/columns stored,
instead of including the message bar and search in some places of the
Alacritty renderer/input.
These new changes also make it easy to properly start the selection
scrolling as soon as the mouse is over the message bar, instead of
waiting until it is beyond it.
Fixes #4207.
Co-authored-by: Christian Duerr <contact@christianduerr.com>
Diffstat (limited to 'alacritty_terminal/src/tty/windows/winpty.rs')
-rw-r--r-- | alacritty_terminal/src/tty/windows/winpty.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/alacritty_terminal/src/tty/windows/winpty.rs b/alacritty_terminal/src/tty/windows/winpty.rs index f9dd56bb..5de4b401 100644 --- a/alacritty_terminal/src/tty/windows/winpty.rs +++ b/alacritty_terminal/src/tty/windows/winpty.rs @@ -20,7 +20,7 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> // Create config. let mut wconfig = WinptyConfig::new(ConfigFlags::empty()).unwrap(); - wconfig.set_initial_size(size.cols().0 as i32, size.lines().0 as i32); + wconfig.set_initial_size(size.cols().0 as i32, size.screen_lines().0 as i32); wconfig.set_mouse_mode(&MouseMode::Auto); // Start agent. @@ -60,8 +60,8 @@ pub fn new<C>(config: &Config<C>, size: &SizeInfo, _window_id: Option<usize>) -> } impl OnResize for Agent { - fn on_resize(&mut self, sizeinfo: &SizeInfo) { - let (cols, lines) = (sizeinfo.cols().0, sizeinfo.lines().0); + fn on_resize(&mut self, size: &SizeInfo) { + let (cols, lines) = (size.cols().0, size.screen_lines().0); if cols > 0 && cols <= u16::MAX as usize && lines > 0 && lines <= u16::MAX as usize { self.set_size(cols as u16, lines as u16) .unwrap_or_else(|_| info!("Unable to set WinPTY size, did it die?")); |