(data: string)
| 525 | * Only meaningful when Kitty keyboard protocol with flag 2 is active. |
| 526 | */ |
| 527 | export function isKeyRelease(data: string): boolean { |
| 528 | // Don't treat bracketed paste content as key release, even if it contains |
| 529 | // patterns like ":3F" (e.g., bluetooth MAC addresses like "90:62:3F:A5"). |
| 530 | // Terminal.ts re-wraps paste content with bracketed paste markers before |
| 531 | // passing to TUI, so pasted data will always contain \x1b[200~. |
| 532 | if (data.includes("\x1b[200~")) { |
| 533 | return false; |
| 534 | } |
| 535 | |
| 536 | // Quick check: release events with flag 2 contain ":3" |
| 537 | // Format: \x1b[<codepoint>;<modifier>:3u |
| 538 | if ( |
| 539 | data.includes(":3u") || |
| 540 | data.includes(":3~") || |
| 541 | data.includes(":3A") || |
| 542 | data.includes(":3B") || |
| 543 | data.includes(":3C") || |
| 544 | data.includes(":3D") || |
| 545 | data.includes(":3H") || |
| 546 | data.includes(":3F") |
| 547 | ) { |
| 548 | return true; |
| 549 | } |
| 550 | return false; |
| 551 | } |
| 552 | |
| 553 | /** |
| 554 | * Check if the last parsed key event was a key repeat. |
no outgoing calls
no test coverage detected