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:
Mario Zechner 2025-12-19 02:09:51 +01:00
parent 314ef34ebc
commit f8b6164ecd
11 changed files with 38 additions and 18 deletions

View file

@ -1,4 +1,4 @@
import { Container, Spacer, TruncatedText } from "@mariozechner/pi-tui";
import { Container, isEscape, Spacer, TruncatedText } from "@mariozechner/pi-tui";
import { getOAuthProviders, type OAuthProviderInfo } from "../../../core/oauth/index.js";
import { loadOAuthCredentials } from "../../../core/oauth/storage.js";
import { theme } from "../theme/theme.js";
@ -107,7 +107,7 @@ export class OAuthSelectorComponent extends Container {
}
}
// Escape
else if (keyData === "\x1b") {
else if (isEscape(keyData)) {
this.onCancelCallback();
}
}