在 tmux 客户端之间移动窗口

发布于 2024-09-07 06:57:50 字数 93 浏览 2 评论 0原文

我刚刚学习 tmux,对 screen 没有经验。我想知道是否可以将一个 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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

身边 2024-09-14 06:57:50

是的,您可以使用 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”窗口的“聊天”会话,并且想要将其移动到“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

如果您没有命名窗口/会话,则必须使用它们的 ID。

Yes, you can use the move-window command:

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

This is similar to link-window, except the window at src-window is moved to dst-window.

where src-window and dst-window have the form: session:window.pane (session and window can be either name or id).

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

If you are already in the chat:irc window you don't need to specify the source so

move-window -t other_session:

will do it.

In the same way, from the 'other_session' session you don't need to specify the target.

movew -d irc:irc_window

If you haven't named you windows/sessions, you have to use their ids.

拧巴小姐 2024-09-14 06:57:50

另一个有用的:

 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

Another useful one:

 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.

This means that you can share a window across multiple sessions:

Assuming I have these 2 sessions:  daemons and proj

tmux link-window -dk -s daemons:0 -t proj:0
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文