From 3e29b0d916d75eb04c5fc963704bba49bb87ed93 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Sat, 2 May 2020 17:33:47 +0200 Subject: [PATCH] fish_vi_cursor: Allow new Konsole It removed $KONSOLE_PROFILE_NAME and added $KONSOLE_VERSION. Let's assume if $KONSOLE_PROFILE_NAME is set we use the old sequences, if not we use the new ones. --- share/functions/fish_vi_cursor.fish | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index 926a48a6b..254854b6a 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -38,6 +38,7 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' # Note: Previous versions also checked $TMUX, and made sure that then $TERM was screen* or tmux*. # We don't care, since we *cannot* handle term-in-a-terms 100% correctly. if not set -q KONSOLE_PROFILE_NAME + and not test -n "$KONSOLE_VERSION" -a "$KONSOLE_VERSION" -ge "200400" # konsole, but new. and not set -q ITERM_PROFILE and not set -q VTE_VERSION # which version is already checked above and not set -q XTERM_VERSION @@ -63,11 +64,8 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' set -l function switch "$terminal" case auto - # TODO: Konsole as of 18.08 knows the xterm sequences, - # but there's still bugs with it (as of konsole 19.04.0). - # - # If it is fixed, we'd have to read $KONSOLE_VERSION for a while, - # though that was only introduced in 18.08 as well. + # Nowadays, konsole does not set $KONSOLE_PROFILE_NAME anymore, + # and it uses the xterm sequences. if set -q KONSOLE_PROFILE_NAME set function __fish_cursor_konsole else if set -q ITERM_PROFILE