mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-22 06:00:26 +00:00
test(tui): cover non-qwerty kitty base layout fallback
This commit is contained in:
parent
5bb3700717
commit
c27168840c
3 changed files with 39 additions and 0 deletions
|
|
@ -12,6 +12,7 @@
|
||||||
|
|
||||||
- Fixed `switchSession()` appending spurious `thinking_level_change` entry to session log on resume. `setThinkingLevel()` is now idempotent. ([#1118](https://github.com/badlogic/pi-mono/issues/1118))
|
- Fixed `switchSession()` appending spurious `thinking_level_change` entry to session log on resume. `setThinkingLevel()` is now idempotent. ([#1118](https://github.com/badlogic/pi-mono/issues/1118))
|
||||||
- Fixed clipboard image paste on WSL2/WSLg writing invalid PNG files when clipboard provides `image/bmp` format. BMP images are now converted to PNG before saving. ([#1112](https://github.com/badlogic/pi-mono/pull/1112) by [@lightningRalf](https://github.com/lightningRalf))
|
- Fixed clipboard image paste on WSL2/WSLg writing invalid PNG files when clipboard provides `image/bmp` format. BMP images are now converted to PNG before saving. ([#1112](https://github.com/badlogic/pi-mono/pull/1112) by [@lightningRalf](https://github.com/lightningRalf))
|
||||||
|
- Fixed Kitty keyboard protocol base layout fallback so non-QWERTY layouts do not trigger wrong shortcuts ([#1096](https://github.com/badlogic/pi-mono/pull/1096) by [@rytswd](https://github.com/rytswd))
|
||||||
|
|
||||||
## [0.50.7] - 2026-01-31
|
## [0.50.7] - 2026-01-31
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,10 @@
|
||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
|
||||||
|
- Fixed Kitty keyboard protocol base layout fallback so non-QWERTY layouts do not trigger wrong shortcuts ([#1096](https://github.com/badlogic/pi-mono/pull/1096) by [@rytswd](https://github.com/rytswd))
|
||||||
|
|
||||||
## [0.50.7] - 2026-01-31
|
## [0.50.7] - 2026-01-31
|
||||||
|
|
||||||
## [0.50.6] - 2026-01-30
|
## [0.50.6] - 2026-01-30
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,24 @@ describe("matchesKey", () => {
|
||||||
setKittyProtocolActive(false);
|
setKittyProtocolActive(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should prefer codepoint for Latin letters even when base layout differs", () => {
|
||||||
|
setKittyProtocolActive(true);
|
||||||
|
// Dvorak Ctrl+K reports codepoint 'k' (107) and base layout 'v' (118)
|
||||||
|
const dvorakCtrlK = "\x1b[107::118;5u";
|
||||||
|
assert.strictEqual(matchesKey(dvorakCtrlK, "ctrl+k"), true);
|
||||||
|
assert.strictEqual(matchesKey(dvorakCtrlK, "ctrl+v"), false);
|
||||||
|
setKittyProtocolActive(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should prefer codepoint for symbol keys even when base layout differs", () => {
|
||||||
|
setKittyProtocolActive(true);
|
||||||
|
// Dvorak Ctrl+/ reports codepoint '/' (47) and base layout '[' (91)
|
||||||
|
const dvorakCtrlSlash = "\x1b[47::91;5u";
|
||||||
|
assert.strictEqual(matchesKey(dvorakCtrlSlash, "ctrl+/"), true);
|
||||||
|
assert.strictEqual(matchesKey(dvorakCtrlSlash, "ctrl+["), false);
|
||||||
|
setKittyProtocolActive(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("should not match wrong key even with base layout", () => {
|
it("should not match wrong key even with base layout", () => {
|
||||||
setKittyProtocolActive(true);
|
setKittyProtocolActive(true);
|
||||||
// Cyrillic ctrl+с with base 'c' should NOT match ctrl+d
|
// Cyrillic ctrl+с with base 'c' should NOT match ctrl+d
|
||||||
|
|
@ -254,6 +272,22 @@ describe("parseKey", () => {
|
||||||
setKittyProtocolActive(false);
|
setKittyProtocolActive(false);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it("should prefer codepoint for Latin letters when base layout differs", () => {
|
||||||
|
setKittyProtocolActive(true);
|
||||||
|
// Dvorak Ctrl+K reports codepoint 'k' (107) and base layout 'v' (118)
|
||||||
|
const dvorakCtrlK = "\x1b[107::118;5u";
|
||||||
|
assert.strictEqual(parseKey(dvorakCtrlK), "ctrl+k");
|
||||||
|
setKittyProtocolActive(false);
|
||||||
|
});
|
||||||
|
|
||||||
|
it("should prefer codepoint for symbol keys when base layout differs", () => {
|
||||||
|
setKittyProtocolActive(true);
|
||||||
|
// Dvorak Ctrl+/ reports codepoint '/' (47) and base layout '[' (91)
|
||||||
|
const dvorakCtrlSlash = "\x1b[47::91;5u";
|
||||||
|
assert.strictEqual(parseKey(dvorakCtrlSlash), "ctrl+/");
|
||||||
|
setKittyProtocolActive(false);
|
||||||
|
});
|
||||||
|
|
||||||
it("should return key name from codepoint when no base layout", () => {
|
it("should return key name from codepoint when no base layout", () => {
|
||||||
setKittyProtocolActive(true);
|
setKittyProtocolActive(true);
|
||||||
const latinCtrlC = "\x1b[99;5u";
|
const latinCtrlC = "\x1b[99;5u";
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue