Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I would like to start terminal window via shell script with 2 splits opened in same window. One should do ssh and other one should change dir when opening. It needs to accept commands to be passed. (something similar to gnome-terminal --tab-with-profile). I'm looking for split window with profile and commands to execute while starting.

share|improve this question
up vote 1 down vote accepted

The tmux and screen terminal multiplexers are often used for this.

tmux new-session -s "$session" -d "ssh foohost"
tmux split-window -t "$session:0"
tmux send-keys -t "$session:0.1" "cd workdir" "Enter"
tmux attach -t "$session"
screen -dmS "$session"
screen -S "$session" -X ...I gave up.
share|improve this answer
Thanks. Your answer gave me an idea to achieve via xsendkeys. terminator -m & sleep 1 xsendkeys control+shift+e xvkbd -xsendevent -text "ssh -X $pool_machine\r" xvkbd -xsendevent -text "cd $sb_dir/src\r" xsendkeys control+shift+p xvkbd -xsendevent -text "cd $choosen/src\r" pool machine is where i need to compile and local machine i run emacs to edit. I like terminator better because i have zoom and hide other windows and bring it when its needed. – sudurais Apr 22 '11 at 19:12
i started using tmux recently. it simply rocks. – sudurais Nov 24 '13 at 18:33

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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