If non-base64 encoded data sent via OSC 52 clear the clipboard as suggested by xterm docs

This commit is contained in:
Kovid Goyal 2018-05-28 21:26:59 +05:30
parent 51706ed195
commit 88d0499818
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -27,7 +27,7 @@ from .keys import keyboard_mode_name
from .rgb import to_color
from .terminfo import get_capabilities
from .utils import (
color_as_int, get_primary_selection, load_shaders, log_error, open_cmd,
color_as_int, get_primary_selection, load_shaders, open_cmd,
open_url, parse_color_set, sanitize_title, set_primary_selection
)
@ -361,8 +361,7 @@ class Window:
try:
text = standard_b64decode(text).decode('utf-8')
except Exception:
log_error('Invalid data to write to clipboard received, ignoring')
return
text = ''
if 's' in where or 'c' in where:
if 'write-clipboard' in self.opts.clipboard_control:
set_clipboard_string(text)