summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2017-06-30 06:59:12 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-06-30 06:59:12 -0700
commitb60b04fd6caf5945e471091ee813b6227be1c668 (patch)
tree6dacf56cdf00927b8d24e1f9685cb1ce091aed81
parentc5f585c6c829b239078bbed30210d67a53ef8595 (diff)
downloadtxr-b60b04fd6caf5945e471091ee813b6227be1c668.tar.gz
txr-b60b04fd6caf5945e471091ee813b6227be1c668.tar.bz2
txr-b60b04fd6caf5945e471091ee813b6227be1c668.zip
linenoise: support suspend and refresh in help.
* linenoise/linenoise.c (show_help): Handle Ctrl-Z and Ctrl-L commands, ensuring that the display stays on the same page when these are processed.
-rw-r--r--linenoise/linenoise.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/linenoise/linenoise.c b/linenoise/linenoise.c
index 48d7e0b7..41f9066c 100644
--- a/linenoise/linenoise.c
+++ b/linenoise/linenoise.c
@@ -837,6 +837,17 @@ static void show_help(lino_t *l)
}
}
continue;
+ case CTL('Z'):
+ disable_raw_mode(l);
+ raise(SIGTSTP);
+ enable_raw_mode(l);
+ i -= 1;
+ continue;
+ case CTL('L'):
+ lino_clear_screen(l);
+ l->need_refresh = 1;
+ i -= 1;
+ continue;
default:
continue;
}