fish_vi_cursor.fish (fish-3.5.0.tar.xz) | : | fish_vi_cursor.fish (fish-3.5.1.tar.xz) | ||
---|---|---|---|---|
skipping to change at line 40 | skipping to change at line 40 | |||
and not test (string replace -r "XTerm\((\d+)\)" '$1' -- "$XTERM_VER SION") -ge 280 2>/dev/null | and not test (string replace -r "XTerm\((\d+)\)" '$1' -- "$XTERM_VER SION") -ge 280 2>/dev/null | |||
return | return | |||
end | end | |||
# We need one of these terms. | # We need one of these terms. | |||
# It would be lovely if we could rely on terminfo, but: | # It would be lovely if we could rely on terminfo, but: | |||
# - The "Ss" entry isn't a thing in macOS' old and crusty terminfo | # - The "Ss" entry isn't a thing in macOS' old and crusty terminfo | |||
# - It is set for xterm, and everyone and their dog claims to be xterm | # - It is set for xterm, and everyone and their dog claims to be xterm | |||
# | # | |||
# So we just don't care about $TERM, unless it is one of the few termina ls that actually have their own entry. | # So we just don't care about $TERM, unless it is one of the few termina ls that actually have their own entry. | |||
# | ||||
# Note: Previous versions also checked $TMUX, and made sure that then $T | ||||
ERM 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 | if not set -q KONSOLE_PROFILE_NAME | |||
and not test -n "$KONSOLE_VERSION" -a "$KONSOLE_VERSION" -ge 200400 # konsole, but new. | and not test -n "$KONSOLE_VERSION" -a "$KONSOLE_VERSION" -ge 200400 # konsole, but new. | |||
and not set -q ITERM_PROFILE | and not set -q ITERM_PROFILE | |||
and not set -q VTE_VERSION # which version is already checked above | and not set -q VTE_VERSION # which version is already checked above | |||
and not set -q WT_PROFILE_ID | and not set -q WT_PROFILE_ID | |||
and not set -q XTERM_VERSION | and not set -q XTERM_VERSION | |||
and not string match -q Apple_Terminal -- $TERM_PROGRAM | and not string match -q Apple_Terminal -- $TERM_PROGRAM | |||
and not string match -rq '^st(-.*)$' -- $TERM | and not string match -rq '^st(-.*)$' -- $TERM | |||
and not string match -q 'xterm-kitty*' -- $TERM | and not string match -q 'xterm-kitty*' -- $TERM | |||
and not string match -q 'rxvt*' -- $TERM | and not string match -q 'rxvt*' -- $TERM | |||
and not string match -q 'alacritty*' -- $TERM | and not string match -q 'alacritty*' -- $TERM | |||
and not string match -q 'foot*' -- $TERM | and not string match -q 'foot*' -- $TERM | |||
and not begin | ||||
set -q TMUX | ||||
and string match -qr '^screen|^tmux' -- $TERM | ||||
end | ||||
return | return | |||
end | end | |||
end | end | |||
set -l terminal $argv[1] | set -l terminal $argv[1] | |||
set -q terminal[1] | set -q terminal[1] | |||
or set terminal auto | or set terminal auto | |||
set -l function | set -l function | |||
switch "$terminal" | switch "$terminal" | |||
skipping to change at line 81 | skipping to change at line 82 | |||
set function __fish_cursor_1337 | set function __fish_cursor_1337 | |||
else | else | |||
set function __fish_cursor_xterm | set function __fish_cursor_xterm | |||
end | end | |||
case konsole | case konsole | |||
set function __fish_cursor_konsole | set function __fish_cursor_konsole | |||
case xterm | case xterm | |||
set function __fish_cursor_xterm | set function __fish_cursor_xterm | |||
end | end | |||
set -l tmux_prefix | ||||
set -l tmux_postfix | ||||
if set -q TMUX | ||||
set tmux_prefix echo -ne "'\ePtmux;\e'" | ||||
set tmux_postfix echo -ne "'\e\\\\'" | ||||
end | ||||
set -q fish_cursor_unknown | set -q fish_cursor_unknown | |||
or set -g fish_cursor_unknown block | or set -g fish_cursor_unknown block | |||
echo " | echo " | |||
function fish_vi_cursor_handle --on-variable fish_bind_mode --on-event fish_postexec --on-event fish_focus_in | function fish_vi_cursor_handle --on-variable fish_bind_mode --on-event fish_postexec --on-event fish_focus_in | |||
set -l varname fish_cursor_\$fish_bind_mode | set -l varname fish_cursor_\$fish_bind_mode | |||
if not set -q \$varname | if not set -q \$varname | |||
set varname fish_cursor_unknown | set varname fish_cursor_unknown | |||
end | end | |||
$tmux_prefix | ||||
$function \$\$varname | $function \$\$varname | |||
$tmux_postfix | ||||
end | end | |||
" | source | " | source | |||
echo " | echo " | |||
function fish_vi_cursor_handle_preexec --on-event fish_preexec | function fish_vi_cursor_handle_preexec --on-event fish_preexec | |||
set -l varname fish_cursor_default | set -l varname fish_cursor_default | |||
if not set -q \$varname | if not set -q \$varname | |||
set varname fish_cursor_unknown | set varname fish_cursor_unknown | |||
end | end | |||
$tmux_prefix | ||||
$function \$\$varname | $function \$\$varname | |||
$tmux_postfix | ||||
end | end | |||
" | source | " | source | |||
end | end | |||
End of changes. 7 change blocks. | ||||
16 lines changed or deleted | 4 lines changed or added |