2KAbhishek / tmux-tea

tmux sessions as easy as tea ☕🪟
GNU General Public License v3.0
21 stars 1 forks source link

[ENH]: allow session naming to contain the full path #5

Closed f4z3r closed 3 weeks ago

f4z3r commented 1 month ago

Description

First of all, thanks for the really cool project. I am quite a fan!

I have various projects that have the same "basename" in my filesystem. Currenly, only the base name is used for the session naming. It would be great to have an option (something like set -g @tea-session-name full-path) that allows to use the entire path rather than just the basename for the new session name.

Additional Information

I guess this stems from here: https://github.com/2KAbhishek/tmux-tea/blob/8a150154a68a1a1d0c575098a1aa649da4090371/bin/tea.sh#L125

Something of the sort:

session_name_option=$(tmux show-option -gqv "@tea-session-name")
if [ "$session_name_option" = "full-path" ]; then
  SESSION_NAME=$(echo "$RESULT" | tr ' .:' '_' | tr '~' '\~')
else
  SESSION_NAME=$(basename "$RESULT" | tr ' .:' '_')
fi