在tmux客户端之间移动窗口

Dus*_*tin 112 linux tmux

我只是学习tmux而且我没有屏幕经验.我想知道我是否可以将一个tmux客户端中的窗口移动到另一个tmux客户端.我想将我的IRC客户端移动到我的屏幕上的新窗口.

mb1*_*b14 175

是的,您可以使用move-window命令:

move-window [-d] [-s src-window] [-t dst-window]
           (alias: movew)
Run Code Online (Sandbox Code Playgroud)

这类似于链接窗口,除了src-window的窗口移动到dst-window.

其中src-window和dst-window的格式为:session:window.pane(会话和窗口可以是name或id).

因此,假设您与"irc"窗口进行"聊天"会话,并希望将其移动到您可以执行的"other_session"会话(在tmux提示符中):

move-window -s chat:irc -t other_session

如果您已经在chat:irc窗口中,则不需要指定源

move-window -t other_session:

会做的.

以同样的方式,从'other_session'会话中,您不需要指定目标.

movew -d irc:irc_window

如果您还没有为windows/sessions命名,则必须使用它们的ID.


Ale*_*dio 42

另一个有用的:

 link-window [-dk] [-s src-window] [-t dst-window]
               (alias: linkw)
         Link the window at src-window to the specified dst-window.  If dst-window is specified
         and no such window exists, the src-window is linked there.  If -k is given and
         dst-window exists, it is killed, otherwise an error is generated.  If -d is given, the
         newly linked window is not selected.
Run Code Online (Sandbox Code Playgroud)

这意味着您可以跨多个会话共享一个窗口:

Assuming I have these 2 sessions:  daemons and proj

tmux link-window -dk -s daemons:0 -t proj:0
Run Code Online (Sandbox Code Playgroud)