Incorrect failure return code when calling "byobu-tmux att"

Bug #1662265 reported by HappyCamper
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Triaged
Wishlist
Unassigned

Bug Description

When I call "tmux att" and there are no existing sessions I get a message saying there are no sessions and the return code of 1.

However when I call "byobu-tmux att" with no existing sessions, it tries to connect and I get a return code of 0.

My full command is:

  byobu-tmux att || byobu-tmux new

...which should either reconnect to an existing session, or start a new one. The second byobu-tmux call is never triggered though because "byobu-tmux att" returns an OK code even when there was no session to attach to.

Thanks =)

Revision history for this message
HappyCamper (colin-conway) wrote :

I worked around this issue by using "list-sessions" to work out if there are any open sessions, then calling the appropriate command:

---------
#!/bin/bash

byobu-tmux list-sessions
if [ "$?" -eq 0 ]; then
  tmuxCmd='att'
else
  tmuxCmd='new'
fi
byobu-tmux $tmuxCmd
---------

Changed in byobu:
importance: Undecided → Wishlist
status: New → Triaged
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.