Bug 2149844 - Vim does not recognize key codes passed by Kitty terminal emulator
Summary: Vim does not recognize key codes passed by Kitty terminal emulator
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 37
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Karsten
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-12-01 06:47 UTC by ho121
Modified: 2022-12-08 01:56 UTC (History)
8 users (show)

Fixed In Version: vim-9.0.1006-1.fc37 vim-9.0.1006-1.fc36
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-12-07 01:35:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description ho121 2022-12-01 06:47:43 UTC
Description of problem:
Terminal vim `nmap` not working

Version-Release number of selected component (if applicable):
vim-X11.x86_64                                    2:9.0.963-1.fc37                  @updates              
vim-common.x86_64                                 2:9.0.963-1.fc37                  @updates              
vim-data.noarch                                   2:9.0.963-1.fc37                  @updates              
vim-enhanced.x86_64                               2:9.0.963-1.fc37                  @updates              
vim-filesystem.noarch                             2:9.0.963-1.fc37                  @updates              
vim-minimal.x86_64                                2:9.0.963-1.fc37                  @updates  

How reproducible:


Steps to Reproduce:
1. Open a terminal
2. Execute `vim --clean` 
3. Type `:nmap <F1> :q!<CR>` and press Enter.
4. Press F1 in vim normal mode.

Actual results:
vim not quit.

Expected results:
vim to quit

Additional info:
This affects vim and vimx, but not gvim.

Comment 1 Zdenek Dohnal 2022-12-01 08:21:13 UTC
Hi,

thank you for reporting the issue!

I have the same version on F36 and 'nmap' works there - I'm starting up F37 virt machine to check the issue straight on F37.

Comment 2 Zdenek Dohnal 2022-12-01 09:33:33 UTC
I'm sorry - I'm not able to reproduce the issue on F37 either, with the default Vim installation - I've tried running Vim in session through ssh and on a real F37, both worked fine.

Would you mind trying to reproduce the issue in a new environment, like VM? Ideally first in default environment and keyboard layout - GNOME and ENG US.

The only thing I can thing of is that your environment (keyboard, desktop environment) sends a different character codes than the default installation.

Comment 3 ho121 2022-12-01 12:59:57 UTC
Sorry, my bad.

I use kitty terminal. This only happens in kitty. Maybe it is a kitty bug.

Comment 4 Zdenek Dohnal 2022-12-02 10:31:20 UTC
I can't close Vim in that emulator - so it is definitely sending different key codes.

Switching to kitty to investigation - if I open Vim it generates the following messages (on F36):

[336 11:30:04.994164] [PARSE ERROR] Unrecognized DCS code: 0x7a
[336 11:30:04.994190] [PARSE ERROR] Unknown CSI code: 'm' with start_modifier: '' and end_modifier: '%' and parameters: '0'

Comment 5 skoved 2022-12-02 14:46:05 UTC
Hi I also use run vim from the kitty terminal (version 0.26.5-3.fc36). I'm currently on F36 and started encountering this issue with update of vim to 2:9.0.963-1.fc36 (issue goes away if I downgrade vim to 2:8.2.4621-1.fc36).

In trying to figure out what was going on I stumbled upon this issue [1] on the vim github repo. Based on this comment from the issue [2] it looks like there is a new version of vim that includes the fix for this issue.

1. https://github.com/vim/vim/issues/11638
2. https://github.com/vim/vim/issues/11638#issuecomment-1331155497

Comment 6 ahlinc 2022-12-04 23:29:31 UTC
Hi I use kitty and vim on 6.0.10-300.fc37.x86_64 and also can't exit from vim on the :q command.

~ # rpm -qa | grep -iP "kitty|vim"
kitty-terminfo-0.26.5-3.fc37.noarch
kitty-0.26.5-3.fc37.x86_64
vim-data-9.0.963-1.fc37.noarch
vim-filesystem-9.0.963-1.fc37.noarch
vim-common-9.0.963-1.fc37.x86_64
vim-enhanced-9.0.963-1.fc37.x86_64
vim-minimal-9.0.963-1.fc37.x86_64
~ # ls ~/Downloads/kitty-0.26.5-x86_64.txz

The problem doesn't exist if to use Kitty of the same version from an authors' build:
https://github.com/kovidgoyal/kitty/releases/download/v0.26.5/kitty-0.26.5-x86_64.txz

So the root of the problem may be is some library with which kitty was linked on Fedora.

Comment 7 Zdenek Dohnal 2022-12-05 07:13:28 UTC
Hi Sam,

thank you for letting me know!

I've tested the latest Vim patchlevel and the issue is fixed as you said. I'll build the newest Vim on F36+, because F35 is going to be EOL in a week.

In case there are two people who can test and give karma on F35, do let me know - I'll build Vim for F35 as well and create the update, if you are able to give it enough karma as soon as possible. I don't want to have the update hanging there after EOL if there is not enough karma to push it to the F35 stable.

Comment 8 Fedora Update System 2022-12-05 13:03:20 UTC
FEDORA-2022-1e14f3ae45 has been submitted as an update to Fedora 37. https://bodhi.fedoraproject.org/updates/FEDORA-2022-1e14f3ae45

Comment 9 Fedora Update System 2022-12-05 13:04:34 UTC
FEDORA-2022-fc4c513d06 has been submitted as an update to Fedora 36. https://bodhi.fedoraproject.org/updates/FEDORA-2022-fc4c513d06

Comment 10 Fedora Update System 2022-12-06 01:18:10 UTC
FEDORA-2022-fc4c513d06 has been pushed to the Fedora 36 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-fc4c513d06`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-fc4c513d06

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2022-12-06 01:32:13 UTC
FEDORA-2022-1e14f3ae45 has been pushed to the Fedora 37 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --refresh --advisory=FEDORA-2022-1e14f3ae45`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2022-1e14f3ae45

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2022-12-07 01:35:56 UTC
FEDORA-2022-1e14f3ae45 has been pushed to the Fedora 37 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2022-12-08 01:56:02 UTC
FEDORA-2022-fc4c513d06 has been pushed to the Fedora 36 stable repository.
If problem still persists, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.