* tui/tui.c (tui_rl_command_mode): Update comment. (tui_rl_startup_hook): Don't change to single key mode, if immediate_quit is set. * tui/tui-io.c (tui_redisplay_readline): Likewise. --- gdb/tui/tui-io.c | 8 ++++++-- gdb/tui/tui.c | 9 +++++++-- 2 files changed, 13 insertions(+), 4 deletions(-) Index: src/gdb/tui/tui-io.c =================================================================== --- src.orig/gdb/tui/tui-io.c 2007-09-03 22:27:56.000000000 +0100 +++ src/gdb/tui/tui-io.c 2007-09-15 17:35:18.000000000 +0100 @@ -209,9 +209,13 @@ tui_redisplay_readline (void) /* Detect when we temporarily left SingleKey and now the readline edit buffer is empty, automatically restore the SingleKey - mode. */ + mode, unless gdb is in the middle of executing a command, + possibly expecting user interaction. */ if (tui_current_key_mode == TUI_ONE_COMMAND_MODE && rl_end == 0) - tui_set_key_mode (TUI_SINGLE_KEY_MODE); + { + if (!immediate_quit) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); + } if (tui_current_key_mode == TUI_SINGLE_KEY_MODE) prompt = ""; Index: src/gdb/tui/tui.c =================================================================== --- src.orig/gdb/tui/tui.c 2007-09-03 22:27:58.000000000 +0100 +++ src/gdb/tui/tui.c 2007-09-15 17:33:46.000000000 +0100 @@ -255,7 +255,9 @@ tui_rl_command_key (int count, int key) /* TUI readline command. Temporarily leave the TUI SingleKey mode to allow editing a gdb command with the normal readline. Once the command - is executed, the TUI SingleKey mode is installed back. */ + is executed, the TUI SingleKey mode is installed back, + unless gdb is in the middle of executing a command, possibly + expecting user interaction. */ static int tui_rl_command_mode (int count, int key) { @@ -285,7 +287,10 @@ tui_rl_startup_hook (void) { rl_already_prompted = 1; if (tui_current_key_mode != TUI_COMMAND_MODE) - tui_set_key_mode (TUI_SINGLE_KEY_MODE); + { + if (!immediate_quit) + tui_set_key_mode (TUI_SINGLE_KEY_MODE); + } tui_redisplay_readline (); return 0; }