我拥有在tmux会话中运行的大量程序列表有什么简单的方法可以让我们指定会话名称并指定哪个窗格运行哪个程序。
是的,您可以使用shell脚本中的tmux命令执行此操作,例如:
#!/bin/sh
S=$(tmux new -dP -smysession 'myprogram1')
W=$(tmux neww -dP -t$S 'myprogram2')
tmux -t$W splitw 'myprogram3'
或者您可以使用tmux source-file
或从.tmux.conf
加载的tmux脚本:
new -smysession 'myprogram1'
neww 'myprogram2'
splitw 'myprogram3'
或者您可以查看许多现有的包装程序来执行此操作。最受欢迎的是:
https://github.com/rothgar/awesome-tmux#tools-and-session-management处有一个列表。