fix: fix keybindings (#406)

Co-authored-by: Letta <noreply@letta.com>
This commit is contained in:
Charles Packer
2025-12-28 19:31:01 -08:00
committed by GitHub
parent c576392db0
commit aca3d88800
6 changed files with 259 additions and 12 deletions

View File

@@ -31,6 +31,14 @@ function isControlSequence(input, key) {
// CSI sequences (ESC[...), Option+Delete (ESC + DEL), and other multi-char escape sequences
if (input && typeof input === 'string' && input.startsWith('\x1b') && input.length > 1) return true;
// Forward delete (fn+Delete on macOS): handled by parent's raw input handler
// Check timestamp to avoid double-processing (globalThis.__lettaForwardDeleteTimestamp)
// Only forward delete sets this; regular backspace doesn't, so backspace still works here
if (key.delete && globalThis.__lettaForwardDeleteTimestamp &&
(Date.now() - globalThis.__lettaForwardDeleteTimestamp) < 100) {
return true;
}
return false;
}