Make command line editing (use of readline) be per UI
[deliverable/binutils-gdb.git] / gdb / tui / tui-interp.c
index 452dd204f806f084257f474df760d45792cce23b..85bb26d99632bd73b668909eb728b4426f7eae86 100644 (file)
@@ -18,6 +18,7 @@
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
+#include "cli/cli-interp.h"
 #include "interps.h"
 #include "top.h"
 #include "event-top.h"
@@ -219,6 +220,7 @@ tui_init (struct interp *self, int top_level)
 static int
 tui_resume (void *data)
 {
+  struct ui *ui = current_ui;
   struct ui_file *stream;
 
   /* gdb_setup_readline will change gdb_stdout.  If the TUI was
@@ -232,7 +234,9 @@ tui_resume (void *data)
       stream = NULL;
     }
 
-  gdb_setup_readline ();
+  gdb_setup_readline (1);
+
+  ui->input_handler = command_line_handler;
 
   if (stream != NULL)
     cli_out_set_stream (tui_old_uiout, gdb_stdout);
@@ -274,7 +278,8 @@ static const struct interp_procs tui_interp_procs = {
   tui_exec,
   tui_ui_out,
   NULL,
-  cli_command_loop
+  cli_command_loop,
+  cli_interpreter_supports_command_editing,
 };
 
 /* Factory for TUI interpreters.  */
This page took 0.032773 seconds and 4 git commands to generate.