Improve git worktree session workflow
This commit is contained in:
@@ -2,8 +2,14 @@
|
||||
|
||||
session_name=$(tmux display-message -p '#S')
|
||||
session_layout=~/.local/share/tmux/layouts/session-$session_name
|
||||
# Set by `session -p <project>`, which names the session after the project but
|
||||
# can't be relied on for the lookup above since tmux rewrites `.` in names.
|
||||
session_project=$(tmux show-environment -t "$session_name" TMUX_PROJECT 2>/dev/null |
|
||||
sed -n 's/^TMUX_PROJECT=//p')
|
||||
if [ -f $session_layout ]; then
|
||||
$session_layout
|
||||
elif [ -n "$session_project" ]; then
|
||||
~/.local/share/tmux/layouts/session-project "$session_project"
|
||||
elif [ "$session_name" != "agent" ]; then
|
||||
tmux rename-window home
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user