diff options
author | Ayose Cazorla <ayosec@gmail.com> | 2020-08-28 22:26:03 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 22:26:03 +0000 |
commit | cdf5e51e742d67d1b96940a5096210725a1e51e8 (patch) | |
tree | 4652f37d8a9c32d3da4670d8706c96158caf1d72 /alacritty_terminal/src/ansi.rs | |
parent | ee2c5a6cdd6a07f18b99a50b9d2737bd8ea391c4 (diff) | |
download | alacritty-cdf5e51e742d67d1b96940a5096210725a1e51e8.tar.gz alacritty-cdf5e51e742d67d1b96940a5096210725a1e51e8.zip |
Add escape to report text area size
This implements the escapes `CSI 14 t` and `CSI 18 t` which report the
text area size in pixels and characters.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 8f1cf07f..5038b734 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -316,6 +316,12 @@ pub trait Handler { /// Pop the last title from the stack. fn pop_title(&mut self) {} + + /// Report text area size in pixels. + fn text_area_size_pixels<W: io::Write>(&mut self, _: &mut W) {} + + /// Report text area size in characters. + fn text_area_size_chars<W: io::Write>(&mut self, _: &mut W) {} } /// Describes shape of cursor. @@ -1080,6 +1086,8 @@ where ('s', None) => handler.save_cursor_position(), ('T', None) => handler.scroll_down(Line(next_param_or(1) as usize)), ('t', None) => match next_param_or(1) as usize { + 14 => handler.text_area_size_pixels(writer), + 18 => handler.text_area_size_chars(writer), 22 => handler.push_title(), 23 => handler.pop_title(), _ => unhandled!(), |