fish vi mode cursor shape on iTerm2

Fixes #3593
This commit is contained in:
Kurtis Rader 2016-12-01 21:56:59 -08:00
parent 227ba10628
commit d73ff39393
2 changed files with 16 additions and 1 deletions

View file

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

View file

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