tmux - tmux 8 窗格“理智”平铺布局
解决方案
试试下面的 bash 脚本:
tmux new -s test -d
tmux selectp -t 0 # select the first (0) pane
tmux splitw -h -p 75 # split it into two horizontal parts
tmux selectp -t 0 # select the first (0) pane
tmux splitw -v -p 50 # split it into two vertical halves
# After this 3 panes will be created with pane number 0 (left- horizontal)
# Pane 1 (vertical pane under the pane 0)
# And Pane 2 with the remaining screen size
# Then we divide this remaining pane 2 into three similar panes
# repeat this till all 8 panes are created
tmux selectp -t 2 # select the new, second (2) pane
tmux splitw -h -p 66 # split it into two halves
tmux selectp -t 2 # select the second (2) pane
tmux splitw -v -p 50 # split it into two vertical halves
tmux selectp -t 4 # select the new, fourth (4) pane
tmux splitw -h -p 50 # split it into two halves
tmux selectp -t 4 # select the fourth (4) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 6 # select the new, sixth (6) pane
tmux splitw -v -p 50 # split it into two halves
tmux selectp -t 0 # go back to the first pane
tmux attach -t test
诀窍是识别pane number
并相应地拆分它。将以下行添加到上述脚本中,您可以看到窗格编号以及tmux
.
tmux send-keys -t 0 'echo "-- Pane 1 ---"' Enter
tmux send-keys -t 1 'echo "-- Pane 2 ---"' Enter
tmux send-keys -t 2 'echo "-- Pane 3 ---"' Enter
tmux send-keys -t 3 'echo "-- Pane 4 ---"' Enter
tmux send-keys -t 4 'echo "-- Pane 5 ---"' Enter
tmux send-keys -t 5 'echo "-- Pane 6 ---"' Enter
tmux send-keys -t 6 'echo "-- Pane 7 ---"' Enter
tmux send-keys -t 7 'echo "-- Pane 8 ---"' Enter
send-keys
将命令发送echo "-- pane number --"
到选项指定的窗格-t
。
推荐阅读
- javascript - 初始化集合后查找模型返回空数组
- arrays - 该元素隐含类型为“any”,因为类型“string”的表达式不能用于索引该类型
- linux - alt_space_toggle 在 xkb-switch 中不起作用
- javascript - 大量数据(500K 记录)的 JavaScript 数组需要时间来搜索和添加
- r - 使用 dplyr 聚合单个列,并将所有其他列作为条件
- reactjs - React App with PWA - 部署后更改不会显示,直到页面硬刷新
- testng - TestNG 并行运行问题
- logstash - Logstash Grok 正则表达式解析
- html - 网页抓取 Reed.co.uk 没有返回任何结果
- node.js - 503 Service Unavailable - VueJs forntend、Node 后端和 Akamai 的零大小对象