diff --git a/share/functions/__fish_cursor_1337.fish b/share/functions/__fish_cursor_1337.fish new file mode 100644 index 000000000..ec32ff434 --- /dev/null +++ b/share/functions/__fish_cursor_1337.fish @@ -0,0 +1,13 @@ +# Set the cursor using the '\e]1337;' sequence recognized by iTerm2 on macOS and possibly other +# terminals. +function __fish_cursor_1337 -d 'Set cursor using OSC command 1337' + set -l shape $argv[1] + switch "$shape" + case block + echo -en '\e]1337;CursorShape=0\x7' + case underscore + echo -en '\e]1337;CursorShape=2\x7' + case line + echo -en '\e]1337;CursorShape=1\x7' + end +end diff --git a/share/functions/fish_vi_cursor.fish b/share/functions/fish_vi_cursor.fish index b8d4f77e4..4d0f92426 100644 --- a/share/functions/fish_vi_cursor.fish +++ b/share/functions/fish_vi_cursor.fish @@ -67,9 +67,11 @@ function fish_vi_cursor -d 'Set cursor shape for different vi modes' switch "$terminal" case auto if set -q KONSOLE_PROFILE_NAME - or set -q ITERM_PROFILE set function __fish_cursor_konsole set uses_echo 1 + else if set -q ITERM_PROFILE + set function __fish_cursor_1337 + set uses_echo 1 else set function __fish_cursor_xterm set uses_echo 1