在tmux客户端之间移动窗口 [英] Move window between tmux clients
问题描述
我只是在学习tmux,而我却没有使用屏幕的经验.我想知道是否可以将一个tmux客户端中的窗口移动到另一个tmux客户端中.我想将IRC客户端移动到屏幕上的新窗口.
I'm just learning tmux and I have no experience with screen. I'm wondering if I can move a window in one tmux client to another tmux client. I want to move my IRC client to a new window on my screen.
推荐答案
是的,您可以使用move-window命令:
Yes, you can use the move-window command:
move-window [-d] [-s src-window] [-t dst-window]
(alias: movew)
这类似于链接窗口,除了src-window的窗口已移至dst-window.
This is similar to link-window, except the window at src-window is moved to dst-window.
其中src-window和dst-window的格式为:session:window.pane(会话和窗口可以是name或id).
where src-window and dst-window have the form: session:window.pane (session and window can be either name or id).
因此,假设您有一个带有"irc"窗口的聊天"会话,并且想要将其移至您可以执行的"other_session"会话中(在tmux提示符下):
So, supposing you have an 'chat' session with an 'irc' window and want to move it to the 'other_session' session you can do (in the tmux prompt):
move-window -s chat:irc -t other_session
如果您已经在chat:irc窗口中,则无需指定来源
If you are already in the chat:irc window you don't need to specify the source so
move-window -t other_session:
会做到的.
以同样的方式,从"other_session"会话中,您无需指定目标.
In the same way, from the 'other_session' session you don't need to specify the target.
movew -d irc:irc_window
如果您没有为Windows/会话命名,则必须使用其ID.
If you haven't named you windows/sessions, you have to use their ids.
这篇关于在tmux客户端之间移动窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!