Tmux 忽略 .tmux.conf 中的第一个 splitw 命令

Tmux 忽略 .tmux.conf 中的第一个 splitw 命令
set -g history-limit 50000
new -s ds -n WindowName Command
neww -n foo/bar foo
splitw -h
splitw -h
splitw -v
splitw -v

这是我的 tmux.conf 文件。我使用 tmux 附加来启动它。它执行了我想要它做的所有事情,但它忽略了第一个 splitw 命令,无论它是 splitw -h 还是 splitw -v。

我想了解为什么会发生这种情况以及我可以做些什么来解决它。

答案1

我最终这样做了。您可以仅使用 tmux 来运行此 .tmux.conf。它会终止通过运行命令 tmux(别名为 tmux-session)创建的无关会话。

set -g history-limit 50000
new -s ds -n estruct
selectw -t ds
splitw -v
splitw -h
splitw -h
#Switch to the "ds" session (defaultSession) and then kill the extra one
send-keys "tmux switch-client -t ds" C-m
send-keys "tmux kill-session -t 1" C-m
send-keys "clear" C-m
#Move to each individual panels and run commands as though you're there, C-m submits them as though you've hit enter
selectp -t 0
send-keys "tmux resize-pane -D 20" C-m
send-keys "tmux resize-pane -D 10" C-m
send-keys "sci" C-m
send-keys "clear" C-m

我知道这是一种非常“糟糕”的方法,但我发现 tmux 的行为极其复杂且难以理解。这为我提供了一个非常简单的界面,让我能够以直接的方式设置相对简单的环境。

相关内容