inducer / pudb

Full-screen console debugger for Python
https://documen.tician.de/pudb/
Other
3k stars 230 forks source link

PuDB does not update for terminal size changes [Urwid issue] #421

Open pyrrhull opened 3 years ago

pyrrhull commented 3 years ago

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). pudb

Originally posted by @makrobios in https://github.com/inducer/pudb/issues/410#issuecomment-758295335

inducer commented 3 years ago

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)
pyrrhull commented 3 years ago

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?

inducer commented 3 years ago

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.

inducer commented 3 years ago

Filed a PR in Urwid with this change: https://github.com/urwid/urwid/pull/453. Let's see what they say.

kulvait commented 2 years ago

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.

kulvait commented 2 years ago

The patch mentioned also do not fix my issue.