@gajae-code/tui 0.12.1 → 0.12.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/package.json +3 -3
- package/src/keys.ts +2 -18
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "@gajae-code/tui",
|
|
4
|
-
"version": "0.12.
|
|
4
|
+
"version": "0.12.4",
|
|
5
5
|
"description": "Terminal User Interface library with differential rendering for efficient text-based applications",
|
|
6
6
|
"homepage": "https://gajae-code.com",
|
|
7
7
|
"author": "Yeachan-Heo and Gajae Code Contributors",
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
"fmt": "biome format --write ."
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@gajae-code/natives": "0.12.
|
|
40
|
-
"@gajae-code/utils": "0.12.
|
|
39
|
+
"@gajae-code/natives": "0.12.4",
|
|
40
|
+
"@gajae-code/utils": "0.12.4",
|
|
41
41
|
"lru-cache": "11.3.6",
|
|
42
42
|
"marked": "18.0.6"
|
|
43
43
|
},
|
package/src/keys.ts
CHANGED
|
@@ -423,7 +423,6 @@ const KITTY_MOD_SUPER = 8;
|
|
|
423
423
|
const KITTY_MOD_NUM_LOCK = 128;
|
|
424
424
|
const KITTY_LOCK_MASK = 64 + 128; // Caps Lock + Num Lock
|
|
425
425
|
const MODIFY_OTHER_KEYS_PATTERN = /^\x1b\[27;(\d+);(\d+)~$/;
|
|
426
|
-
const PSMUX_MODIFIED_ENTER_PATTERN = /^\x1b\[13;(2|6)~$/;
|
|
427
426
|
const KITTY_KEYPAD_OPERATOR_TEXT: Record<number, string> = {
|
|
428
427
|
57410: "/",
|
|
429
428
|
57411: "*",
|
|
@@ -496,21 +495,6 @@ export function parseKittySequence(data: string): ParsedKittySequence | null {
|
|
|
496
495
|
eventType: result.eventType,
|
|
497
496
|
};
|
|
498
497
|
}
|
|
499
|
-
|
|
500
|
-
function parsePsmuxModifiedEnter(data: string): string | undefined {
|
|
501
|
-
const match = data.match(PSMUX_MODIFIED_ENTER_PATTERN);
|
|
502
|
-
if (!match) return undefined;
|
|
503
|
-
return match[1] === "6" ? "shift+ctrl+enter" : "shift+enter";
|
|
504
|
-
}
|
|
505
|
-
|
|
506
|
-
function matchesPsmuxModifiedEnter(data: string, keyId: KeyId): boolean {
|
|
507
|
-
const parsed = parsePsmuxModifiedEnter(data);
|
|
508
|
-
if (!parsed) return false;
|
|
509
|
-
const expected = String(keyId);
|
|
510
|
-
if (parsed === expected) return true;
|
|
511
|
-
return parsed === "shift+ctrl+enter" && expected === "ctrl+shift+enter";
|
|
512
|
-
}
|
|
513
|
-
|
|
514
498
|
function hasControlChars(data: string): boolean {
|
|
515
499
|
return [...data].some(ch => {
|
|
516
500
|
const code = ch.charCodeAt(0);
|
|
@@ -654,7 +638,7 @@ export function decodePrintableKey(data: string): string | undefined {
|
|
|
654
638
|
* @param keyId - Key identifier (e.g., "ctrl+c", "escape", Key.ctrl("c"))
|
|
655
639
|
*/
|
|
656
640
|
export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
657
|
-
return
|
|
641
|
+
return matchesKeyNative(data, keyId, kittyProtocolActive);
|
|
658
642
|
}
|
|
659
643
|
|
|
660
644
|
/**
|
|
@@ -666,5 +650,5 @@ export function matchesKey(data: string, keyId: KeyId): boolean {
|
|
|
666
650
|
* @param data - Raw input data from terminal
|
|
667
651
|
*/
|
|
668
652
|
export function parseKey(data: string): string | undefined {
|
|
669
|
-
return
|
|
653
|
+
return parseKeyNative(data, kittyProtocolActive) ?? undefined;
|
|
670
654
|
}
|