This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Ensure rl_get_screen_size() returns the actual terminal dimensions
- 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: Sun, 31 Aug 2014 21:25:08 -0400
- Subject: [PATCH] Ensure rl_get_screen_size() returns the actual terminal dimensions
- Authentication-results: sourceware.org; auth=none
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