diff options
author | Christian Duerr <contact@christianduerr.com> | 2020-07-23 21:55:15 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-23 21:55:15 +0000 |
commit | 0dfd8601c92666c45d0c2e056bd68f600a4cbe47 (patch) | |
tree | a8c4b508932610b73c76840b2eaf9a3122e7ed67 /alacritty_terminal/src/ansi.rs | |
parent | dd32447bc282c443f8c7dd74fe8be635203390c9 (diff) | |
download | alacritty-0dfd8601c92666c45d0c2e056bd68f600a4cbe47.tar.gz alacritty-0dfd8601c92666c45d0c2e056bd68f600a4cbe47.zip |
Add secondary DA support
This adds support for the secondary DA escape sequence response.
Alacritty's version is formatted allowing for up to 99 minor and patch
versions, which should be sufficient.
The tertiary DA is intentionally not implemented and marked as rejected
in the documentation, since a lot of terminals do not support it, or
report useless data (XTerm/URxvt/Kitty).
Fixes #3100.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r-- | alacritty_terminal/src/ansi.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs index 5f24dcff..bee19a06 100644 --- a/alacritty_terminal/src/ansi.rs +++ b/alacritty_terminal/src/ansi.rs @@ -164,7 +164,7 @@ pub trait Handler { /// Identify the terminal (should write back to the pty stream). /// /// TODO this should probably return an io::Result - fn identify_terminal<W: io::Write>(&mut self, _: &mut W) {} + fn identify_terminal<W: io::Write>(&mut self, _: &mut W, _intermediate: Option<char>) {} /// Report device status. fn device_status<W: io::Write>(&mut self, _: &mut W, _: usize) {} @@ -973,8 +973,8 @@ where ('C', None) | ('a', None) => { handler.move_forward(Column(arg_or_default!(idx: 0, default: 1) as usize)) }, - ('c', None) if arg_or_default!(idx: 0, default: 0) == 0 => { - handler.identify_terminal(writer) + ('c', intermediate) if arg_or_default!(idx: 0, default: 0) == 0 => { + handler.identify_terminal(writer, intermediate.map(|&i| i as char)) }, ('D', None) => { handler.move_backward(Column(arg_or_default!(idx: 0, default: 1) as usize)) @@ -1148,7 +1148,7 @@ where }, (b'H', None) => self.handler.set_horizontal_tabstop(), (b'M', None) => self.handler.reverse_index(), - (b'Z', None) => self.handler.identify_terminal(self.writer), + (b'Z', None) => self.handler.identify_terminal(self.writer, None), (b'c', None) => self.handler.reset_state(), (b'0', intermediate) => { configure_charset!(StandardCharset::SpecialCharacterAndLineDrawing, intermediate) @@ -1408,7 +1408,7 @@ mod tests { self.index = index; } - fn identify_terminal<W: io::Write>(&mut self, _: &mut W) { + fn identify_terminal<W: io::Write>(&mut self, _: &mut W, _intermediate: Option<char>) { self.identity_reported = true; } |