Create new tmux session from inside a tmux session

前端 未结 6 726
挽巷
挽巷 2021-01-29 20:02

I\'m writing a shell script that creates / attaches or switches to a given session, depending on whether one is inside tmux and the session exists.

I\'ve got everything

6条回答
  •  不思量自难忘°
    2021-01-29 20:19

    Using this works for me:

    TMUX= tmux new-session -d -s name
    tmux switch-client -t name
    

    The TMUX= on the first line is required so tmux doesn't throw a sessions should be nested with care, unset $TMUX to force message.

提交回复
热议问题