1

I have a tmux script to create nested tmux sessions

#!/bin/env tcsh
set SESSION=$1
set NESTED_SESSION=$2
\tmux -2 new-session -d -s ${SESSION}
\tmux send-keys "unsetenv TMUX" C-m
\tmux send-keys "\tmux -2 new-session -s ${NESTED_SESSION}" C-m
#i want some commands in the nested session

\tmux attach-session -t ${SESSION}

How do I pass the commands to the nested session. If i use send-keys they go to the original session and not the nested session.

Thanks in Advance

Martin Tournoij
  • 26,737
  • 24
  • 105
  • 146
justrajdeep
  • 855
  • 3
  • 12
  • 29
  • I'm not quite sure, but I think you want what's described in this question? http://stackoverflow.com/questions/8518815/how-to-send-commands-when-opening-a-tmux-session-inside-another-tmux-session?rq=1 – Martin Tournoij May 25 '14 at 09:53
  • i can send the commands to the nested tmux using `Ctrl-bb` but i am not able to do it from a script. – justrajdeep May 25 '14 at 10:17

0 Answers0