mirror of
https://github.com/fish-shell/fish-shell
synced 2024-11-10 23:24:39 +00:00
parent
227ba10628
commit
d73ff39393
2 changed files with 16 additions and 1 deletions
13
share/functions/__fish_cursor_1337.fish
Normal file
13
share/functions/__fish_cursor_1337.fish
Normal 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
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue