From 81e53d6dc75c32696888d83cf15be17fe9f56a46 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 30 Jun 2017 06:59:12 -0700 Subject: 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. --- linenoise/linenoise.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'linenoise') 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; } -- cgit v1.2.3