Silence the errors about OSC 7

Up to now this poorly designed and completely unnecessary escape code
was relegated to only GNOME, however, off late Apple has started using
it as well, so silently ignore it, instead of spamming error messages
for it.
This commit is contained in:
Kovid Goyal
2021-01-29 12:43:41 +05:30
parent 68423b3603
commit ac2a33d09f
4 changed files with 15 additions and 2 deletions

View File

@@ -207,14 +207,15 @@ def write_osc(code: int, string: str = '') -> None:
write(OSC + str(code) + string + '\x07')
set_dynamic_color = set_color_table_color = write_osc
set_dynamic_color = set_color_table_color = process_cwd_notification = write_osc
def replay(raw: str) -> None:
specials = {'draw', 'set_title', 'set_icon', 'set_dynamic_color', 'set_color_table_color', 'process_cwd_notification'}
for line in raw.splitlines():
if line.strip() and not line.startswith('#'):
cmd, rest = line.partition(' ')[::2]
if cmd in {'draw', 'set_title', 'set_icon', 'set_dynamic_color', 'set_color_table_color'}:
if cmd in specials:
globals()[cmd](rest)
else:
r = map(int, rest.split()) if rest else ()