aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-io.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-01-12 13:35:06 -0700
committerTom Tromey <tom@tromey.com>2019-01-14 16:17:17 -0700
commitbbd94648f2115338bd94e9800ba0e37f09d98a79 (patch)
treefaf3114909bef4bf765392efecd1a3a8a985fc7f /gdb/tui/tui-io.c
parent8f0a21480babea5b22cba13a3bee722408ca57e3 (diff)
downloadgdb-bbd94648f2115338bd94e9800ba0e37f09d98a79.zip
gdb-bbd94648f2115338bd94e9800ba0e37f09d98a79.tar.gz
gdb-bbd94648f2115338bd94e9800ba0e37f09d98a79.tar.bz2
Fix placement of output in TUI mode
The fix for PR tui/28819 regressed gdb command output a bit. In "nonl" mode, pressing the Enter key will result in a newline not being echoed properly, so that gdb output for the command will begin on the same line as the input. This patch changes gdb_wgetch to echo the newline. I have only tested this interactively, as the TUI doesn't have automated tests in general. gdb/ChangeLog 2019-01-14 Tom Tromey <tom@tromey.com> PR tui/28819: * tui/tui-io.c (gdb_wgetch): Print \r when needed.
Diffstat (limited to 'gdb/tui/tui-io.c')
-rw-r--r--gdb/tui/tui-io.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 0e53350..9191cca 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -609,6 +609,12 @@ gdb_wgetch (WINDOW *win)
nonl ();
int r = wgetch (win);
nl ();
+ /* In nonl mode, if the user types Enter, it will not be echoed
+ properly. This will result in gdb output appearing immediately
+ after the command. So, if we read \r, emit a \r now, after nl
+ mode has been re-entered, so that the output looks correct. */
+ if (r == '\r')
+ puts ("\r");
return r;
}