dvtm

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

commit c2014b27fdda66be06d25abbc586ad689a7402cb
parent 51f357c6e01529943eb344f8b8b947fde2802e55
Author: Mark Edgar <medgar123@gmail.com>
Date:   Sat, 26 Oct 2013 23:21:45 +0200

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

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

diff --git a/dvtm.c b/dvtm.c @@ -1345,6 +1345,8 @@ parse_args(int argc, char *argv[]) { int main(int argc, char *argv[]) { + int mod = ERR; + if (!parse_args(argc, argv)) { setup(); startup(NULL); @@ -1399,17 +1401,16 @@ main(int argc, char *argv[]) { int code = getch(); Key *key; if (code >= 0) { - if (code == KEY_MOUSE) { + if (mod >= 0) { + if (code == mod) + keypress(code); + else if ((key = keybinding(mod, code))) + key->action.cmd(key->action.args); + mod = ERR; + } else if (code == KEY_MOUSE) { handle_mouse(); } else if (is_modifier(code)) { - int mod = code; - code = getch(); - if (code >= 0) { - if (code == mod) - keypress(code); - else if ((key = keybinding(mod, code))) - key->action.cmd(key->action.args); - } + mod = code; } else if ((key = keybinding(0, code))) { key->action.cmd(key->action.args); } else if (sel && vt_copymode(sel->term)) {