mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 13:02:15 +00:00
Fix Escape key handling for Kitty keyboard protocol
Add isEscape() helper that handles both raw (\x1b) and Kitty protocol (\x1b[27u) Escape sequences. Update all components that check for Escape key to use the new helper.
This commit is contained in:
parent
314ef34ebc
commit
f8b6164ecd
11 changed files with 38 additions and 18 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { isCtrlC } from "../keys.js";
|
||||
import { isCtrlC, isEscape } from "../keys.js";
|
||||
import type { Component } from "../tui.js";
|
||||
import { truncateToWidth } from "../utils.js";
|
||||
|
||||
|
|
@ -163,7 +163,7 @@ export class SelectList implements Component {
|
|||
}
|
||||
}
|
||||
// Escape or Ctrl+C
|
||||
else if (keyData === "\x1b" || isCtrlC(keyData)) {
|
||||
else if (isEscape(keyData) || isCtrlC(keyData)) {
|
||||
if (this.onCancel) {
|
||||
this.onCancel();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue