From ad34c47f09e36798458658404bc7abb15246f17d Mon Sep 17 00:00:00 2001 From: Hans Larsen Date: Mon, 31 Jan 2022 10:44:28 -0800 Subject: [PATCH] Fail when files arg is empty, and stop on root --- functions/fish_prompt.fish | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/functions/fish_prompt.fish b/functions/fish_prompt.fish index ec9b43f..4549b63 100644 --- a/functions/fish_prompt.fish +++ b/functions/fish_prompt.fish @@ -899,7 +899,8 @@ function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the pare set -l dir "$argv[1]" set -l files $argv[2..] - if [ -z "$dir" ] + if test -z "$dir" + or test -z "$files" return 1 end @@ -910,6 +911,9 @@ function __bobthefish_prompt_find_file_up -S -d 'Find file(s), going up the pare end end + [ "$dir" = '/' ] + and return 1 + set dir (__bobthefish_dirname "$dir") end return 1