This commit is contained in:
Kovid Goyal 2022-09-04 13:58:16 +05:30
parent 607bc845fc
commit 31fe35cd38
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 6 deletions

View File

@ -45,6 +45,7 @@ class Handler:
mouse_tracking = MouseTracking.none
terminal_io_ended = False
overlay_ready_report_needed = False
perform_default_key_actions = True # ctrl-c/ctrl-d will call on_interrupt and on_eot
def _initialize(
self,

View File

@ -330,12 +330,13 @@ class Loop:
except Exception:
pass
else:
if k.matches('ctrl+c'):
self.handler.on_interrupt()
return
if k.matches('ctrl+d'):
self.handler.on_eot()
return
if self.handler.perform_default_key_actions:
if k.matches('ctrl+c'):
self.handler.on_interrupt()
return
if k.matches('ctrl+d'):
self.handler.on_eot()
return
self.handler.on_key_event(k)
def _on_pm(self, pm: str) -> None: