我有一个按键绑定到我喜欢的设置窗格,但有时事情会变得混乱或失控,我想关闭所有窗格并重新运行脚本。有没有一个简单的tmux
命令可以关闭除我当前所在的窗格之外的所有窗格?
答案1
您可以使用“kill-pane”命令。
kill-pane [-a] [-t target-pane]
(alias: killp)
Destroy the given pane. If no panes remain in the containing window, it is also destroyed. The -a option kills all but the pane given with -t.
因此,例如,如果您想终止除窗格 0 之外的所有窗格:
kill-pane -a -t 0
如果您不知道窗格编号是什么,可以使用“display-panes”命令:
display-panes [-t target-client]
(alias: displayp)
Display a visible indicator of each pane shown by target-client. See the display-panes-time, display-panes-colour, and display-panes-active-colour
session options. While the indicator is on screen, a pane may be selected with the '0' to '9' keys.
答案2
还有“^b!”根据http://www.dayid.org/os/notes/tm.html(我也尝试过,它对我有用)