mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 04:58:57 +00:00
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:
parent
dfb4998778
commit
02f578a82d
4 changed files with 11 additions and 19 deletions
|
@ -26,7 +26,7 @@ if status --is-interactive
|
|||
|
||||
set_color --bold
|
||||
echo "You appear to be trying to launch an old fish binary with newer scripts "
|
||||
echo "installed into" (set_color --underline)"$__fish_datadir"
|
||||
echo "installed into" (set_color --underline)"$__fish_datadir"
|
||||
set_color normal
|
||||
echo -e "\nThis is an unsupported configuration.\n"
|
||||
set_color yellow
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
end
|
||||
return 127
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue