27

Is there a way to create identifiable Byobu sessions so that when I've got multiple sessions running, the byobu-select-session menu gives me a list of sessions I can recognize, as opposed to non-descript tmux port numbers?

In an ideal world, it would be great to be able to both start a session giving it a name and to modify such a session to change a name if it's already running? Is this possible, how?

Edit 1: Some further details:

  • I'm using tmux as the backend and don't especially want to switch back to screen.
  • I've now tried starting a session with byobu -S "Name" to no avail :-(

Edit 2: Some discoveries:

  • I've now discovered a partial answer in using tmux native commands: tmux rename-session <current-name> <new-name> renames an existing session and tmux new -s session_name creates a new names session. I'm surprised byobu -S "name" isn't liked to tmux new -s session_name for byobu with a tmux backend.
Artur Meinild
  • 21,605
  • 21
  • 56
  • 89
Ashimema
  • 1,965
  • 3
  • 19
  • 19
  • have you tried: `byobu -S your-session-name`? See [how to run multiple byobu sessions at once?](http://askubuntu.com/a/112273/3712). I don't know whether it works if byobu uses tmux instead of screen. – jfs Oct 04 '12 at 11:33
  • 1
    Thanks for the suggestion, I've now tried `byobu -S` to no avail. It appears to work with tmux as the backend... Is there anything similar for tmux? – Ashimema Oct 04 '12 at 14:51
  • 4
    `byobu new -s your-session-name` might work for tmux backend. – jfs Oct 04 '12 at 14:58
  • 1
    Your a star @J.F.Sebastian , that did the trick. You can even rename a session using `byobu rename-session -t `. – Ashimema Oct 04 '12 at 15:13
  • @J.F.Sebastian Your comment seems to be the correct answer - if you post that as answer and Ashimema accepts it then we all benefit from having another *answered* question. – guntbert Jan 04 '13 at 19:54
  • @guntbert: I don't use tmux. It is better to post *tested* answers. It is OK to [ask and answer your own question](http://blog.stackoverflow.com/2011/07/its-ok-to-ask-and-answer-your-own-questions/) i.e., Ashimema can post and accept his own answer. – jfs Jan 05 '13 at 06:54

1 Answers1

34

Byobu is simply a shell for the tmux (or screen) back end terminal multiplexor. You can therefore pass any command that your back end supports through Byobu.

Byobu with tmux back end

To start a new Byobu session with a specified name:

byobu new -s <session-name>

To change the name of a pre-existing session:

byobu rename -t <session-name> <new-session-name>

Byobu with screen back end

To start a new Byobu session with a specified name:

byobu -S <session-name>

To change the name of a pre-existing session:

byobu -X <session-name> <new-session-name>

Note: All credit to J.F.Sabastian for his help. I've now verified the above commands are correct for both Tmux and Screen backed Byobu.

Ashimema
  • 1,965
  • 3
  • 19
  • 19