相关疑难解决方法(0)

启动 tmux 时可选择运行多个命令

我有一个~/.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 打开一组窗格而无需手动输入它们? …

tmux

7
推荐指数
1
解决办法
5000
查看次数

标签 统计

tmux ×1