byobu attach exits with 0 when no sessions to attach unlike tmux
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:/