Remote control: Fix kitty @ sometimes failing to read the response from kitty.

Fixes #614
This commit is contained in:
Kovid Goyal
2018-06-08 15:35:01 +05:30
parent 44b84ba295
commit 19721014d0
5 changed files with 123 additions and 41 deletions

View File

@@ -22,7 +22,7 @@ from kitty.key_encoding import (
ALT, CTRL, PRESS, RELEASE, REPEAT, SHIFT, C, D, backspace_key,
decode_key_event, enter_key
)
from kitty.utils import screen_size_function
from kitty.utils import screen_size_function, write_all
from .handler import Handler
from .operations import init_state, reset_state
@@ -41,16 +41,6 @@ def debug(*a, **kw):
fobj.flush()
def write_all(fd, data):
if isinstance(data, str):
data = data.encode('utf-8')
while data:
n = os.write(fd, data)
if not n:
break
data = data[n:]
class TermManager:
def __init__(self, input_fd, output_fd):