Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I reattach to my byobu/tmux session?

Tags:

tmux

byobu

I'm using byobu with a tmux backend in Ubuntu 14.04. The standard methods for selecting/viewing sessions such as byobu-select-session and tmux ls do not find the session.

I created a session via incorrect syntax byobu -S wiki and later detached. (I should have done byobu new -s wiki)

The session still exists, according to

$ ps aux | grep byobu
gert   4032  0.1  0.0  29988  8912 ?        Ss   Jun13   1:46 tmux -f /usr/share/byobu/profiles/tmuxrc -S wiki

I can also see a reference to the session in /tmp

$ ls /tmp/tmux-1001/ -l
total 0
srwxrwx--- 1 gert gert 0 May 30 17:06 default=
srw-rw---- 1 gert gert 0 Jun 14 15:07 wiki=
like image 732
Gertlex Avatar asked Jun 14 '17 22:06

Gertlex


People also ask

How do I get out of byobu?

We can disconnect from the byobu session by hitting F6. After disconnecting from byobu, we can then type exit to end the SSH session.

Does byobu use tmux?

Byobu is an enhancement for the GNU Screen terminal multiplexer or tmux used with the Linux computer operating system that can be used to provide on-screen notification or status, and tabbed multi-window management.

How do I open a new byobu session?

CTRL+SHIFT+F2 will create a new session. ALT+UP and ALT+DOWN` will scroll through your sessions. F6 will detach your current Byobu session. SHIFT+F6 will detach (but not close) Byobu, and will maintain your SSH connection to the server.


1 Answers

Try

byobu -S wiki ls

to see if the tmux session is still there. It probably is given your ps output, and will be listed as session 1. Then try

byobu -S wiki attach-session -t 1

Maybe specify the full path to where you can see the "wiki" unix socket that was created when you did byobu -S wiki, which will be in whatever directory you executed that command in originally. Other behavior may occur if byobu or tmux was customized, but basically after you specify byobu -S <path-to-put-socket|path-to-existing-socket-including-socket-name> everything following is going to get passed to tmux. tmux just needs byobu to tell it where to look for its sockets, otherwise it will look in TMPDIR or something by default.

Hope this helps. This is my first ever stackoverflow question that (1) wasn't already answered many different ways, and (2) I knew a possible answer or at least a pointer in the right direction. :)

like image 95
slowkoni Avatar answered Oct 02 '22 04:10

slowkoni