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

TUI: handle ModifyOtherKeys key sequences #14350

Closed
jerome-pouiller opened this issue Apr 12, 2021 · 5 comments
Closed

TUI: handle ModifyOtherKeys key sequences #14350

jerome-pouiller opened this issue Apr 12, 2021 · 5 comments
Labels
bug issues reporting wrong behavior input tui
Milestone

Comments

@jerome-pouiller
Copy link

Environment

  • nvim --version: v0.4.4
  • vim -u DEFAULTS (version: ) behaves differently? no
  • Operating system/version: Debian Bullseye
  • Terminal name/version: xterm
  • $TERM: xterm

Steps to reproduce

  • Modify your ~/.Xresources to include xterm*modifyOtherKeys: 2. This step is not mandatory, but it may make the further behavior easier to understand. Don't forget to merge your resource with xrdb -merge ~/.Xresources.
  • Launch nvim -u NORC with xterm.
  • Enter command mode with :.
  • Hit C-k twice (I have never understood why C-k should be typed twice, but I think it is not related to the problem).
  • Hit a key sequence with Ctrl and Shift like C-S-g.
  • It shows ^G while <C-S-g> is expected.

If you do the same with vim, it displays <C-S-g> as expected.

Neovim correctly support ModifyOtherKeys. If it was not the case, it would be impossible to enter any control sequences or shited letters (compare with the behavior of a program that does not support ModifyOtherKeys like nano). However, a part of the escape sequence is dropped somewhere and neovim does not make the difference between <C-g> and <C-S-g>.

Note I think this issue is not related to #6279. Indeed, in my setup xterm send ^]] and not \x9b.

@jerome-pouiller jerome-pouiller added the bug issues reporting wrong behavior label Apr 12, 2021
@glacambre
Copy link
Member

Could you try nightly? I think this bug might have been fixed already.

@jerome-pouiller
Copy link
Author

Indeed, it is fixed with v0.5.0-dev+1233-g82ac44d01

@jerome-pouiller
Copy link
Author

jerome-pouiller commented Apr 12, 2021

In fact, it seems there is another problem with nightly build. Indeed, it runs fine with xterm*modifyOtherKeys: 2 (which is unsane). However, it still does not work with the default xterm configuration. I think that neovim does not send the string \<Esc>[>4;2m that enable modifyOtherKeys[1]. In vim, this string is sent by t_TI and t_TE[2]. Indeed, I do not see these equivalents in neovim.

[1]: as explain here alacritty/alacritty#3101
[2]: see :h modifyOtherKeys in vim

@mhinz mhinz added the tui label Apr 15, 2021
@justinmk justinmk added the input label Sep 17, 2021
@justinmk justinmk added this to the backlog milestone Sep 17, 2021
@justinmk justinmk changed the title Fail to handle ModifyOtherKeys key sequences TUI: handle ModifyOtherKeys key sequences Sep 17, 2021
@neovim-discourse
Copy link

This issue has been mentioned on Neovim Discourse. There might be relevant details there:

https://neovim.discourse.group/t/nitty-gritty-questions-on-terminal-nvim-and-keyboard-events/1624/1

@justinmk
Copy link
Member

fixed by #17771

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior input tui
Projects
None yet
Development

No branches or pull requests

5 participants