我认为这就是你正在寻找的内容:http://www.dayid.org/os/notes/tm.html
具体来说,是这部分:
kill the current pane: ^b x OR (logout/^D)
close other panes except the current one: ^b !
The formatting here is simple enough to understand (I would hope).
^ means ctrl+, so ^x is ctrl+x. M- means meta (generally left-alt or escape)+,
so M-x is left-alt+x
prefix+x: kill the current pane
prefix+&: kill the current window
请注意面板(pane)和窗口(window)之间的区别。实际上,OP想要关闭窗口。因此,使用前缀+& 将更加合适,尤其是当一个窗口有多个面板拆分时。这不是确切的问题,但我需要这个面板。 如果你想从另一个面板关闭一个面板,你可以尝试列出所有面板并通过ID杀死它。
tmux list-panes
0: [209x67] [history 284/2000, 167338 bytes] %2 (active)
1: [209x19] [history 722/2000, 256904 bytes] %1
只需使用此代码即可消灭您想要的对象:
tmux kill-pane -t #PANENUMBER
^c
)当前运行的程序后,您还可以执行^d
或只需键入exit
。 - Matt Popovich