Skip to content

terminal: Fix vi mode cursor not updating on k/j navigation#46762

Merged
dinocosta merged 2 commits intozed-industries:mainfrom
xcb3d:fix-terminal-vi-mode-cursor
Jan 15, 2026
Merged

terminal: Fix vi mode cursor not updating on k/j navigation#46762
dinocosta merged 2 commits intozed-industries:mainfrom
xcb3d:fix-terminal-vi-mode-cursor

Conversation

@xcb3d
Copy link
Contributor

@xcb3d xcb3d commented Jan 14, 2026

Previously, pressing k or j multiple times in terminal vi mode would not update the visual cursor position. The cursor appeared stuck even though internal position was tracked correctly.

The fix adds cx.notify() in the key_down handler when vi mode is enabled, matching the existing behavior in send_keystroke.

Closes #46736

Release Notes:

  • terminal: Fixed vi mode cursor not visually updating when navigating with vi motion keys

@cla-bot
Copy link

cla-bot bot commented Jan 14, 2026

Thank you for your pull request and welcome to our community. We could not parse the GitHub identity of the following contributors: Elior Nguyen.
This is most likely caused by a git client misconfiguration; please make sure to:

  1. check if your git client is configured with an email to sign commits git config --list | grep email
  2. If not, set it up using git config --global user.email email@example.com
  3. Make sure that the git commit email is configured in your GitHub account settings, see https://github.com/settings/emails

@zed-community-bot zed-community-bot bot added the first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions label Jan 14, 2026
Previously, pressing `k` or `j` multiple times in terminal vi mode would
not update the visual cursor position. The cursor appeared stuck even
though internal position was tracked correctly.

The fix adds `cx.notify()` in the `key_down` handler when vi mode is
enabled, matching the existing behavior in `send_keystroke`.

Closes zed-industries#46736
@xcb3d xcb3d force-pushed the fix-terminal-vi-mode-cursor branch from 8909cba to f9a9acc Compare January 14, 2026 04:32
@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Jan 14, 2026
@dinocosta dinocosta self-assigned this Jan 14, 2026
Extracts common logic from `key_down` and `send_keystroke` into
`process_keystroke` helper method, while preserving vi mode notification
fix.
@dinocosta
Copy link
Member

@xcb3d Thank you! Was actually trying to select and yank some content from terminal this morning and wondering why Zed's terminal vi mode was not behaving as it should 😬

I've pushed another commit with a small refactoring. Can you also take a look at cla-bot's comment?

@xcb3d
Copy link
Contributor Author

xcb3d commented Jan 14, 2026

Hi @dinocosta. Thanks for the help with the vi mode explanation and for the refactor! I've cleared the CLA-bot check as well. Everything should be good to go now.

@dinocosta dinocosta merged commit b4d1ba7 into zed-industries:main Jan 15, 2026
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement first contribution the author's first pull request to Zed. NOTE: the label application is automated via github actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to scroll in terminal vi mode

2 participants