Skip to content

Cursor shape does not update correctly in vi mode #6653

@wylfen

Description

@wylfen

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    regressionSomething that used to work, but was broken, especially between releases

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions