【问题标题】:is there a way to automatically order tmux panes in the order they where created?有没有办法按照创建的顺序自动排序 tmux 窗格?
【发布时间】:2023-01-31 00:42:38
【问题描述】:

我制作了一个脚本来在 tmux 会话中运行一个 chord-ring 的多个对等体。

tmux new -s peers -d

# Do this multiple times
tmux send-keys <ProgramName> C-m
tmux select-pane -t :.+
tmux split-window -v -t peers

tmux select-layout tiled
tmux attach -t peers

我想像这样订购窗格:

 _ _ _ 
|0|1|2|
 _ _ _ 
|3|4|5|
 _ _ _ 
|6|7|8|

数字代表创建窗格的顺序。

是否可以自动按此顺序对窗格进行排序?

【问题讨论】:

  • 你得到了什么命令?默认不排序?

标签: bash shell terminal tmux


【解决方案1】:

当您在拆分前选择窗格时,您实际上是在重新排序。

tmux new -s peers -d

n=8
((h=2*n))

tmux send-keys "echo 0" C-m
for n in $(seq 1 8); do
    tmux split-window -v -l${h} -t peers
    tmux send-keys "echo ${n}" C-m
done

tmux select-layout tiled
tmux attach -t peers

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多