diff options
author | Fabian Homborg <FHomborg@gmail.com> | 2016-04-16 13:00:14 +0200 |
---|---|---|
committer | Fabian Homborg <FHomborg@gmail.com> | 2016-04-18 14:20:42 +0200 |
commit | 8d3eae0d76a29f54d3c736b64e001eed98a50926 (patch) | |
tree | 3a4fbd1a5ec929b2aebc29157e0330a4ea31324c /share | |
parent | d7fd0427f36c5cb761bd61875d44d58329156660 (diff) |
Move 24bit setup into config.fish
Fixes #2941.
(cherry picked from commit 8558561650995b330a1ae5ee87c592382856cc40)
Diffstat (limited to 'share')
-rw-r--r-- | share/config.fish | 24 | ||||
-rw-r--r-- | share/functions/__fish_config_interactive.fish | 11 |
2 files changed, 18 insertions, 17 deletions
diff --git a/share/config.fish b/share/config.fish index 86e8d9b7..fa1a2628 100644 --- a/share/config.fish +++ b/share/config.fish @@ -17,12 +17,24 @@ function __fish_default_command_not_found_handler echo "fish: Unknown command '$argv'" >&2 end -# -# Hook up the default as the principal command_not_found handler -# in case we are not interactive -# -status -i; or function __fish_command_not_found_handler --on-event fish_command_not_found - __fish_default_command_not_found_handler $argv +if status --is-interactive + # Enable truecolor/24-bit support for select terminals + if not set -q NVIM_LISTEN_ADDRESS # Neovim will swallow the 24bit sequences, rendering text white + 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 "$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 + set -g fish_term24bit 1 + end +else + # Hook up the default as the principal command_not_found handler + # in case we are not interactive + function __fish_command_not_found_handler --on-event fish_command_not_found + __fish_default_command_not_found_handler $argv + end end # diff --git a/share/functions/__fish_config_interactive.fish b/share/functions/__fish_config_interactive.fish index 3702c075..bca410ac 100644 --- a/share/functions/__fish_config_interactive.fish +++ b/share/functions/__fish_config_interactive.fish @@ -287,15 +287,4 @@ function __fish_config_interactive -d "Initializations that should be performed fish_fallback_prompt end end - - if not set -q NVIM_LISTEN_ADDRESS # Neovim will swallow the 24bit sequences, rendering text white - 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 "$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 - set -g fish_term24bit 1 - end end |