我只是在学习tmux,我没有屏幕的经验。我想知道是否可以将一个TMUX客户端中的窗口移至另一个TMUX客户端。我想将我的IRC客户端移至屏幕上的新窗口。

有帮助吗?

解决方案

是的,您可以使用Move-Window命令:

move-window [-d] [-s src-window] [-t dst-window]
           (alias: movew)

这类似于Link-Window,除了SRC-Window的窗口移至DST-Window。

src-window和dst-window的形式:session:window.pane(会话和窗口可以是名称或id)。

因此,假设您有一个带有“ IRC”窗口的“聊天”会话,并希望将其移至可以执行的“ elest_session”会话(在TMUX提示中):

move-window -s chat:irc -t other_session

如果您已经在聊天中:IRC窗口,则无需指定源

move-window -t other_session:

会做的。

以同样的方式,从“其他_session”会话中,您无需指定目标。

movew -d irc:irc_window

如果您没有命名Windows/Sessions,则必须使用其ID。

其他提示

另一个有用的:

 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.

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

Assuming I have these 2 sessions:  daemons and proj

tmux link-window -dk -s daemons:0 -t proj:0
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top