From: Patrick Palka <patrick@parcs.ath.cx>
To: gdb-patches@sourceware.org
Cc: Patrick Palka <patrick@parcs.ath.cx>
Subject: [PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI
Date: Thu, 08 Jan 2015 04:05:00 -0000 [thread overview]
Message-ID: <1420689885-31156-3-git-send-email-patrick@parcs.ath.cx> (raw)
In-Reply-To: <1420689885-31156-1-git-send-email-patrick@parcs.ath.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
next prev parent reply other threads:[~2015-01-08 4:05 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-08 4:05 [PATCH 1/3] Remove superfluous function key_is_command_char() Patrick Palka
2015-01-08 4:05 ` Patrick Palka [this message]
2015-01-08 11:39 ` [PATCH 3/3] Don't flush the prompt when resizing the terminal within TUI Pedro Alves
2015-01-08 4:05 ` [PATCH 2/3] TUI: Don't print KEY_RESIZE keys Patrick Palka
2015-01-08 11:29 ` Pedro Alves
2015-01-08 12:32 ` Patrick Palka
2015-01-08 13:22 ` Pedro Alves
2015-01-08 13:38 ` Patrick Palka
2015-02-11 0:25 ` Patrick Palka
2015-02-16 22:42 ` Pedro Alves
2015-02-17 0:53 ` Patrick Palka
2015-02-17 10:23 ` Pedro Alves
2015-02-17 13:02 ` Patrick Palka
2015-02-17 13:24 ` Patrick Palka
2015-01-08 11:40 ` [PATCH 1/3] Remove superfluous function key_is_command_char() Pedro Alves
2015-01-08 13:34 ` Eli Zaretskii
2015-01-08 13:48 ` Patrick Palka
2015-01-08 14:58 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1420689885-31156-3-git-send-email-patrick@parcs.ath.cx \
--to=patrick@parcs.ath.cx \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).