mirror of
https://github.com/fish-shell/fish-shell
synced 2024-12-27 13:23:09 +00:00
Retire the bit of config.fish that detected missing builtin string
It's been a few years.
This commit is contained in:
parent
634e97a85e
commit
4d6a97d35c
1 changed files with 13 additions and 31 deletions
|
@ -16,38 +16,20 @@ function __fish_default_command_not_found_handler
|
|||
end
|
||||
|
||||
if status --is-interactive
|
||||
# The user has seemingly explicitly launched an old fish with too-new scripts installed.
|
||||
if not contains -- "string" (builtin -n)
|
||||
set -g __is_launched_without_string 1
|
||||
# XXX nostring - fix old fish binaries with no `string' builtin.
|
||||
# When executed on fish 2.2.0, the `else' block after this would
|
||||
# force on 24-bit mode due to changes to in test behavior.
|
||||
# These "XXX nostring" hacks were added for 2.3.1
|
||||
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_data_dir"
|
||||
set_color normal
|
||||
echo -e "\nThis is an unsupported configuration.\n"
|
||||
set_color yellow
|
||||
echo "You may need to uninstall and reinstall fish!"
|
||||
set_color normal
|
||||
# Remove this code when we've made it safer to upgrade fish.
|
||||
else
|
||||
# Enable truecolor/24-bit support for select terminals
|
||||
# Ignore Screen and emacs' ansi-term as they swallow the sequences, rendering the text white.
|
||||
if not set -q STY
|
||||
and not string match -q -- 'eterm*' $TERM
|
||||
and begin
|
||||
set -q KONSOLE_PROFILE_NAME # KDE's konsole
|
||||
or string match -q -- "*:*" $ITERM_SESSION_ID # Supporting versions of iTerm2 will include a colon here
|
||||
or string match -q -- "st-*" $TERM # suckless' st
|
||||
or test -n "$VTE_VERSION" -a "$VTE_VERSION" -ge 3600 # Should be all gtk3-vte-based terms after version 3.6.0.0
|
||||
or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
|
||||
end
|
||||
# Only set it if it isn't to allow override by setting to 0
|
||||
set -q fish_term24bit
|
||||
or set -g fish_term24bit 1
|
||||
# Enable truecolor/24-bit support for select terminals
|
||||
# Ignore Screen and emacs' ansi-term as they swallow the sequences, rendering the text white.
|
||||
if not set -q STY
|
||||
and not string match -q -- 'eterm*' $TERM
|
||||
and begin
|
||||
set -q KONSOLE_PROFILE_NAME # KDE's konsole
|
||||
or string match -q -- "*:*" $ITERM_SESSION_ID # Supporting versions of iTerm2 will include a colon here
|
||||
or string match -q -- "st-*" $TERM # suckless' st
|
||||
or test -n "$VTE_VERSION" -a "$VTE_VERSION" -ge 3600 # Should be all gtk3-vte-based terms after version 3.6.0.0
|
||||
or test "$COLORTERM" = truecolor -o "$COLORTERM" = 24bit # slang expects this
|
||||
end
|
||||
# Only set it if it isn't to allow override by setting to 0
|
||||
set -q fish_term24bit
|
||||
or set -g fish_term24bit 1
|
||||
end
|
||||
else
|
||||
# Hook up the default as the principal command_not_found handler
|
||||
|
|
Loading…
Reference in a new issue