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.
This commit is contained in:
Fabian Homborg
2020-05-02 17:33:47 +02:00
parent aa8c9df2d0
commit 3e29b0d916

View File

@@ -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