Add support for the color settings stack that XTerm copied from us without acknowledgement and decided to use incompatible escape codes for.

Completely in keeping with that project's past behavior.
See https://github.com/kovidgoyal/kitty/issues/879

XTerm announcement:
https://www.mail-archive.com/xorg@lists.x.org/msg06419.html
This commit is contained in:
Kovid Goyal
2020-12-21 21:39:05 +05:30
parent e97f1a4310
commit 5f8dee8384
10 changed files with 120 additions and 29 deletions

View File

@@ -11,7 +11,6 @@
import sys
from contextlib import suppress
from typing import Any
from functools import partial
CSI = '\033['
@@ -109,6 +108,18 @@ def screen_delete_characters(count: int) -> None:
write(CSI + '%dP' % count)
def screen_push_colors(which: int) -> None:
write(CSI + '%d#P' % which)
def screen_pop_colors(which: int) -> None:
write(CSI + '%d#Q' % which)
def screen_report_colors() -> None:
write(CSI + '#R')
def screen_insert_characters(count: int) -> None:
write(CSI + '%d@' % count)
@@ -193,8 +204,6 @@ def write_osc(code: int, string: str = '') -> None:
set_dynamic_color = set_color_table_color = write_osc
screen_push_dynamic_colors = partial(write_osc, 30001)
screen_pop_dynamic_colors = partial(write_osc, 30101)
def replay(raw: str) -> None: