detaching from ssh sessions within byobu sessions

Asked by amastbaum on 2010-06-02

I'm trying to manage a byobu session on a computer that I've ssh'ed to from within a byobu session on another machine. These are in the same cluster and use the same home directory, and so they share whatever files byobu is using. Maybe this complicates things...

Here's what I do:
ssh foo
* byobu session on foo starts/resumes
ssh bar
* byobu session on bar starts

When I try to detach (C-a C-d, or F6) from the session on bar, it detaches from the one on foo instead. I can terminate the session on bar, but I have to C-d it three times, then it drops me to a real shell on bar, at which point I can log out. I can't open/close/manage windows on bar -- all control keys operations get eaten by foo instead.

Am I doing something wrong here? It seems like control keys should operate on the shallowest byobu session, not the deepest. It would be fantastic if there were a way to move "horizontally" (change windows) and "vertically" (descend through open ssh sessions)... is this possible?


Question information

English Edit question
byobu Edit question
No assignee Edit question
Solved by:
Dustin Kirkland 
Last query:
Last reply:
Best Dustin Kirkland  (kirkland) said : #1

Hi Andy-

So you're talking about "nested" screen or byobu sessions.

I do this from time to time too. It's a little bit cumbersome, but there are a few work arounds.

One thing I do, sometimes, is change the escape sequence for one of the two sessions, such that I have ctrl-a and ctrl-b. I know that ctrl-a sends commands to one of the machines, and ctrl-b to the other.

There is another option... You can use ctrl-a-a to send an escape sequence to the inner session. So ctrl-a-a-n and ctrl-a-a-p to move back and forth between windows.

Hopefully these help!

amastbaum (amastbaum) said : #2

Thanks, Dustin!

Changing the bindings on the inner session works fine.

C-(a-a) and C-a C-a toggle the window on the outer session and C-a a doesn't seem to do anything, but way #1 solves the problem so no matter...

amastbaum (amastbaum) said : #3

Thanks Dustin Kirkland, that solved my question.