This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Don't flush the prompt when resizing the terminal within TUI


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.

Removing this dubious code does not seem to cause any regressions in
TUI.  TUI handles resizes and user input just fine still.

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 | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)

diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 8eca106..5b929ee 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -146,7 +146,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)
@@ -657,7 +657,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.  */
@@ -720,19 +721,14 @@ 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.1.0


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]