Closed zeeshansayyed closed 3 years ago
I'm not sure what you mean. Could you provide a minimal example of the behavior you're describing?
I might have a related 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).
@makrobios That's likely a separate bug. Could you make a new, separate issue?
Can you give a minimal reproducing example?
Most likely the redirection is breaking pudb's ability (or more likely, urwid's ability) to detect the terminal size, so it defaults to something like 20x80.
And I also agree that @makrobios's issue is different. That looks like urwid is not responding to WINCH signals correctly (both issues are probably urwid bugs, though I wouldn't rule out that pudb is somehow doing something to break them).
@makrobios That's likely a separate bug. Could you make a new, separate issue?
Sure!
Sorry for not providing an example earlier. Life happened and it kind of went off my to do list. Thanks @makrobios for bouncing this thread and reminding me. Here's an example.
Have a very simple python script in a file called pudb_test.py
as follows:
import pudb
pu.db
print("Hello World")
print("This is a a pudb redirection test")
print("Test completed")
Now when you run this file with python pudb_test.py
, everything works as expected.
But when you run this file and redirect its output, let's say using tee for example, as python pudb_test | tee -a output.txt
, then the main pudb window is all squished as shown in the original stackoverflow question I posted. Here is the link to the image.
I hope you are able to reproduce it with this.
Thanks for clarifying. IMO, what you're trying cannot work, as pudb's stdout is not a pseudoterminal in that case, and thus the ioctls it would use to get the terminal size will not work.
Thanks a lot @inducer In such cases, where I am debugging big projects which have redirections in them, what would be the best work around that you would use? In the project which I was working on, I ended up adding a debug flag which manually removed any/all redirections that were happening. It worked, but wasn't pretty us many log files stopped being printed. So for instance, could I manually change the window size when pudb starts?
According to the discussion here, any sort of redirection of output of a python script to another file, causes the pudb debugging window to be very small rendering it unusable.
When we remove the redirection, everything works as expected. Should this be filed as bug?