28

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.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Russell
  • 2,692
  • 5
  • 23
  • 24

7 Answers7

24

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.

Dustin Kirkland
  • 5,323
  • 3
  • 36
  • 34
23

It is easy when you use tmux commands:

byobu-tmux detach
byobu-tmux

or even just:

byobu detach
byobu
alekibango
  • 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
20

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.

Source: https://askubuntu.com/a/309215/106100

Community
  • 1
  • 1
Meetai.com
  • 6,622
  • 3
  • 31
  • 38
17

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

Lajos Molnar
  • 791
  • 6
  • 9
  • 2
    I 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
7

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

Alex Filatov
  • 2,232
  • 3
  • 32
  • 39
pagirard
  • 71
  • 1
  • 1
0

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.

blackxored
  • 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
-1

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.

norman_h
  • 911
  • 9
  • 18