mirror of
https://github.com/fish-shell/fish-shell
synced 2025-01-12 13:08:49 +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
|
@ -1,8 +1,4 @@
|
||||||
function __fish_urlencode --description "URL-encode stdin"
|
function __fish_urlencode --description "URL-encode stdin"
|
||||||
if not type -q string
|
|
||||||
return 1
|
|
||||||
end
|
|
||||||
|
|
||||||
set -l join ''
|
set -l join ''
|
||||||
set -l chars
|
set -l chars
|
||||||
# Set locale to C and IFS to "" in order to split a line into bytes.
|
# 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
|
return 0
|
||||||
end
|
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
|
# 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
|
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 not set -q __is_launched_without_string
|
||||||
if status --is-interactive
|
if status --is-interactive
|
||||||
# We've been autoloaded after fish < 2.3.0 upgraded to >= 2.3.1 - no string builtin
|
# We've been autoloaded after fish < 2.3.0 upgraded to >= 2.3.1 - no string builtin
|
||||||
set_color --bold
|
set_color --bold >&2
|
||||||
echo "Fish has been upgraded, and the scripts on your system are not compatible"
|
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:"
|
echo "with this prior instance of fish. You can probably run:" >&2
|
||||||
set_color green
|
set_color green >&2
|
||||||
echo "\n exec fish"
|
echo -e "\n exec fish" >&2
|
||||||
set_color normal
|
set_color normal >&2
|
||||||
echo "… to replace this process with a new one in-place."
|
echo "… to replace this process with a new one in-place." >&2
|
||||||
|
set -g __is_launched_without_string 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
return 127
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue