1

Any solution to this? This happens in certain folders, not in every folder. Cannot figure out what causes this.

Worth mentioning that another c++ program is invoking the python script that has 'from pudb import set_trace' and 'set_trace()' in it.

squished Pudb screen

auro
  • 1,079
  • 1
  • 10
  • 22
  • Assuming you're on Python3, what does `python -c 'import shutil; print(shutil.get_terminal_size())` print? – Wayne Werner Jul 12 '16 at 20:45
  • Thanks. I'm on 2.7.6 – auro Jul 12 '16 at 21:03
  • On 2.7.6, I get a no-attribute for get_terminal_size. – auro Jul 12 '16 at 21:03
  • Getting the terminal size is a bit trickier there. I suspect your problem has to do with `terminfo` somehow getting borked up – Wayne Werner Jul 12 '16 at 21:04
  • I would recommend checking the list of files in that folder. It's likely that you have some file with the wrong name that's shadowing something that `pudb` (or Python) needs. – Wayne Werner Jul 12 '16 at 21:05
  • Thanks. Do you mean the root folder with '.' files – auro Jul 12 '16 at 21:19
  • The screen works in a folder starting with /media and fails in a folder starting with /home – auro Jul 12 '16 at 21:21
  • Wherever you're running your program from – Wayne Werner Jul 12 '16 at 21:21
  • I moved all the relevant files (handful of python scripts and data files) to another folder at the same level. Problem persists. – auro Jul 12 '16 at 21:37
  • Forgot to mention that another c++ program is invoking the python script that has 'import pudb' and 'set_trace()' in it. – auro Jul 12 '16 at 21:39
  • It's *highly* likely that's your problem, then. Since the C++ program is invoking the python script then it's totally possible that it mangles the terminal size that's reported by whatever method figures it out in Python2 and `urwid`. You might be better off reporting a bug on the pudb issue tracker (or maybe urwid?) – Wayne Werner Jul 12 '16 at 21:41
  • Ok. Removing the following string at the tail of the run script fixed it. *2>&1 | tee -a logs/fh_model.log* – auro Jul 12 '16 at 23:12

2 Answers2

1

What else may work for you is the pudb.cfg file. This file can be located at ~/.config/pudb

You can change the sidebar_width = 0.4, where 0.4 can be changed to a value of your taste.

The higher the value, the bigger the screen size.

DevendraK
  • 121
  • 1
  • 4
0

Fixed but not root-caused. Turns out, a redirection (of the logs into a file) in the run-script was causing it. Removing the redirection fixed it.

enter image description here

auro
  • 1,079
  • 1
  • 10
  • 22
  • Can you please tell me what sort of redirection it was? I am also facing a similar issue and I have many redirections in my scripts. Also, do you think this should be filed as a bug in the pudb repo? – shahensha Aug 02 '20 at 04:34
  • Redirection is when you take your console output and send it to a file so that you can review it later. Usually done with '>' or '>>' followed by filename. – auro Aug 03 '20 at 16:42
  • Thanks @auro. I should have been clearer with my question. I wanted to know whether you were redirecting only to a file or also to console? I actually found the problem line in my script. I was redirecting it to both, a file and console using `tee`. I think this is a bug and we should let pudb guys know about it. – shahensha Aug 03 '20 at 17:36