Ubuntu – With a launcher for a terminal application, how can I keep the terminal open after the program is complete

command linegnome-terminallauncher

I have a terminal command I run from an application launcher. This works great, however sometimes the command fails, so I'd like for the terminal to stay open so I can see the results. How can I do this?

Best Answer

Assuming your command is called mycommand, I'd change my launcher to run this:

gnome-terminal -e "mycommand|less"

If you want a more permanent, perhaps cleaner solution, open up gnome-terminal, go to Edit, Profile preferences and click the Title and Command tab. Change the "When command exits" option to "Hold the terminal open".

When you execute commands, it should now leave the terminal open when something runs.

Edit: If you don't really care about the terminal, you could just use xterm's hold flag:

xterm -e "mycommand" hold