diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2017-06-30 06:59:12 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2017-06-30 06:59:12 -0700 |
commit | 81e53d6dc75c32696888d83cf15be17fe9f56a46 (patch) | |
tree | 6dacf56cdf00927b8d24e1f9685cb1ce091aed81 /linenoise | |
parent | 3e9b194c37fb55b247f60fcbe6af9cd952858a11 (diff) | |
download | txr-81e53d6dc75c32696888d83cf15be17fe9f56a46.tar.gz txr-81e53d6dc75c32696888d83cf15be17fe9f56a46.tar.bz2 txr-81e53d6dc75c32696888d83cf15be17fe9f56a46.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.
Diffstat (limited to 'linenoise')
-rw-r--r-- | linenoise/linenoise.c | 11 |
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; } |