Make debug_print remove esc and bel
Should really be made more robust, but cant be bothered
This commit is contained in:
parent
85f6d3fed8
commit
179c2b21c0
@ -778,6 +778,11 @@ class Window:
|
||||
def handle_remote_print(self, msg: bytes) -> None:
|
||||
from base64 import standard_b64decode
|
||||
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…
x
Reference in New Issue
Block a user