I want to start a new gnome-terminal window with some command in multiple tabs. Based to this question:
gnome-terminal --tab -t "FOO" -e "/bin/zsh -i -c 'cd $(pwd); zsh -i'" \
--tab -t "XYZ" -e "/bin/zsh -i -c 'cd $(pwd); tail -f /var/log/dmesg; zsh -i'"
The problem I'm facing is that after I CTRL-C the blocking tail -f
tab just quits and disappears. Though, I'd like it to stay open and possibly inspect the past output.
Somehow my guess is that some parent gets the SIGINT
and quits it all together instead of sending it to the tail
command.
For instance, a simple sleep
works just fine:
gnome-terminal --tab -t "FOO" -e "/bin/zsh -i -c 'cd $(pwd); zsh -i'" \
--tab -t "XYZ" -e "/bin/zsh -i -c 'cd $(pwd); sleep 3; zsh -i'"
This will keep both tabs open with a prompt.