aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-interp.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/tui/tui-interp.c')
-rw-r--r--gdb/tui/tui-interp.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/gdb/tui/tui-interp.c b/gdb/tui/tui-interp.c
index 331e97f..f70e1a7 100644
--- a/gdb/tui/tui-interp.c
+++ b/gdb/tui/tui-interp.c
@@ -247,6 +247,27 @@ tui_interp::init (bool top_level)
tui_ensure_readline_initialized ();
}
+/* Used as the command handler for the tui. */
+
+static void
+tui_command_line_handler (gdb::unique_xmalloc_ptr<char> &&rl)
+{
+ /* When a tui enabled GDB is running in either tui mode or cli mode then
+ it is always the tui interpreter that is in use. As a result we end
+ up in here even in standard cli mode.
+
+ We only need to do any special actions when the tui is in use
+ though. When the tui is active the users return is not echoed to the
+ screen as a result the display will not automatically move us to the
+ next line. Here we manually insert a newline character and move the
+ cursor. */
+ if (tui_active)
+ tui_inject_newline_into_command_window ();
+
+ /* Now perform GDB's standard CLI command line handling. */
+ command_line_handler (std::move (rl));
+}
+
void
tui_interp::resume ()
{
@@ -266,7 +287,7 @@ tui_interp::resume ()
gdb_setup_readline (1);
- ui->input_handler = command_line_handler;
+ ui->input_handler = tui_command_line_handler;
if (stream != NULL)
tui_old_uiout->set_stream (gdb_stdout);