diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-20 06:04:44 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-20 06:04:44 -0500 |
commit | 60c5f9aad1d9442a829ac5651fc80e5f6363596f (patch) | |
tree | a9965b8b3969e629cb84d28197daad4dc2b299b4 /clients/urwid/main.py | |
parent | fa9cc49337b88f42d0c78e25be698dd90b2498fb (diff) | |
download | bbj-60c5f9aad1d9442a829ac5651fc80e5f6363596f.tar.gz |
properly handle C-z in editor mode
Diffstat (limited to 'clients/urwid/main.py')
-rw-r--r-- | clients/urwid/main.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clients/urwid/main.py b/clients/urwid/main.py index a6b4da0..afb1c90 100644 --- a/clients/urwid/main.py +++ b/clients/urwid/main.py @@ -1521,7 +1521,7 @@ class ExternalEditor(urwid.Terminal): def keypress(self, size, key): if key in ["down", "up", "left", "right"]: - # HACK HACK HACK HACK: something somewhere is capturing some keys within + # HACK: something somewhere is capturing some keys within # the parent keypress method until some other keys are pressed. So when # this widget was spawned, it would ignore arrow keys, C-n/C-p, pager keys, # but when some _OTHER_ keys were pressed, this lock was released. Weird shit. @@ -1534,10 +1534,11 @@ class ExternalEditor(urwid.Terminal): return os.write(self.master, key) elif key.lower() == "ctrl l": - # always do this, and also pass it to the terminal wipe_screen() + # always do this, and also pass it to the terminal - elif key not in ["f1", "f2", "f3"]: + keyl = key.lower() + if keyl not in ["f1", "f2", "f3", "ctrl z"]: return super(ExternalEditor, self).keypress(size, key) elif key == "f1": @@ -1551,6 +1552,9 @@ class ExternalEditor(urwid.Terminal): elif key == "f3": app.formatting_help() + elif keyl == "ctrl z": + os.killpg(os.getpgid(os.getpid()), 19) + def __del__(self): """ |