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.
You can write a small shell script that launches tmux with the required programs. I have the following in a shell script that I call dev-tmux. A dev environment:
#!/bin/sh
tmux new-session -d 'vim'
tmux split-window -v 'ipython'
tmux split-window -h
tmux new-window 'mutt'
tmux -2 attach-session -d
So everytime I want to launch my favorite dev environment I can just do
$ dev-tmux
Best Answer
try
Prefix
+ &if you have
in your
.tmux.conf
, you can pressPrefix
+ q to kill the window too, only if there is only one panel in that window.if you have multiple panes and want to kill the whole window at once use
killw
instead ofkillp
in your config.the default of Prefix above is Ctrl+b, so to terminate window by default you can use Ctrl+b &