I am currently in a byobu-tmux session and am ssh'ed into a screen session. How do I detach the remote screen session without detaching byobu-tmux session? Some things to note, I can't run byobu-config because I'm on osx and don't have python-newt (w/ snack) installed. And, I've run byobu-ctrl-a in Emacs mode, but that doesn't seem to allow me to ctrl-a d out of the remote screen session.
7 Answers
You should be able to double-escape with Ctrl-a.
To send a detach message to the inner byobu-screen session, press:
Ctrl-a Ctrl-a d
Full disclosure: I am the author and maintainer of Byobu.

- 5,323
- 3
- 36
- 34
-
1I tried it, but second time I press `Ctrl-a` I get moved to 0 window in my local byobu session. how could I do any operation in the remote screen session? – logoff May 21 '14 at 13:20
-
1Ctrl+a Ctrl+a just toggles between last two windows. What is double-escape and how do you do it? Only pressing Ctrl+a does not do it. Ctrl+a, Ctrl+a, d only results in sending the letter 'd' to the terminal. – Robin Manoli May 27 '15 at 17:18
-
1'Ctrl+a a' sends ctrl+a – hbogert Jun 29 '15 at 19:35
-
What if I disabled `ctrl+a` when I setup byobu? – Robin Winslow Sep 26 '15 at 08:22
-
So if anyone is confused like me, Ctrl + a and then d worked for me. – trial999 Aug 25 '16 at 17:34
It is easy when you use tmux commands:
byobu-tmux detach
byobu-tmux
or even just:
byobu detach
byobu

- 233
- 1
- 6
-
I had a remote user connected to my screen that I had to detach; this did the trick but you might have to issue the commands multiple times and/or resize your window if byubu is restricting it to narrower than the width of your terminal. – Nick Jul 07 '14 at 05:33
-
In one case something like this did it for me over ssh: `$ byobu detach; byobu detach` – webwurst Sep 17 '14 at 07:36
Try letting go of ctrl after the first a, so the sequence is ctrl-a, a, d. Man screen:
C-a C-a (other) Toggle to the window displayed previously. Note that this binding defaults to the command character typed twice, unless overridden. For instance, if you use the option "-e]x", this command becomes "]]".
C-a a (meta) Send the command character (C-a) to window. See escape com‐ mand.
Or if you're using tmux instead of screen for Byobu, try just ctrl-a d. Byobu's default prefix key is ctrl-b, so if you're using that default, doubling up the ctrl-a keystroke would not be necessary.

- 1
- 1

- 6,622
- 3
- 31
- 38
I was able to do this by listing all clients inside the current client:
$ byobu list-clients
/dev/pts/67: 1 [80x24 xterm] (utf8)
/dev/pts/70: 1 [157x48 xterm-256color] (utf8)
Then detach the remote client (determined based on screen size):
$ byobu detach -t /dev/pts/67
Now I can use my full window size

- 791
- 6
- 9
-
2I don't think this answers the original question, but it's what I was looking for! http://stackoverflow.com/questions/22138211/how-do-i-disconnect-all-other-users-in-tmux answers more directly. – Steven R. Loomis Apr 13 '17 at 20:27
perhaps not relevant to tmux but for byobu, I found the following command to be very helpful: detach all sessions except the current one:
/usr/lib/byobu/include/tmux-detach-all-but-current-client
hope this helps

- 2,232
- 3
- 32
- 39

- 71
- 1
- 1
-
doesn't answer the original question but it answers my question! similar to https://stackoverflow.com/a/30678503/109747 – Afriza N. Arief Aug 27 '18 at 13:46
You need to switch the prefix of your local session if it conflicts with the remote session. For example, if both are using CTRL+A then you'd be in trouble. You can either send a raw command (there's a sequence for that, but I can't remember it), or go the easy route and remap your local session to Ctrl+B, then you can input Ctrl+A that will get routed to the remote session. Also not related to tmux but the ssh connection itself you can input "~." and it'll disconnect from the ssh session. Hope it helps.

- 474
- 5
- 10
-
Not sure if there's a way to switch the prefix of the current local session, I resolved the issue by closing the local session, switching the config by running byobu-ctrl-a, and then starting a new byobu session – Russell Feb 03 '13 at 03:57
I've been an avid user of byobu on Linux for the best part of a decade. After struggling with configuring the brew install of byobu on OSX for most of these years, I finally managed to setup my byobu configs in a round about way. First I executed this:
echo '/usr/local/lib/python2.7/site-packages' | sudo tee /Library/Python/2.7/site-packages/homebrew.pth
Then I ran the byobu config file:
byobu-config
Finally I cleaned up
sudo rm /Library/Python/2.7/site-packages/homebrew.pth
Python crashed along the way with a few pop-ups, however, byobu now works for me as it should. I do need to repeat these steps when I want to change config again though... still looking for a cleaner solution.

- 911
- 9
- 18