mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-10-21 20:52:19 +00:00
DRYer
This commit is contained in:
parent
179c2b21c0
commit
934318adb1
1 changed files with 1 additions and 4 deletions
|
|
@ -777,11 +777,8 @@ class Window:
|
|||
|
||||
def handle_remote_print(self, msg: bytes) -> None:
|
||||
from base64 import standard_b64decode
|
||||
from .cli import green
|
||||
text = standard_b64decode(msg).decode('utf-8')
|
||||
|
||||
def green(x: str) -> str:
|
||||
return f'\x1b[32m{x}\x1b[39m'
|
||||
|
||||
text = text.replace('\x1b', green(r'\e')).replace('\a', green(r'\a')).replace('\0', green(r'\0'))
|
||||
print(text, end='', file=sys.stderr)
|
||||
sys.stderr.flush()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue