Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't get cursor shape to change in vi mode #7458

Closed
noib3 opened this issue Nov 7, 2020 · 3 comments
Closed

Can't get cursor shape to change in vi mode #7458

noib3 opened this issue Nov 7, 2020 · 3 comments

Comments

@noib3
Copy link

noib3 commented Nov 7, 2020

fish version: fish, version 3.1.2
OS: macOS Catalina 10.15.7
terminal: alacritty 0.5.0 (a6681e3)
$TERM: xterm-256color

As said in the title, I can't get my cursor shape to change when I change vi mode. I currently have

set fish_cursor_default block
set fish_cursor_insert line
set fish_cursor_replace_one underscore
set fish_cursor_visual block

in my config.fish. I've tested this with alacritty and with the default macOS terminal, and in neither of them the cursor shape changes.

@faho
Copy link
Member

faho commented Nov 7, 2020

Alacritty isn't supported in 3.1.2, it needs 3c6c8d5, which is only in the next release.

@faho faho closed this as completed Nov 7, 2020
@faho faho added this to the fish 3.2.0 milestone Nov 7, 2020
@noib3
Copy link
Author

noib3 commented Nov 7, 2020

@faho I manually added alacritty to the whitelist like in the commit you posted but it still doesn't work.

@stonefeld
Copy link

stonefeld commented Jan 7, 2021

@noib3 I solved it by manually adding this in my config.fish

function fish_mode_prompt
  switch $fish_bind_mode
    case default
      echo -en "\e[2 q"
      set_color -o brwhite
      echo "[ "
      set_color -o brred
      echo "N"
      set_color -o brwhite
      echo " ]"
    case insert
      echo -en "\e[6 q"
      set_color -o brwhite
      echo "[ "
      set_color -o brgreen
      echo "I"
      set_color -o brwhite
      echo " ]"
    case replace_one
      echo -en "\e[4 q"
      set_color -o brwhite
      echo "[ "
      set_color -o bryellow
      echo "R"
      set_color -o brwhite
      echo " ]"
    case visual
      echo -en "\e[2 q"
      set_color -o brwhite
      echo "[ "
      set_color -o brmagenta
      echo "V"
      set_color -o brwhite
      echo " ]"
    case '*'
      echo -en "\e[2 q"
      set_color -o brwhite
      echo "[ "
      set_color -o brred
      echo "?"
      set_color -o brwhite
      echo " ]"
  end
  set_color normal
end

I hope this solves your problem!!!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants