Session name in status line

Bug #1255139 reported by Henrik Holmboe
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
byobu
Fix Released
Wishlist
Dustin Kirkland 

Bug Description

This is a feature request. I have looked around and didn't find how to accomplish this.

Allow the current session name in the status line when using the tmux backend.

I have separate sessions for different tasks, sometimes they are even initiated with tmuxinator, and other times I just create them on the fly. It would be nice to be able to do tmux rename-session and have it appear in the status line. This feature would allow to easily spot which session you are in without resorting to tmux list-sessions (which wouldn't be possible if you are not on the command line, for example when editing a file in an editor).

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

This is an excellent suggestion, in fact.

I'll add a new status item/script. Wishlist for now, but I'll get this implemented soon.

Thanks!

Changed in byobu:
importance: Undecided → Wishlist
status: New → Triaged
assignee: nobody → Dustin Kirkland  (kirkland)
Revision history for this message
Jan Klepek (jan-klepek-gmail) wrote :

I have created session_name which takes from screen/tmux current session name.

"session_name" should be added to /usr/share/byobu/status/status

For shutil file, i have created this entry in status_freq() function:
session_name) _RET=3600 ;;

Changed in byobu:
status: Triaged → Fix Released
Revision history for this message
Dustin Kirkland  (kirkland) wrote :

Hi Jan,

Thanks for the code!

I committed something along these lines, and released it in 5.68.

There's a couple of differences, from what you submitted...

 - I called the status item "session"
 - Also, screen has a built in status item for session name, so no need to grep/sed

Thanks again for the fine idea and code!

Committed revision 2278.

Changed in byobu:
status: Fix Released → Fix Committed
Revision history for this message
Henrik Holmboe (holmboe) wrote :

Hello Dustin,

if I understand your code (at https://bazaar.launchpad.net/~kirkland/byobu/trunk/view/head:/usr/lib/byobu/session) correctly you will detect if there are multiple sessions and, if there are, add "〣#S" -- in the case of tmux -- to the status line. The difference with Jan's code is that it will print the actual session name.

My feature request was more towards the result of Jan's code. I don't know whether "#S" has special meaning to tmux and should have been expanded, but in my case it does not result in the session name being printed.

My tests with the "session" status notification was with your code in the 5.70 release.

Thanks!

Henrik

Changed in byobu:
status: Fix Committed → Fix Released
Revision history for this message
Henrik Holmboe (holmboe) wrote :

Hello @kirkland,

I still cannot get this to work. I am on Ubuntu 12.04 with the current release from your byobu PPA and only get a "#S" in the status notification line.

See the attached screenshot.

I would expect "hej" to appear in the status notification line. Perhaps I am misunderstanding what the "session" status notification is supposed to do here?

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.