From 15c4b1961ece95ef3a04fd6688a5ad02ba7e9373 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 4 Apr 2017 23:51:20 +0530 Subject: [PATCH] Add a few missing commands to replay --- kitty/client.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/kitty/client.py b/kitty/client.py index 07668384d..baa480ff5 100644 --- a/kitty/client.py +++ b/kitty/client.py @@ -19,10 +19,30 @@ def write(x): sys.stdout.flush() +def set_title(*args): + pass + + +def set_icon(*args): + pass + + +def screen_bell(): + pass + + def screen_cursor_position(y, x): write(CSI + '%s;%sH' % (y, x)) +def screen_cursor_forward(amt): + write(CSI + '%sC' % amt) + + +def screen_cursor_back1(amt): + write(CSI + '%sD' % amt) + + def screen_designate_charset(which, to): which = '()'[int(which)] to = chr(int(to)) @@ -57,6 +77,10 @@ def screen_erase_in_display(how, private): write(CSI + ('?' if private else '') + str(how) + 'J') +def screen_erase_in_line(how, private): + write(CSI + ('?' if private else '') + str(how) + 'K') + + def screen_cursor_up2(count): write(CSI + '%dA' % count) @@ -65,6 +89,10 @@ def screen_carriage_return(): write('\r') +def screen_linefeed(): + write('\n') + + def screen_backspace(): write('\x08') @@ -77,8 +105,8 @@ def replay(raw): for line in raw.splitlines(): if line.strip(): cmd, rest = line.partition(' ')[::2] - if cmd == 'draw': - draw(rest) + if cmd in {'draw', 'set_title', 'set_icon'}: + globals()[cmd](rest) else: rest = map(int, rest.split()) if rest else () globals()[cmd](*rest)