aboutsummaryrefslogtreecommitdiff
path: root/alacritty_terminal/src/ansi.rs
diff options
context:
space:
mode:
authorChristian Duerr <contact@christianduerr.com>2019-11-28 08:08:04 +0100
committerGitHub <noreply@github.com>2019-11-28 08:08:04 +0100
commita075c932f1e88b3a4064102cfeb01b17882f2c68 (patch)
tree7c38739e1c0b00da43cab1e1ec728c93b8958d10 /alacritty_terminal/src/ansi.rs
parentb9c513bd27f26271c51ff32fed38ce99abfc7e0d (diff)
downloadalacritty-a075c932f1e88b3a4064102cfeb01b17882f2c68.tar.gz
alacritty-a075c932f1e88b3a4064102cfeb01b17882f2c68.zip
Fix `OSC 52` with empty clipboard param
This fixes the behavior of the clipboard escape (`OSC 52`) when the second parameter is not specified. If it is missing, the parameter is now assumed to be `c`, defaulting to the default clipboard. This has been fixed both for writing and reading. Fixes #3037.
Diffstat (limited to 'alacritty_terminal/src/ansi.rs')
-rw-r--r--alacritty_terminal/src/ansi.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/alacritty_terminal/src/ansi.rs b/alacritty_terminal/src/ansi.rs
index c2388540..f41c3951 100644
--- a/alacritty_terminal/src/ansi.rs
+++ b/alacritty_terminal/src/ansi.rs
@@ -849,13 +849,14 @@ where
// Set clipboard
b"52" => {
- if params.len() < 3 || params[1].is_empty() {
+ if params.len() < 3 {
return unhandled(params);
}
+ let clipboard = params[1].get(0).unwrap_or(&b'c');
match params[2] {
- b"?" => self.handler.write_clipboard(params[1][0], writer),
- base64 => self.handler.set_clipboard(params[1][0], base64),
+ b"?" => self.handler.write_clipboard(*clipboard, writer),
+ base64 => self.handler.set_clipboard(*clipboard, base64),
}
},