Disallow OSC 52 for unfocused window

This leads to issues on macOS, since if we store clipboard at the same
time it could error out. Also, on e.g. Wayland the clipboard store for
unfocused window won't work anyway.
This commit is contained in:
Kirill Chibisov authored and GitHub committed 2022-04-03 23:08:44 +03:00
1 parent 49d64fbeec
commit 851dbc328e
2 files changed
+8 -3

No files matched your search

+1
View File
@@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Changed
- The `--help` output was reworked with a new colorful syntax
- OSC 52 is now disabled on unfocused windows
### Fixed
+7 -3
View File
@@ -1078,11 +1078,15 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
}
},
TerminalEvent::ClipboardStore(clipboard_type, content) => {
self.ctx.clipboard.store(clipboard_type, content);
if self.ctx.terminal.is_focused {
self.ctx.clipboard.store(clipboard_type, content);
}
},
TerminalEvent::ClipboardLoad(clipboard_type, format) => {
let text = format(self.ctx.clipboard.load(clipboard_type).as_str());
self.ctx.write_to_pty(text.into_bytes());
if self.ctx.terminal.is_focused {
let text = format(self.ctx.clipboard.load(clipboard_type).as_str());
self.ctx.write_to_pty(text.into_bytes());
}
},
TerminalEvent::ColorRequest(index, format) => {
let color = self.ctx.terminal().colors()[index]