diff --git a/share/config.fish b/share/config.fish index 60fd0ba16..432fa6eb0 100644 --- a/share/config.fish +++ b/share/config.fish @@ -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 diff --git a/share/functions/__fish_urlencode.fish b/share/functions/__fish_urlencode.fish index a879cb3e5..df07eee03 100644 --- a/share/functions/__fish_urlencode.fish +++ b/share/functions/__fish_urlencode.fish @@ -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. diff --git a/share/functions/prompt_pwd.fish b/share/functions/prompt_pwd.fish index 74372dd51..96e9b2f33 100644 --- a/share/functions/prompt_pwd.fish +++ b/share/functions/prompt_pwd.fish @@ -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 diff --git a/share/functions/string.fish b/share/functions/string.fish index bf76782df..ec5cb2612 100644 --- a/share/functions/string.fish +++ b/share/functions/string.fish @@ -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