From a2d6a041eb1a9e827476840bd2f0064c540b6f70 Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Sat, 24 Sep 2011 03:06:16 +0000 Subject: [PATCH] fs_cli: ask less of the terminal; fix ctrl-l behavior --- libs/esl/fs_cli.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 9e5a6e051b..4dc2c5c6eb 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -575,7 +575,6 @@ static int stdout_writable(void) static void clear_line(void) { - printf("\033[s"); putchar('\r'); printf("\033[K"); fflush(stdout); @@ -591,7 +590,12 @@ static void redisplay(void) putchar(*c); c++; } - printf("\033[u"); + { + int pos = (int)(lf->cursor - lf->buffer); + putchar('\r'); + printf("\033[%dC", bare_prompt_str_len); + if (pos > 0) printf("\033[%dC", pos); + } fflush(stdout); return; }