How do you detach a remote screen session in byobu (tmux)?

只谈情不闲聊 提交于 2019-11-29 06:22:53

问题


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.


回答1:


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.




回答2:


It is easy when you use tmux commands:

byobu-tmux detach
byobu-tmux

or even just:

byobu detach
byobu



回答3:


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




回答4:


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




回答5:


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




回答6:


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.




回答7:


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.



来源:https://stackoverflow.com/questions/14492744/how-do-you-detach-a-remote-screen-session-in-byobu-tmux

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!