Neovim 0.12.0 Shift key regression in Cursor's xterm.js terminal

Where does the bug appear (feature/product)?

Cursor IDE

Describe the Bug

xterm.js PR #5791

Steps to Reproduce

see xterm.js PR #5791

Expected Behavior

see xterm.js PR #5791

Operating System

MacOS

Version Information

ALL versions since xterm.js PR #5791 was documented

For AI issues: which model did you use?

None, not model issue.

Additional Information

this is elaborately explained in xterm.js PR #5791

Does this stop you from using Cursor

No - Cursor works, but with this issue

Could the name of the issue be changed? I had this happen today after I updated cursor.

I use neovim as my default editor. so doing git commit opens it up and faced this issue.

Hey, thanks for the report and the upstream links. This is a known regression in xterm.js that affects Neovim 0.12.0+ in the integrated terminal. The Shift modifier gets lost on number keys. Cursor uses xterm.js via VS Code, so we’ll get the fix after PR #5791 is merged in xterm.js and the related dependency is updated.

I’ve also filed this on our side for tracking so we can pull it in during the bump. I can’t give an ETA since it depends on when the upstream PR gets merged.

Workaround for now, if this blocks you: run nvim in an external terminal like Ghostty, iTerm2, or Windows Terminal. Shift+number keys work correctly there.

This was merged upstream on May 11, Fix kitty keyboard "Report event types" behavior not matching spec by zeertzjq · Pull Request #5791 · xtermjs/xterm.js · GitHub

Super weird bug. Y’all might want to pick up the fix, this appears to be breaking cmd+v in codex as well, probably breaking other things too.

I just did this until we get a better solution. Cheers!
– Map Cmd+C and Cmd+V to work natively in Neovim when terminal sends /
vim.keymap.set({‘n’, ‘v’}, ‘’, ‘"+y’, { desc = “Copy to clipboard” })
vim.keymap.set(‘n’, ‘’, ‘"+P’, { desc = “Paste from clipboard” })
vim.keymap.set(‘v’, ‘’, ‘"+P’, { desc = “Paste from clipboard” })
vim.keymap.set(‘i’, ‘’, ‘+’, { desc = “Paste from clipboard in insert mode” })
vim.keymap.set(‘c’, ‘’, ‘+’, { desc = “Paste from clipboard in command mode” })

Thanks for sharing the keymap, it’s useful for any user who hits this bug before the xterm.js update.

The upstream PR was merged on May 11, so now we’re waiting for the dependency to be updated on our side. I can’t share an ETA for the dependency bump yet, but once we pull it in, we’ll post an update here.

@jlebar thanks for the tip about Cmd+V in codex, I’ll take a look and see if it’s the same root cause.

Thanks Dean!
Cheers and have a good one, bud!