Switch between nested tmux sessions
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm writing a zsh script that setup nested session. I have a session and a session inside that session.
sessionA
sessionB
I can create sessionA
in detach mode -d
and then call tmux
inside that to create nested sessionB
but how to switch to sessionB
?
I checked manpage
and there's no switch-session
option. Much appreciated.
zsh tmux
add a comment |Â
up vote
0
down vote
favorite
I'm writing a zsh script that setup nested session. I have a session and a session inside that session.
sessionA
sessionB
I can create sessionA
in detach mode -d
and then call tmux
inside that to create nested sessionB
but how to switch to sessionB
?
I checked manpage
and there's no switch-session
option. Much appreciated.
zsh tmux
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm writing a zsh script that setup nested session. I have a session and a session inside that session.
sessionA
sessionB
I can create sessionA
in detach mode -d
and then call tmux
inside that to create nested sessionB
but how to switch to sessionB
?
I checked manpage
and there's no switch-session
option. Much appreciated.
zsh tmux
I'm writing a zsh script that setup nested session. I have a session and a session inside that session.
sessionA
sessionB
I can create sessionA
in detach mode -d
and then call tmux
inside that to create nested sessionB
but how to switch to sessionB
?
I checked manpage
and there's no switch-session
option. Much appreciated.
zsh tmux
zsh tmux
asked Sep 5 at 14:03
Tuyen Pham
19810
19810
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
1
down vote
You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach
Why two-d
in first session creation?
â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing inzsh
script so your answer probably won't help. Right now I have trouble torename
nested session. Output keep sayingcan't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
 |Â
show 2 more comments
up vote
0
down vote
An easy solution is to detach and then attached directly to sessionB.
tmux attach-session -t sessionB
In a script I'd need to switch tosessionB
silently, so that the question.
â Tuyen Pham
Sep 6 at 2:08
add a comment |Â
up vote
0
down vote
Seem like my question is a little bit not clear.
Here I want to do tasks on nested session but after googling I can achieve that purpose via send-keys
with option that specify session name to act on. So no need to switch to session that I'd need to work on - I'm in an zsh
script perspective.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach
Why two-d
in first session creation?
â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing inzsh
script so your answer probably won't help. Right now I have trouble torename
nested session. Output keep sayingcan't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
 |Â
show 2 more comments
up vote
1
down vote
You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach
Why two-d
in first session creation?
â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing inzsh
script so your answer probably won't help. Right now I have trouble torename
nested session. Output keep sayingcan't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
 |Â
show 2 more comments
up vote
1
down vote
up vote
1
down vote
You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach
You would first start a session:
tmux new-session -s [session-name] -n [first-tmux-screen-name] -d
We can now separate this window in sections by using splitw options:
tmux splitw -h
tmux splitw -v
we can select a section too:
tmux selectp -t0
tmux splitw -v
And depending on what we want to display, or run in each nested window, we use the send-key option. If we want to add a new window to this tmux session we can use this command:
tmux new-window -n [name-of-new-window] -t [session-name]
zsh works for me:
#!/bin/zsh
tmux new-session -s test -n four-screen -d
tmux splitw -h
tmux splitw -v
tmux selectp -t0
tmux splitw -v
After your run the script: zsh scriptname.zsh then attach to the session: tmux attach
edited Sep 6 at 4:23
answered Sep 6 at 4:00
NiteRain
1104
1104
Why two-d
in first session creation?
â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing inzsh
script so your answer probably won't help. Right now I have trouble torename
nested session. Output keep sayingcan't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
 |Â
show 2 more comments
Why two-d
in first session creation?
â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing inzsh
script so your answer probably won't help. Right now I have trouble torename
nested session. Output keep sayingcan't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
Why two
-d
in first session creation?â Tuyen Pham
Sep 6 at 4:03
Why two
-d
in first session creation?â Tuyen Pham
Sep 6 at 4:03
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
was suppose to be a -n sorry.
â NiteRain
Sep 6 at 4:04
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
Forgot to mention, after you do the last new-window, that is what you will see when you tmux attach -t [session], so to go to the first screen, you would have to do a tmux select-window -t [first-tmux-screen-name] in your script.
â NiteRain
Sep 6 at 4:08
I'm doing in
zsh
script so your answer probably won't help. Right now I have trouble to rename
nested session. Output keep saying can't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
I'm doing in
zsh
script so your answer probably won't help. Right now I have trouble to rename
nested session. Output keep saying can't find session <NAME>
â Tuyen Pham
Sep 6 at 4:14
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
This is question about how to switch between nested session, your zsh script is about creating a new named session and window then spliting some panes - probably unrelated to the original question but thanks for the help.
â Tuyen Pham
Sep 6 at 4:48
 |Â
show 2 more comments
up vote
0
down vote
An easy solution is to detach and then attached directly to sessionB.
tmux attach-session -t sessionB
In a script I'd need to switch tosessionB
silently, so that the question.
â Tuyen Pham
Sep 6 at 2:08
add a comment |Â
up vote
0
down vote
An easy solution is to detach and then attached directly to sessionB.
tmux attach-session -t sessionB
In a script I'd need to switch tosessionB
silently, so that the question.
â Tuyen Pham
Sep 6 at 2:08
add a comment |Â
up vote
0
down vote
up vote
0
down vote
An easy solution is to detach and then attached directly to sessionB.
tmux attach-session -t sessionB
An easy solution is to detach and then attached directly to sessionB.
tmux attach-session -t sessionB
answered Sep 5 at 14:19
foobaru
843
843
In a script I'd need to switch tosessionB
silently, so that the question.
â Tuyen Pham
Sep 6 at 2:08
add a comment |Â
In a script I'd need to switch tosessionB
silently, so that the question.
â Tuyen Pham
Sep 6 at 2:08
In a script I'd need to switch to
sessionB
silently, so that the question.â Tuyen Pham
Sep 6 at 2:08
In a script I'd need to switch to
sessionB
silently, so that the question.â Tuyen Pham
Sep 6 at 2:08
add a comment |Â
up vote
0
down vote
Seem like my question is a little bit not clear.
Here I want to do tasks on nested session but after googling I can achieve that purpose via send-keys
with option that specify session name to act on. So no need to switch to session that I'd need to work on - I'm in an zsh
script perspective.
add a comment |Â
up vote
0
down vote
Seem like my question is a little bit not clear.
Here I want to do tasks on nested session but after googling I can achieve that purpose via send-keys
with option that specify session name to act on. So no need to switch to session that I'd need to work on - I'm in an zsh
script perspective.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
Seem like my question is a little bit not clear.
Here I want to do tasks on nested session but after googling I can achieve that purpose via send-keys
with option that specify session name to act on. So no need to switch to session that I'd need to work on - I'm in an zsh
script perspective.
Seem like my question is a little bit not clear.
Here I want to do tasks on nested session but after googling I can achieve that purpose via send-keys
with option that specify session name to act on. So no need to switch to session that I'd need to work on - I'm in an zsh
script perspective.
answered Sep 6 at 3:15
Tuyen Pham
19810
19810
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f467025%2fswitch-between-nested-tmux-sessions%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password