tmux multiple instances of the same session
--------------------------------------------------
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzling Curiosities
--
Chapters
00:00 Tmux Multiple Instances Of The Same Session
00:58 Accepted Answer Score 23
01:27 Answer 2 Score 1
02:13 Thank you
--
Full question
https://superuser.com/questions/845427/t...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#tmux #gnuscreen
#avk47
Hire the world's top talent on demand or became one of them at Toptal: https://topt.al/25cXVn
and get $2,000 discount on your first invoice
--------------------------------------------------
Music by Eric Matyas
https://www.soundimage.org
Track title: Puzzling Curiosities
--
Chapters
00:00 Tmux Multiple Instances Of The Same Session
00:58 Accepted Answer Score 23
01:27 Answer 2 Score 1
02:13 Thank you
--
Full question
https://superuser.com/questions/845427/t...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#tmux #gnuscreen
#avk47
ACCEPTED ANSWER
Score 23
I think you're basically asking how to do screen -x
in tmux
? Here's an example:
# Start a new tmux session (with default session name "0").
tmux
# Start another tmux session (default name "1"), sharing windows with "0".
tmux new-session -t 0
# Start yet another tmux session (default name "2"), sharing windows with "0" (and "1").
tmux new-session -t 0
# Now you can attach to sessions with tmux attach-session -t <0|1|2>.
# Or you can omit the -t, and tmux needs to select the most recently used session, and it will prefer the most recently used unattached session.
If you don't like the default numerical names when creating a new session, you can pass -s other_name
to name it something else.
ANSWER 2
Score 1
To achieve what you describe you might get away with just having different layouts in tmux (C-b
+ c) which you then split using (C-b
+) %
and "
, you can just have all the things you want for a task in a pane and then context switch using C-b
+n(ext) or p(revious) or using numbers. Also C-b
z(oom) is your friend.
Interestingly tmux and screen are different in how they deal with multiple views of the same session
- in tmux both views see exactly the same thing (which lets you do pair programming remotely)
- in screen you can look at different terminals in different views (which lets you share things but work independently... which is possibly useful for using multiple monitors to work on the same command line, I just haven't figured out exactly how yet!)