I currently have a .sh script that opens 3 new tabs for me and runs a task inside that terminal window:

gnome-terminal --working-directory=/home/hutber/site/refdata_service --tab -e "yarn start:dev" --title "RefData!"

However, when I am inside this tab and exit out of the process with cntrl+c the tab closes and I need to manually go a start the process again.

I would like these tabs to stay open once I close the task.



Instead of running your program directly, use a construct such as

sh -c "<your command> ; bash"

This will open a bash shell after running your command, and as such keep your tab open, until you type exit.

Alternatively, you can have your command included in a script, followed by the command "bash", and call the script as the command for your new gnome-terminal tab.

  • Thank you very much. I did not make it clear that I need it to open 3 separate tabs. This appears to run in your current window. – Jamie Hutber Jun 21 '19 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.