echo the no-string errors to stderr and return 1.

Fix output on launch

Drop __fish_urlencode.fish

Drop prompt_pwd.fish
This commit is contained in:
Aaron Gyes 2016-06-25 20:50:18 -07:00
parent dfb4998778
commit 02f578a82d
4 changed files with 11 additions and 19 deletions

View file

@ -1,8 +1,4 @@
function __fish_urlencode --description "URL-encode stdin"
if not type -q string
return 1
end
set -l join ''
set -l chars
# Set locale to C and IFS to "" in order to split a line into bytes.

View file

@ -5,12 +5,6 @@ function prompt_pwd --description "Print the current working directory, shortene
return 0
end
# If we don't have a string builtin, we have no hope of maniuplating $PWD - just output it as-is.
if not type -q string
echo $PWD
return 0
end
# This allows overriding fish_prompt_pwd_dir_length from the outside (global or universal) without leaking it
set -q fish_prompt_pwd_dir_length; or set -l fish_prompt_pwd_dir_length 1

View file

@ -3,14 +3,16 @@ if not contains string (builtin -n)
if not set -q __is_launched_without_string
if status --is-interactive
# We've been autoloaded after fish < 2.3.0 upgraded to >= 2.3.1 - no string builtin
set_color --bold
echo "Fish has been upgraded, and the scripts on your system are not compatible"
echo "with this prior instance of fish. You can probably run:"
set_color green
echo "\n exec fish"
set_color normal
echo "… to replace this process with a new one in-place."
set_color --bold >&2
echo "Fish has been upgraded, and the scripts on your system are not compatible" >&2
echo "with this prior instance of fish. You can probably run:" >&2
set_color green >&2
echo -e "\n exec fish" >&2
set_color normal >&2
echo "… to replace this process with a new one in-place." >&2
set -g __is_launched_without_string 1
end
end
return 127
end
end