Menu

#12 pythondialog messagebox grafic Bug

v3
closed
notabug (3)
5
2021-06-23
2021-06-17
yoloknight
No

Hi guys,

in this link: https://askubuntu.com/questions/1346067/grafic-problem-with-pythondialog-in-ubuntu-20-04 (please ignore the 'line 5 errors and tracebacks' that not my issue)

I already tried some answers, but the suggestion is with the widget size. So my problem is not the size or whatsoever, more if you look closly that the "printlines are in the blue box/retangle". If I have a ssh command, I get the whole login window inside the blue message Box.

For me its a Bug in Ubuntu 20.04 with the inputbox. In short...the blue box/retangle from the inputdialog dont closes correclty or its border. The side effect is that some print statements are IN the blue Box. In Ubuntu 18.04 we have not this kind of behavior.

And sorry if I´m a little bit confusing.

1 Attachments

Discussion

  • Florent Rougon

    Florent Rougon - 2021-06-17

    Hello,

    You (or a command started by you, or an error triggered by you) are printing text to the terminal after a dialog call: without surprise, this prints text to the terminal. There is no window system built into the terminal that “knows” that some area must not be written to by any program. The same issue could be reproduced with dialog (no need for pythondialog), but is a bug for neither of them. If you start a program that writes to the terminal and don't want it to write to the terminal, it is your responsibility to redirect the stdout and/or stderr of this program (ssh or whatever) to some pipe or file so that it doesn't land on the terminal where you don't want display to be disturbed.

    The Python subprocess module allows one to easily redirect stdin, stdout and/or stderr of a subprocess from or to specified pipes. This should do the trick if your ssh command is non-interactive (a batch command, so to speak). On the contrary, a login shell needs a controlling terminal, so if your ssh call is interactive, that will probably be more difficult (I think using a pty could do, but no guarantee, and you'd probably need a separate terminal for it, or something like tmux or screen). Better deal with non-interactive commands! SSH keys can help login to the remote host without needing to interactively enter the password.

    This is unrelated, but N0rbert in your link is right about your sample code using an incorrect keyword argument for the Dialog constructor.

     
  • Florent Rougon

    Florent Rougon - 2021-06-17
    • labels: inputbox --> notabug
    • assigned_to: Florent Rougon
     
    • yoloknight

      yoloknight - 2021-06-17

      Thank you for your quick reply. :)
      What I dont get is, this code works finde in Ubuntu 18.04 and even with ssh I have not this problems. Are there diffrents between the distibution, that invokes that kind of behavior?

      Or is there a why to give the inputbox an artificial border around it?

      Jep N0rbert is right with the error, but the error was on purpose to show the printlines in the blue box.

       
  • Florent Rougon

    Florent Rougon - 2021-06-17

    Sorry, I don't know what code worked fine in Ubuntu 18.04 because no correct code was shown here. I tried to explain that pythondialog uses dialog which writes to the terminal which is not a window system, and has no standard window system either. I don't see a way to give an “artificial border” to windows created by dialog.

     
  • Florent Rougon

    Florent Rougon - 2021-06-23
    • status: open --> closed
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.