dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit c31cdd9108467d58771e1cd0bec4ff7559b7b61c
parent c2014b27fdda66be06d25abbc586ad689a7402cb
Author: Mark Edgar <medgar123@gmail.com>
Date:   Sun, 22 Sep 2013 21:31:32 +0200

Move blocking getch() call for escapekey() to main select loop.

Diffstat:
dvtm.c | 10+++++-----
1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/dvtm.c b/dvtm.c @@ -195,6 +195,7 @@ static const char *shell; static char *copybuf; static volatile sig_atomic_t running = true; static bool runinall = false; +static bool escape_next_key = false; static void eprint(const char *errstr, ...) { @@ -779,11 +780,7 @@ copymode(const char *args[]) { static void escapekey(const char *args[]) { - int key; - if ((key = getch()) >= 0) { - debug("escaping key `%c'\n", key); - keypress(CTRL(key)); - } + escape_next_key = true; } static void @@ -1407,6 +1404,9 @@ main(int argc, char *argv[]) { else if ((key = keybinding(mod, code))) key->action.cmd(key->action.args); mod = ERR; + } else if (escape_next_key) { + keypress(code); + escape_next_key = false; } else if (code == KEY_MOUSE) { handle_mouse(); } else if (is_modifier(code)) {