Use an overlay window for window resizing

Also implement a remote command to resize windows
This commit is contained in:
Kovid Goyal
2018-05-17 23:26:41 +05:30
parent 7c47bd547f
commit 8ea84c97d5
16 changed files with 246 additions and 85 deletions

View File

@@ -61,6 +61,9 @@ class Handler:
def on_job_done(self, job_id, job_result):
pass
def on_kitty_cmd_response(self, response):
pass
def write(self, data):
if isinstance(data, str):
data = data.encode('utf-8')

View File

@@ -236,7 +236,9 @@ class Loop:
self.handler.on_text(chunk, self.in_bracketed_paste)
def _on_dcs(self, dcs):
pass
if dcs.startswith('@kitty-cmd'):
import json
self.handler.on_kitty_cmd_response(json.loads(dcs[len('@kitty-cmd'):]))
def _on_csi(self, csi):
q = csi[-1]

View File

@@ -58,6 +58,10 @@ def bell() -> str:
return '\a'
def beep() -> str:
return '\a'
def set_window_title(value) -> str:
return ('\033]2;' + value.replace('\033', '').replace('\x9c', '') + '\033\\')
@@ -94,6 +98,7 @@ def scroll_screen(amt=1) -> str:
STANDARD_COLORS = {name: i for i, name in enumerate(
'black red green yellow blue magenta cyan gray'.split())}
STANDARD_COLORS['white'] = STANDARD_COLORS['gray']
UNDERLINE_STYLES = {name: i + 1 for i, name in enumerate(
'straight double curly'.split())}