我有一个~/.tmux/dev看起来像这样的文件:
selectp -t 0 # select the first pane
splitw -h -p 50 # split it into two halves
selectp -t 1 # select the new, second (1) pane
splitw -v -p 50 # split it into two halves
selectp -t 0 # go back to the first pane
send-keys 'vim .' Enter
Run Code Online (Sandbox Code Playgroud)
如果我tmux source-file ~/.tmux/dev从 tmux 会话内部运行,它工作正常。
我想创建一个 bash 脚本来打开 tmux 并自动运行这些命令。
我试过跑步
tmux new 'tmux source-file ~/.tmux/dev'
Run Code Online (Sandbox Code Playgroud)
但我只看到两个窗格;缺少带有 vim 的窗格。
tmux ×1