Implement drawing of titlebar, remembering of mode and fix various bugs in tui

This commit is contained in:
Kovid Goyal
2018-02-10 12:57:57 +05:30
parent 4d92f4871a
commit 3363a9459b
3 changed files with 70 additions and 31 deletions

View File

@@ -56,6 +56,8 @@ def raw_terminal(fd):
def write_all(fd, data):
if isinstance(data, str):
data = data.encode('utf-8')
while data:
n = os.write(fd, data)
if not n:
@@ -258,7 +260,7 @@ class Loop:
del handler.write_buf[:consumed]
def _wakeup_ready(self, handler):
data = os.read(self.wakeup_read_fd)
data = os.read(self.wakeup_read_fd, 1024)
if b'r' in data:
screen_size.changed = True
handler.on_resize(screen_size())