[PR #487] [MERGED] fix(keypress): convert to uppercase when shift pressed without shifted codepoint #572

Closed
opened 2026-03-02 23:47:09 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/anomalyco/opentui/pull/487
Author: @Stranmor
Created: 1/7/2026
Status: Merged
Merged: 1/11/2026
Merged by: @kommander

Base: mainHead: fix/shift-uppercase-kitty


📝 Commits (5)

  • a490d41 fix(keypress): convert to uppercase when shift pressed without shifted codepoint
  • 1a02e17 test: update expectations for shift+key sequences to uppercase
  • 6bc7f3c Merge branch 'main' into fix/shift-uppercase-kitty
  • 345b6c6 Merge branch 'main' into fix/shift-uppercase-kitty
  • 9bcacb4 prettier

📊 Changes

3 files changed (+25 additions, -3 deletions)

View changed files

📝 packages/core/src/lib/parse.keypress-kitty.test.ts (+18 -0)
📝 packages/core/src/lib/parse.keypress-kitty.ts (+4 -0)
📝 packages/core/src/tests/renderer.input.test.ts (+3 -3)

📄 Description

Summary

When terminals send Kitty keyboard protocol sequences with shift modifier but without the shifted codepoint (e.g., \x1b[97;2u instead of \x1b[97:65;2u), the parser now correctly converts the character to uppercase.

Problem

Some terminals (like WezTerm) may send Kitty keyboard sequences with the shift modifier set but without providing the shifted codepoint in the CSI u sequence. In these cases, pressing Shift+a would result in lowercase 'a' being inserted instead of uppercase 'A'.

This affects both Latin and Unicode characters (including Cyrillic).

Solution

When key.shift is true but no shiftedCodepoint is provided, use toLocaleUpperCase() to convert the character. This works correctly for all Unicode scripts including Cyrillic.

Changes

  • Modified parse.keypress-kitty.ts to handle shift+letter without shifted codepoint
  • Added unit tests for both Latin and Cyrillic characters

Testing

  • Tested with WezTerm terminal
  • All existing tests pass
  • New tests added for this scenario

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/anomalyco/opentui/pull/487 **Author:** [@Stranmor](https://github.com/Stranmor) **Created:** 1/7/2026 **Status:** ✅ Merged **Merged:** 1/11/2026 **Merged by:** [@kommander](https://github.com/kommander) **Base:** `main` ← **Head:** `fix/shift-uppercase-kitty` --- ### 📝 Commits (5) - [`a490d41`](https://github.com/anomalyco/opentui/commit/a490d41c440ed30f391af4bda2032550b13a3a47) fix(keypress): convert to uppercase when shift pressed without shifted codepoint - [`1a02e17`](https://github.com/anomalyco/opentui/commit/1a02e1708b1daf836b5e0750b4ce69f4c66f7da4) test: update expectations for shift+key sequences to uppercase - [`6bc7f3c`](https://github.com/anomalyco/opentui/commit/6bc7f3cb1c62df887353e7d88ed57551a834f547) Merge branch 'main' into fix/shift-uppercase-kitty - [`345b6c6`](https://github.com/anomalyco/opentui/commit/345b6c680c93b68aac454873ddf12d7ee74c1c99) Merge branch 'main' into fix/shift-uppercase-kitty - [`9bcacb4`](https://github.com/anomalyco/opentui/commit/9bcacb4f65318d283a7dc366b868e39dd33bfcbd) prettier ### 📊 Changes **3 files changed** (+25 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/core/src/lib/parse.keypress-kitty.test.ts` (+18 -0) 📝 `packages/core/src/lib/parse.keypress-kitty.ts` (+4 -0) 📝 `packages/core/src/tests/renderer.input.test.ts` (+3 -3) </details> ### 📄 Description ## Summary When terminals send Kitty keyboard protocol sequences with shift modifier but without the shifted codepoint (e.g., `\x1b[97;2u` instead of `\x1b[97:65;2u`), the parser now correctly converts the character to uppercase. ## Problem Some terminals (like WezTerm) may send Kitty keyboard sequences with the shift modifier set but without providing the shifted codepoint in the CSI u sequence. In these cases, pressing Shift+a would result in lowercase 'a' being inserted instead of uppercase 'A'. This affects both Latin and Unicode characters (including Cyrillic). ## Solution When `key.shift` is true but no `shiftedCodepoint` is provided, use `toLocaleUpperCase()` to convert the character. This works correctly for all Unicode scripts including Cyrillic. ## Changes - Modified `parse.keypress-kitty.ts` to handle shift+letter without shifted codepoint - Added unit tests for both Latin and Cyrillic characters ## Testing - Tested with WezTerm terminal - All existing tests pass - New tests added for this scenario --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-02 23:47:09 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#572
No description provided.