Force run program into Terminal?

Linux specific forum
arma
User
User
Posts: 60
Joined: Sun Jul 24, 2016 11:54 pm

Force run program into Terminal?

Post 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","","")
User avatar
greyhoundcode
Enthusiast
Enthusiast
Posts: 108
Joined: Sun Dec 30, 2007 7:24 pm

Re: Force run program into Terminal?

Post 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.
Post Reply