whroberts
Posts: 5
Joined: Thu Mar 22, 2018 2:32 pm

How to suppress dispay of terminal window

Mon Apr 02, 2018 10:15 am

Hi,
I've had a 3B+ for a couple of weeks, and this is my first experience of Linux (lots of experience with Windows). I've been writing some Python code to handle the Pi Camera module, and also some small Python programs to test out the guizero library for producing interactive screens.

It's all working well, except that whenever I run the code (from Geany) I also get a terminal window displayed. I'm running Geany from the desktop environment, nothing from the terminal. This isn't too much of a problem with the camera program, as the preview currently takes up the whole screen, but is a bit annoying with the GUI tests. Is there any way to suppress the display of the terminal window?

One thing I have noticed - I've created a desktop icon to run the Python camera program (using a .desktop file), and when run from the icon the terminal window isn't displayed. I think it's still there in the background, though, as when the program closes after taking a photo, the mouse cursor stays as an hourglass for a short while. I guess this is because it's waiting for the hidden terminal window to shut itself down??

So, is there any way to hide the terminal when running from the program editor, or is it only suppressed when run as an icon from the desktop?
I should also mention that I'm using the standard Raspbian os.

Thanks for any help or suggestions.

Bill

W. H. Heydt
Posts: 12785
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: How to suppress dispay of terminal window

Mon Apr 02, 2018 5:28 pm

That's largely because the stuff you're running, programs that are CLI commands or shell scripts. And they actually run in a terminal window even if some of their inputs and outputs are done in the GUI. Bear in mind that the entire desktop is just a shell script that is run from a command line (startx). Linux isn't an inherently graphical environment. But then, neither is Windows. MS just hides it better and not for your benefit.

whroberts
Posts: 5
Joined: Thu Mar 22, 2018 2:32 pm

Re: How to suppress dispay of terminal window

Fri Apr 06, 2018 3:15 pm

Thanks for your reply.

I've solved the problem by ditching Geany and using Spyder3 instead. It takes a bit longer to load, but has the advantage of having a built-in terminal window, so all the output goes to the window within the editor rather than opening a separate terminal window. It's the editor that I've been using on Windows as well, so for me it's a more comfortable fit.

Return to “Beginners”