I am working on an application that requires running many long running scripts, some of which I want to restart from time to time. Currently, I am trying to use gnome-terminal
to solve this problem, so I have created a startup script that looks like:
#!/bin/bash -e
cd `hg root`
gnome-terminal \
--tab \
--working-directory=$PWD \
--title run-server \
-e ./bin/run-server.sh \
--tab \
--working-directory=$PWD \
--title run-client \
-e ./bin/run-client.sh \
# etc.
This creates the window and set of tabs that I want, so initially, everything looks great.
The problem is that when I hit ctrl-C in the first tab to kill the server, it closes the tab. What I want to happen is for ./bin/run-server.sh
to die and then I should be able to press up and then enter (because it should be the last thing in my history) to start it off again.
Is there a way to do this using gnome-terminal
or equivalent on Ubuntu?