the*_*fog 89
是的,这很简单,使用move-pane
tmux 命令。有关更多信息,请运行
man tmux | less -I '+/mOVE-pane'
Run Code Online (Sandbox Code Playgroud)
棘手的部分只是知道 tmux 如何在命令中引用会话、窗口和窗格来操作窗格等。
移入要移至其他会话的窗格
通过运行获取目标会话的名称<prefix>s
。
在我的系统上产生:
(0) + 0: 8 windows (attached)
(1) + 1: 1 windows
^
|
This is the session name. It could be different
on your system and it could be a word (not just a number).
Run Code Online (Sandbox Code Playgroud)
<prefix>:move-pane -t <session_name>:<window number>
^^^^^^^^^^^^^^ the name from above goes in here
Run Code Online (Sandbox Code Playgroud)
所以在我的系统上,我移动到运行进程的窗格中,运行
<prefix>:move-pane -t 1:1
Run Code Online (Sandbox Code Playgroud)
并且其中包含进程的窗格移动到会话中的第一窗口1
。
它作为拆分插入,因此通常您希望在另一个会话上运行窗口作为一次性窗口。
注意:似乎目标窗口确实需要存在,否则该move-pane
命令将发出错误。
有关为TMUX命令内指定的会话,窗户和窗格格式的更多背景,请参见COMMANDS
在man tmux
。
小智 10
我无法评论,所以我将它放在这里:对于 tmux 2.1-3build1~precise,命令应该是:
<prefix>:move-pane -t session_name:window_number
---t
会话名称前需要一个“ ”(不一定是数字),并且给定数字的窗口必须存在。
其余的都如the_velour_fog在他的回答中所描述的。
PS如果你只输入一个session_name
没有window_number
像这样:
<prefix>:move-pane -t session_name:
,
然后您的窗格将移动到目标会话的当前窗口中(并且此窗口将被拆分)。
PPS 如果您只想移动您的窗口(而不仅仅是您的窗格),那么关于如何在 tmux 客户端之间移动窗口有一个很好的答案:
<prefix>:move-window [-d] [-s src-window] [-t dst-window]
(alias: movew)
wheresrc-window
和dst-window
have the form session:window.pane
。
对于 tmux 3.1b 版 - 我刚刚发现了快捷方式:(<prefix>.
一个点)
<prefix>.
然后输入6<enter>
- 将当前窗口移动到位置 6(在当前会话中)
<prefix>.
然后输入2:6<enter>
- 将当前窗口移动到会话 2 中的位置 6(参见 als 会话名称/数字,带有<prefix>s
或<prefix>:
-ls<enter>
(对我来说也是新的:<prefix>!
将窗格(从拆分)移动到新窗口)
归档时间: |
|
查看次数: |
24111 次 |
最近记录: |