Make debugging kittens a little nicer

Now debug() writes to the stderr of the parent kitty process instead of
a temp file.
This commit is contained in:
Kovid Goyal
2018-05-19 16:32:08 +05:30
parent 646a349d82
commit fb57653665
7 changed files with 40 additions and 12 deletions

View File

@@ -328,6 +328,12 @@ class Window:
def handle_remote_cmd(self, cmd):
get_boss().handle_remote_cmd(cmd, self)
def handle_remote_print(self, msg):
from base64 import standard_b64decode
msg = standard_b64decode(msg).decode('utf-8')
print(msg, end='', file=sys.stderr)
sys.stderr.flush()
def send_cmd_response(self, response):
self.screen.send_escape_code_to_child(DCS, '@kitty-cmd' + json.dumps(response))