This commit is contained in:
parent
e3caa91477
commit
722a5814fa
2 changed files with 25 additions and 0 deletions
|
@ -31,5 +31,7 @@ stdenv.mkDerivation {
|
||||||
sha256 = "sha256-AtaOlV2JSeR0BmDsfuv8ZFbu5G0vz4RdUPY4ZF4UqQc=";
|
sha256 = "sha256-AtaOlV2JSeR0BmDsfuv8ZFbu5G0vz4RdUPY4ZF4UqQc=";
|
||||||
url = "https://patch-diff.githubusercontent.com/raw/ThePrimeagen/tmux-sessionizer/pull/23.patch";
|
url = "https://patch-diff.githubusercontent.com/raw/ThePrimeagen/tmux-sessionizer/pull/23.patch";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
./shorten-paths.patch
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
23
packages/tmux-sessionizer/shorten-paths.patch
Normal file
23
packages/tmux-sessionizer/shorten-paths.patch
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
diff --git a/tmux-sessionizer b/tmux-sessionizer
|
||||||
|
index 036d2a3..cd11500 100755
|
||||||
|
--- a/tmux-sessionizer
|
||||||
|
+++ b/tmux-sessionizer
|
||||||
|
@@ -252,7 +252,7 @@ find_dirs() {
|
||||||
|
if [[ -d "$path" ]]; then
|
||||||
|
while IFS= read -r dir; do
|
||||||
|
dir_list+=("$dir")
|
||||||
|
- done < <(find "$path" -mindepth 1 -maxdepth "$depth" -path '*/.git' -prune -o -type d -print)
|
||||||
|
+ done < <(find "$path" -mindepth 1 -maxdepth "$depth" -path '*/.git' -prune -o -type d -print | sed "s#$HOME/##" )
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
@@ -341,6 +341,9 @@ fi
|
||||||
|
|
||||||
|
if [[ "$selected" =~ ^\[TMUX\]\ (.+)$ ]]; then
|
||||||
|
selected="${BASH_REMATCH[1]}"
|
||||||
|
+else
|
||||||
|
+ # Re-add the Home directory back to the selected path.
|
||||||
|
+ selected="$HOME/$selected"
|
||||||
|
fi
|
||||||
|
|
||||||
|
selected_name=$(basename "$selected" | tr . _)
|
Loading…
Add table
Add a link
Reference in a new issue