summaryrefslogtreecommitdiff
path: root/alacritty_terminal/src
diff options
context:
space:
mode:
authorPaolo Capriotti <paolo@capriotti.io>2019-09-28 18:59:27 +0200
committerChristian Duerr <contact@christianduerr.com>2019-09-28 18:59:27 +0200
commit3e82aa28300d8b283508ebce43b5ede946fb672c (patch)
treec4fe3fff7ac50601f197bda0abbc2bbf6ff49601 /alacritty_terminal/src
parentfe6f1760b4a4a45de2bb239f0e2de73ce2461d90 (diff)
downloadalacritty-3e82aa28300d8b283508ebce43b5ede946fb672c.tar.gz
alacritty-3e82aa28300d8b283508ebce43b5ede946fb672c.zip
Concatenate parameters of title OSC
A semicolon in a title OSC should be interpreted literally, not as a parameter separator, but the OSC parser is very simple and does not know about arities of commands. Therefore, this patch takes all the parameters returned by the OSC parser and reconstructs the original string by interspersing semicolons. Now an OSC like '\e]2;hello;world' will set the title to 'hello;world' and not 'hello' like before.
Diffstat (limited to 'alacritty_terminal/src')
-rw-r--r--alacritty_terminal/src/ansi.rs11
1 files changed, 7 insertions, 4 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs
index 69391617..3bdef32d 100644
--- a/alacritty_terminal/src/ansi.rs
+++ b/alacritty_terminal/src/ansi.rs
@@ -750,10 +750,13 @@ where
// Set window title
b"0" | b"2" => {
if params.len() >= 2 {
- if let Ok(utf8_title) = str::from_utf8(params[1]) {
- self.handler.set_title(utf8_title);
- return;
- }
+ let title = params[1..]
+ .iter()
+ .flat_map(|x| str::from_utf8(x))
+ .collect::<Vec<&str>>()
+ .join(";");
+ self.handler.set_title(&title);
+ return;
}
unhandled(params);
},