Page 1 of 1

Force run program into Terminal?

Posted: Thu Aug 18, 2016 6:43 pm
by arma
Hello everybody;

Is there any way to execute program into terminal?. But main program will start by double click... Not run from terminal...

Thank You?

RunProgram("myProgram","","")

Re: Force run program into Terminal?

Posted: Fri Aug 26, 2016 8:31 pm
by greyhoundcode
So it sounds like you have written a command line app, but wish to create a desktop/launcher icon for it that will automatically open this app in the terminal. If so, what I would do in this situation (Ubuntu) is create a .desktop file and include an entry along the following lines:

Code: Select all

Name=My App
Exec=gnome-terminal -x path/to/myapp
That is, you would really be launching the Gnome terminal emulator and telling it to immediately execute your app. Of course, not every distro uses the .desktop launcher format and they won't all use Gnome Terminal, either, so you'd need to adapt to suit.