File tree Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Expand file tree Collapse file tree 3 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,11 @@ capture_pane_contents_option_on() {
64
64
[ " $option " == " on" ]
65
65
}
66
66
67
+ override_worktree_path_option_on () {
68
+ local option=" $( get_tmux_option " $override_worktree_path " " off" ) "
69
+ [ " $option " == " on" ] && command -v git > /dev/null 2>&1
70
+ }
71
+
67
72
files_differ () {
68
73
! cmp -s " $1 " " $2 "
69
74
}
Original file line number Diff line number Diff line change @@ -195,6 +195,13 @@ dump_panes() {
195
195
continue
196
196
fi
197
197
full_command=" $( pane_full_command $pane_pid ) "
198
+ if override_worktree_path_option_on; then
199
+ git=" git -C " ${dir/:/ } " "
200
+ git_dir=" $( $git rev-parse --absolute-git-dir 2> /dev/null) "
201
+ if [[ -n $git_dir && $( $git rev-parse --is-inside-work-tree) == " true" && $( git -C " $git_dir " rev-parse --is-bare-repository) == " true" ]]; then
202
+ dir=" :$( $git rev-parse --absolute-git-dir | sed ' s#/worktrees/.*$##' ) "
203
+ fi
204
+ fi
198
205
dir=$( echo $dir | sed ' s/ /\\ /' ) # escape all spaces in directory path
199
206
echo " ${line_type}${d}${session_name}${d}${window_number}${d}${window_active}${d}${window_flags}${d}${pane_index}${d}${pane_title}${d}${dir}${d}${pane_active}${d}${pane_command}${d} :${full_command} "
200
207
done
Original file line number Diff line number Diff line change @@ -46,3 +46,5 @@ hook_prefix="@resurrect-hook-"
46
46
47
47
delete_backup_after_option=" @resurrect-delete-backup-after"
48
48
default_delete_backup_after=" 30" # days
49
+
50
+ override_worktree_path=" @resurrect-override-worktree-path"
You can’t perform that action at this time.
0 commit comments