summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-10 22:24:46 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-10 22:24:46 -0500
commiteb6899526db7fb228937f622fdf33c4efb05b04d (patch)
tree849520a2c5c4f54b6a501c3364602635c05ca46b /gpsmon.c
parent793c50a18d8b9d2c5b2df398299e16a29ccc983a (diff)
downloadgpsd-eb6899526db7fb228937f622fdf33c4efb05b04d.tar.gz
Fix up command echoing.
Diffstat (limited to 'gpsmon.c')
-rw-r--r--gpsmon.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/gpsmon.c b/gpsmon.c
index b8238980..2e952b5a 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -371,7 +371,14 @@ void monitor_complain(const char *fmt, ...)
va_end(ap);
(void)wattrset(cmdwin, A_NORMAL);
(void)wrefresh(cmdwin);
+ doupdate();
+
(void)wgetch(cmdwin);
+ (void)wmove(cmdwin, 0, (int)promptlen);
+ (void)wclrtoeol(cmdwin);
+ (void)wrefresh(cmdwin);
+ (void)wmove(cmdwin, 0, (int)promptlen);
+ doupdate();
}
void monitor_log(const char *fmt, ...)
@@ -471,15 +478,16 @@ static void refresh_cmdwin(void)
{
(void)wmove(cmdwin, 0, 0);
(void)wprintw(cmdwin, type_name);
- promptlen = strlen(type_name) + 3;
+ promptlen = strlen(type_name);
if (fallback != NULL && strcmp((*fallback)->driver->type_name, type_name) != 0) {
(void)waddch(cmdwin, (chtype)' ');
(void)waddch(cmdwin, (chtype)'(');
(void)waddstr(cmdwin, (*fallback)->driver->type_name);
(void)waddch(cmdwin, (chtype)')');
- promptlen += strlen((*fallback)->driver->type_name);
+ promptlen += strlen((*fallback)->driver->type_name) + 3;
}
(void)wprintw(cmdwin, "> ");
+ promptlen += 2;
(void)wclrtoeol(cmdwin);
(void)wnoutrefresh(cmdwin);
}
@@ -573,8 +581,11 @@ static bool do_command(void)
return true;
}
+
(void)wmove(cmdwin, 0, (int)promptlen);
(void)wclrtoeol(cmdwin);
+ (void)wrefresh(cmdwin);
+ doupdate();
/* user finished entering a command */
if (input[0] == '\0')