diff --git a/.config/fish/conf.d/smartcd.fish b/.config/fish/conf.d/smartcd.fish index f91c6e87..3121c42d 100644 --- a/.config/fish/conf.d/smartcd.fish +++ b/.config/fish/conf.d/smartcd.fish @@ -34,7 +34,17 @@ function cd --wraps=cd --description "Change directory. No args goes to git root __cd_orig - else set -l prompt "This would take you to $dirprev[-1], which is outside $root, are you sure? (y/n): " - echo $prompt + while read --nchars 1 -l response --prompt-str="$prompt" or return 1 + switch $response + case y Y + __cd_orig - + break + case n N + break + case '*' + continue + end + end end end end