You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Some keys print twice in the terminal on Windows with kitty enabled #4918
Kitty only outputs CSI-u for regular inputs and not when the terminal outputs double keys. For example, with the PT keyboard, the keys «, », ç, Ç, º and ª are printed twice, obviously representing an unpleasant limitation.
I'm confused. You approved the PR. Did you actually test it?
I'm sorry, but I didn't have access to the machine at the time. From what I saw in the code, it seemed to suppress the second entry, and I thought it worked as expected. Today, I've already managed to test it and confirmed that it didn't fix the problem. I'll take a closer look and try to find a solution.
I'm confused. You approved the PR. Did you actually test it?
I'm sorry, but I didn't have access to the machine at the time. From what I saw in the code, it seemed to suppress the second entry, and I thought it worked as expected. Today, I've already managed to test it and confirmed that it didn't fix the problem. I'll take a closer look and try to find a solution.
I should have tested it too.
I have a new laptop (mac book pro) that I'm using Parallels on. because of that, I have not had a chance to install the POR lang pack. I'll do so now.
Reopening because fallback-only deduplication cannot be implemented safely with the current input representation.
ConcurrentQueue<char> carries characters but no physical-key or terminal-source identity. Given two identical adjacent fallback characters, the input pipeline cannot distinguish duplicate terminal output from two intentional keypresses. Suppressing one therefore makes valid input lossy, as #5616 demonstrated.
#5643 removes that raw/raw heuristic. It retains deduplication only when parser provenance identifies a kitty key event and the identical legacy fallback is the next logical key in the raw stream; timing and main-loop queue drains do not affect the result.
A future fix for this issue needs terminal/source-level provenance before or alongside the queued characters (or equivalent physical-event identity). Timing windows, processing-batch boundaries, keyboard-layout/glyph lists, and platform checks cannot resolve the ambiguity reliably.
This issue previously only occurred in Windows Terminal, which has since been fixed. When any of the keys «, », ç, Ç, º, and ª were pressed using a Portuguese (PT) keyboard, the input was not displayed in the Kitty CSI-u format and was therefore not recognized as such, but only as legacy entries without the Kitty CSI-u format, resulting in duplicate printing. Therefore, the unit test should contain an InjectRawSequence(\x1b[231::59;;231u", "ç", "ç"); input to differentiate between entries with the Kitty CSI-u format and other entries without it. The first item is a legitimate Kitty CSI-u format entry representing the pressing of the ç key, printing only once. The second and third items represent pressing and releasing the ç key, as they lack information about the key press/release, causing duplication on the screen. Thanks to the fix implemented by the Windows Terminal team, these keys are now recognized with the Kitty CSI-u format, along with the correct key press/release information.
@BDisp So, if I understand, the correct fix should be to revert to the pre- #4949/#4977 state?
Probably yes, because with Kitty active I think all inputs will have to be in the Kitty CSI-u format, otherwise this problem may arise again. It would be best to ask a reliable AI to confirm if it's really as I said.
Activity
Fixes tui-cs#4918. Some keys print twice in the terminal on Windows w…
Fixes #4918 - Suppress duplicate keydown for Kitty+legacy printable i…
Remove all changes related with the tui-cs#4918 issue
Fixes tui-cs#4926. Remove IDriver.GetVersionInfo, add IDriver.KittyKe…
BDisp commentedon Apr 11, 2026
The commit e532d61 didn't fixed this issue in the develop branch. I only typed each key once.
tig commentedon Apr 11, 2026
I'm confused. You approved the PR. Did you actually test it?
BDisp commentedon Apr 11, 2026
I'm sorry, but I didn't have access to the machine at the time. From what I saw in the code, it seemed to suppress the second entry, and I thought it worked as expected. Today, I've already managed to test it and confirmed that it didn't fix the problem. I'll take a closer look and try to find a solution.
tig commentedon Apr 11, 2026
I should have tested it too.
I have a new laptop (mac book pro) that I'm using Parallels on. because of that, I have not had a chance to install the POR lang pack. I'll do so now.
Fixes tui-cs#4917. Kitty Keyboard Protocol doesn't works with AltGr a…
BDisp commentedon Apr 11, 2026
I found the cause. Add this line
_pendingPrintableSuppression = key.GetPrintableText ();.BDisp commentedon Apr 11, 2026
Reopening this because the merge perhaps had some reference with this issue causing this closing.
fix(input): scope ANSI key deduplication
YourRobotOverlord commentedon Aug 23, 2026
Reopening because fallback-only deduplication cannot be implemented safely with the current input representation.
ConcurrentQueue<char>carries characters but no physical-key or terminal-source identity. Given two identical adjacent fallback characters, the input pipeline cannot distinguish duplicate terminal output from two intentional keypresses. Suppressing one therefore makes valid input lossy, as #5616 demonstrated.#5643 removes that raw/raw heuristic. It retains deduplication only when parser provenance identifies a kitty key event and the identical legacy fallback is the next logical key in the raw stream; timing and main-loop queue drains do not affect the result.
A future fix for this issue needs terminal/source-level provenance before or alongside the queued characters (or equivalent physical-event identity). Timing windows, processing-batch boundaries, keyboard-layout/glyph lists, and platform checks cannot resolve the ambiguity reliably.
BDisp commentedon Aug 23, 2026
This issue previously only occurred in Windows Terminal, which has since been fixed. When any of the keys «, », ç, Ç, º, and ª were pressed using a Portuguese (PT) keyboard, the input was not displayed in the Kitty CSI-u format and was therefore not recognized as such, but only as legacy entries without the Kitty CSI-u format, resulting in duplicate printing. Therefore, the unit test should contain an
InjectRawSequence(\x1b[231::59;;231u", "ç", "ç");input to differentiate between entries with the Kitty CSI-u format and other entries without it. The first item is a legitimate Kitty CSI-u format entry representing the pressing of theçkey, printing only once. The second and third items represent pressing and releasing theçkey, as they lack information about the key press/release, causing duplication on the screen. Thanks to the fix implemented by the Windows Terminal team, these keys are now recognized with the Kitty CSI-u format, along with the correct key press/release information.YourRobotOverlord commentedon Aug 23, 2026
@BDisp So, if I understand, the correct fix should be to revert to the pre- #4949/#4977 state?
BDisp commentedon Aug 23, 2026
Probably yes, because with Kitty active I think all inputs will have to be in the Kitty CSI-u format, otherwise this problem may arise again. It would be best to ask a reliable AI to confirm if it's really as I said.
Fixes #5638. Scope ANSI key deduplication (#5644)