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

Cursor shape does not update correctly in vi mode #6653

Closed
wylfen opened this issue Feb 25, 2020 · 5 comments
Closed

Cursor shape does not update correctly in vi mode #6653

wylfen opened this issue Feb 25, 2020 · 5 comments
Milestone

Comments

@wylfen
Copy link
Contributor

wylfen commented Feb 25, 2020

I recently updated to the most current release of fish, version 3.1.0. I found that in the new version, the cursor shape is not updated correctly anymore when using vi mode. I confirmed this for current master as well.

$ rg cursor ~/.config/fish/fish_variables
30:SETUVAR fish_cursor_default:block\x1eblink
31:SETUVAR fish_cursor_insert:line\x1eblink
32:SETUVAR fish_cursor_replace_one:underscore\x1eblink
33:SETUVAR fish_cursor_visual:block

With the above settings, in a new session, fish shows the correct line shape. It switches to block shape when I press ESC. However, it does not switch back to line if I then enter insert mode with a or i. It also does not switch to underscore if I press r.

I bisected this issue and traced it back to ff5524944, which removed event handler support for implicit sets. Such a set is present in input.cpp:

vars.set_one(FISH_BIND_MODE_VAR, ENV_GLOBAL, bm);

To confirm this, I added code to input.cpp that would collect fired events in an event_t vector, and passed it to event_fire. With that change, the cursor updated correctly again.

I planned to send a pull request along with this report, but for this I am not familiar enough with the codebase (this is my first glance at it).

@ridiculousfish
Copy link
Member

ridiculousfish commented Feb 27, 2020

Wow, amazing digging. Thank you! I'll take a look.

@ridiculousfish ridiculousfish added this to the fish 3.1.1 milestone Feb 27, 2020
ridiculousfish added a commit to ridiculousfish/fish-shell that referenced this issue Mar 9, 2020
When changing certain variables programmatically, ensure that events
are sent. Fixes fish-shell#6653
ridiculousfish added a commit that referenced this issue Mar 9, 2020
When changing certain variables programmatically, ensure that events
are sent. Fixes #6653
@ridiculousfish
Copy link
Member

ridiculousfish commented Mar 9, 2020

Should be fixed in master as 5886b96 and 3.1.1 as acad9b0. Thank you for filing, this was awesome.

@niilz

This comment has been minimized.

@faho

This comment has been minimized.

@niilz

This comment has been minimized.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 8, 2020
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

4 participants