From f2c722eeaae16be89716bb924e43fb4804488737 Mon Sep 17 00:00:00 2001 From: Daniel Fichtinger Date: Fri, 18 Apr 2025 15:00:05 -0400 Subject: [PATCH] AutoYADM commit: 2025-04-18 15:00:05 --- .config/fish/conf.d/smartcd.fish | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.config/fish/conf.d/smartcd.fish b/.config/fish/conf.d/smartcd.fish index 198752ca..f91c6e87 100644 --- a/.config/fish/conf.d/smartcd.fish +++ b/.config/fish/conf.d/smartcd.fish @@ -24,11 +24,17 @@ function cd --wraps=cd --description "Change directory. No args goes to git root end if not test (pwd) = $root __cd_orig $root - else + else if set -q dirprev echo "prev: $dirprev[-1] root: $root" - if string match -q "$root" "$dirprev[-1]" + set -x smartdirprev $dirprev[-1] + set -x smartroot $root + if string match -q "$root*" "$dirprev[-1]" + echo We out here __cd_orig - + else + set -l prompt "This would take you to $dirprev[-1], which is outside $root, are you sure? (y/n): " + echo $prompt end end end