Skip to content

Instantly share code, notes, and snippets.

@goddoe
Created May 24, 2020 04:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save goddoe/4d57561b2b6c4daac78c3c6059226b17 to your computer and use it in GitHub Desktop.
Save goddoe/4d57561b2b6c4daac78c3c6059226b17 to your computer and use it in GitHub Desktop.
move window between sessions
(Reference: https://stackoverflow.com/questions/3094946/move-window-between-tmux-clients , mb14)
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment