From: Christian Heller Date: Tue, 17 Jun 2025 15:52:36 +0000 (+0200) Subject: Handle ctrl+l as screen resize event, compatible with dtach's defaults. X-Git-Url: https://plomlompom.com/repos/%22https:/validator.w3.org/%7B%7Bprefix%7D%7D/ledger?a=commitdiff_plain;p=ircplom Handle ctrl+l as screen resize event, compatible with dtach's defaults. --- diff --git a/ircplom/tui.py b/ircplom/tui.py index 77d098d..7345aa8 100644 --- a/ircplom/tui.py +++ b/ircplom/tui.py @@ -28,6 +28,7 @@ _PROMPT_TEMPLATE = '> ' _PROMPT_ELL_IN = '<…' _PROMPT_ELL_OUT = '…>' +_ORD_CHAR_RESIZE = 12 _KEYBINDINGS = { 'KEY_BACKSPACE': ('window.prompt.backspace',), 'KEY_ENTER': ('prompt_enter',), @@ -402,7 +403,9 @@ class _KeyboardLoop(Loop, BroadcastMixin): 'Loop receiving and translating keyboard events towards main loop.' def process_bonus(self, yielded: str) -> None: - if yielded.startswith(_B64_PREFIX): + if yielded and ord(yielded[0]) == _ORD_CHAR_RESIZE: + self.broadcast(_SetScreenEvent) + elif yielded.startswith(_B64_PREFIX): encoded = yielded[len(_B64_PREFIX):] to_paste = '' for i, c in enumerate(b64decode(encoded).decode('utf-8')):