byobu attach exits with 0 when no sessions to attach unlike tmux

Bug #1795471 reported by Muneeb Shaikh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
New
Undecided
Unassigned

Bug Description

Following is a walkthrough of the issue.

====
ubuntu@localhost:~$ byobu -L foo attach
[exited]
ubuntu@localhost:~$ echo $?
0
ubuntu@localhost:~$ tmux -L foo attach
no sessions
ubuntu@localhost:~$ echo $?
1
====

I came across this when trying to write an [auto]ssh function/alias along the following lines.

"tmux -L foo attach || sudo -H tmux -L foo attach"

which tries to attach to existing tmux session. Above works but if you substitute "tmux" with "byobu" it fails as first part exits with zero(success) status.

Package versions:
====
ubuntu@localhost:~$ apt-cache policy byobu | grep -B1 Installed
byobu:
  Installed: 5.106-0ubuntu1
ubuntu@localhost:~$ tmux -V
tmux 2.1
====

Is this an expected behaviour?

Similar question was asked on StackOverflow: https://stackoverflow.com/q/52129480

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.