This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI
- From: Patrick Palka <patrick at parcs dot ath dot cx>
- To: gdb-patches at sourceware dot org
- Cc: Patrick Palka <patrick at parcs dot ath dot cx>
- Date: Wed, 7 Jan 2015 23:04:45 -0500
- Subject: [PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI
- Authentication-results: sourceware.org; auth=none
- References: <1420689885-31156-1-git-send-email-patrick at parcs dot ath dot cx>
This patch removes the ancient code that is responsible for forcing the
prompt to get flushed and executed when tui_getc() detects that the
terminal has been resized. This behavior is unintuitive and seemingly
unnecessary. I tried figuring out why tui_getc() behaves this way, but
git-blame does not reveal anything informative about this code. It
probably has something to do with avoiding to print KEY_RESIZE keys, but
the previous patch prevents that from happening anymore.
gdb/ChangeLog:
* tui/tui-io.c (tui_handle_resize_during_io): Remove parameter.
Change return type to void. Don't call dont_repeat.
(tui_getc): Adjust.
---
gdb/tui/tui-io.c | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index b0e6c75..f072bdb 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -135,7 +135,7 @@ static int tui_readline_pipe[2];
This may be the main gdb prompt or a secondary prompt. */
static char *tui_rl_saved_prompt;
-static unsigned int tui_handle_resize_during_io (unsigned int);
+static void tui_handle_resize_during_io (void);
static void
tui_putc (char c)
@@ -642,7 +642,8 @@ tui_getc (FILE *fp)
#endif
ch = wgetch (w);
- ch = tui_handle_resize_during_io (ch);
+
+ tui_handle_resize_during_io ();
/* The \n must be echoed because it will not be printed by
readline. */
@@ -709,19 +710,15 @@ tui_getc (FILE *fp)
}
-/* Cleanup when a resize has occured.
- Returns the character that must be processed. */
-static unsigned int
-tui_handle_resize_during_io (unsigned int original_ch)
+/* Cleanup when a resize has occured. */
+
+static void
+tui_handle_resize_during_io (void)
{
if (tui_win_resized ())
{
tui_resize_all ();
tui_refresh_all_win ();
- dont_repeat ();
tui_set_win_resized_to (FALSE);
- return '\n';
}
- else
- return original_ch;
}
--
2.2.1.212.gc5b9256