pudb
pudb copied to clipboard
PuDB does not update for terminal size changes [Urwid issue]
When I resize the terminal (gnome-terminal) the view stays the same size although the window becomes bigger. After I move the cursor it becomes fullsize. It is weird as this only happens with pudb, not with other terminal programs ( I use ubuntu and i3 wm).
Originally posted by @makrobios in https://github.com/inducer/pudb/issues/410#issuecomment-758295335
Took a look. As best as I can tell, this is actually an Urwid issue.
Applying this patch to https://github.com/urwid/urwid/commit/4c739b6be21b0c98324e7b7780d8e712f3ad6db3 fixes the issue for the raw display:
diff --git a/urwid/raw_display.py b/urwid/raw_display.py
index 4c90a68..80156f2 100644
--- a/urwid/raw_display.py
+++ b/urwid/raw_display.py
@@ -538,7 +538,7 @@ class Screen(BaseScreen, RealTerminal):
def _wait_for_input_ready(self, timeout):
ready = None
- fd_list = []
+ fd_list = [self._resize_pipe_rd]
fd = self._input_fileno()
if fd is not None:
fd_list.append(fd)
Great, thanks a lot! I applied your patch to urwid 2.1.2 and it works too. Just out of curiosity, how did you debug this issue?
What I did was start reading at the SIGWINCH
handler in Urwid and figure out how the data makes its way to the main loop from there.
Filed a PR in Urwid with this change: https://github.com/urwid/urwid/pull/453. Let's see what they say.
I have to add that in case of my closed issue https://github.com/inducer/pudb/issues/531 the correct terminal size is not read at all. I am getting just one fixed resolution that does not reflect terminal size I run the debugging in with no way to change it.
The patch mentioned also do not fix my issue.