Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Patrick Palka <patrick@parcs.ath.cx>
To: gdb-patches@sourceware.org
Cc: Patrick Palka <patrick@parcs.ath.cx>
Subject: [PATCH] Ensure rl_get_screen_size() returns the actual terminal dimensions
Date: Mon, 01 Sep 2014 01:25:00 -0000	[thread overview]
Message-ID: <1409534708-31981-1-git-send-email-patrick@parcs.ath.cx> (raw)

We should call rl_resize_terminal() before calling rl_get_screen_size()
to help ensure that rl_get_screen_size() will return the correct
terminal dimensions.  Doing so fixes a couple issues where TUI does not
correctly resize itself due to rl_get_screen_size() returning stale
terminal dimensions.

	* tui/tui-win.c (tui_resize_all): Call rl_resize_terminal before
	calling rl_get_screen_size.
---
 gdb/tui/tui-win.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gdb/tui/tui-win.c b/gdb/tui/tui-win.c
index b117634..05539fe 100644
--- a/gdb/tui/tui-win.c
+++ b/gdb/tui/tui-win.c
@@ -655,6 +655,7 @@ tui_resize_all (void)
   int height_diff, width_diff;
   int screenheight, screenwidth;
 
+  rl_resize_terminal ();
   rl_get_screen_size (&screenheight, &screenwidth);
   width_diff = screenwidth - tui_term_width ();
   height_diff = screenheight - tui_term_height ();
-- 
2.1.0


             reply	other threads:[~2014-09-01  1:25 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-01  1:25 Patrick Palka [this message]
2014-09-04 10:48 ` Pedro Alves
2014-09-04 10:52   ` Pedro Alves
2014-09-04 11:58     ` Patrick Palka
2014-09-04 17:52       ` Pedro Alves

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=1409534708-31981-1-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