mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 03:00:38 +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,13 @@
|
|||
import { type Component, Container, Input, isCtrlC, Spacer, Text, truncateToWidth } from "@mariozechner/pi-tui";
|
||||
import {
|
||||
type Component,
|
||||
Container,
|
||||
Input,
|
||||
isCtrlC,
|
||||
isEscape,
|
||||
Spacer,
|
||||
Text,
|
||||
truncateToWidth,
|
||||
} from "@mariozechner/pi-tui";
|
||||
import type { SessionManager } from "../../../core/session-manager.js";
|
||||
import { fuzzyFilter } from "../../../utils/fuzzy.js";
|
||||
import { theme } from "../theme/theme.js";
|
||||
|
|
@ -139,7 +148,7 @@ class SessionList implements Component {
|
|||
}
|
||||
}
|
||||
// Escape - cancel
|
||||
else if (keyData === "\x1b") {
|
||||
else if (isEscape(keyData)) {
|
||||
if (this.onCancel) {
|
||||
this.onCancel();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue