byobu starts a new session every time, instead of attaching to existing one

Bug #1716549 reported by Alex Malinovich
28
This bug affects 6 people
Affects Status Importance Assigned to Milestone
byobu
Incomplete
High
Unassigned

Bug Description

It took a bit of digging through the code to figure out where this is happening, but it looks like if windows.tmux exists and isn't empty, byobu sets CUSTOM_WINDOW_SET to 1 which forces a new session to be created.

This would make sense for "named" windows.tmux configs (e.g. windows.tmux.ssh_connect), but since windows.tmux is the "default", it should only be executed when a new session is either specifically requested, or when there is no existing session to attach to. The logic for this is found starting at line 217 in /usr/bin/byobu.

The expected behavior for me would be that if I connect to a machine that has an existing session running, connect to that session unless I specify that I want a new session created.

If no session exists, then create a new one, using the information in windows.tmux (if it contains commands) or just create a single default window using byobu-shell.

Revision history for this message
Mark Grandi (markgrandi) wrote :

does this manifest by when you connect to a ssh server with byobu running (and has existing tabs and stuff) , it seems to randomly just 'reset' and you lose all your open tabs and scrollback? This has been happening to me for several major versions and is currently happening in the latest version in ubuntu artful and it makes it pretty much impossible to rely on byobu

Version: 5.123-0ubuntu1

Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hmm, this is high priority bug, but unfortunately I'm unable to reproduce it...

Changed in byobu:
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Alex Malinovich (alexmalinovich) wrote :

Just tested this again, and it's still happening as of 5.125-0ubuntu1 in Ubuntu 18.04.1. Here are the steps I used just now to reproduce:

1. spin up a new Ubuntu instance (I'm using ubuntu-18-04-x64 on Digital Ocean)
2. ssh in and install byobu
3. make .byobu/windows.tmux non-zero (echo " " > .byobu/windows.tmux)
4. disconnect (ctrl+<key> ctrl+d)
5. reconnect and you'll be in a new session. If you run "byobu ls" you can see all of the old sessions still there as well, you're just not connected to them.

Let me know if I can provide any more information to help track it down.

Revision history for this message
ironstorm (ironstorm-gmail) wrote :

Basically this is a problem with systemd-logind that effects any process that wants to run past what should be a SIGHUP.

Essentially, systemd-logind is killing everything on a disconnect. It took me hours of troubleshooting this to figure it out. :(

I've started a question on AskUbuntu...
https://askubuntu.com/questions/1169211/how-can-i-fix-nohup-byobu-tmux-screen-etc-to-not-die-when-i-disconnect-from

I don't have a workaround for it and it's pretty unfortunate that an LTS ships with this broken behaviour.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.