Sanitize contents of remote print

This commit is contained in:
Kovid Goyal 2023-11-06 21:52:50 +05:30
parent 72635c55c5
commit 08d99967dc
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

View file

@ -451,10 +451,7 @@ def cmd_output(screen: Screen, which: CommandOutput = CommandOutput.last_run, as
def process_remote_print(msg: memoryview) -> str:
from base64 import standard_b64decode
from .cli import green
text = standard_b64decode(msg).decode('utf-8', 'replace')
return text.replace('\x1b', green(r'\e')).replace('\a', green(r'\a')).replace('\0', green(r'\0'))
return replace_c0_codes_except_nl_space_tab(standard_b64decode(msg)).decode('utf-8', 'replace')
class EdgeWidths: