mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 22:03:45 +00:00
fix(tui): add isHome, isEnd, isDelete helpers for Kitty protocol
Extended the Kitty protocol parser to handle functional keys with ~ terminator (Delete, Insert, PageUp, PageDown) and Home/End keys. Updated editor.ts and input.ts to use the new helpers.
This commit is contained in:
parent
716516d61e
commit
cbd20b58a6
4 changed files with 84 additions and 7 deletions
|
|
@ -16,8 +16,11 @@ import {
|
|||
isCtrlRight,
|
||||
isCtrlU,
|
||||
isCtrlW,
|
||||
isDelete,
|
||||
isEnd,
|
||||
isEnter,
|
||||
isEscape,
|
||||
isHome,
|
||||
isShiftEnter,
|
||||
isTab,
|
||||
} from "../keys.js";
|
||||
|
|
@ -459,16 +462,13 @@ export class Editor implements Component {
|
|||
this.handleBackspace();
|
||||
}
|
||||
// Line navigation shortcuts (Home/End keys)
|
||||
else if (data === "\x1b[H" || data === "\x1b[1~" || data === "\x1b[7~") {
|
||||
// Home key
|
||||
else if (isHome(data)) {
|
||||
this.moveToLineStart();
|
||||
} else if (data === "\x1b[F" || data === "\x1b[4~" || data === "\x1b[8~") {
|
||||
// End key
|
||||
} else if (isEnd(data)) {
|
||||
this.moveToLineEnd();
|
||||
}
|
||||
// Forward delete (Fn+Backspace or Delete key)
|
||||
else if (data === "\x1b[3~") {
|
||||
// Delete key
|
||||
else if (isDelete(data)) {
|
||||
this.handleForwardDelete();
|
||||
}
|
||||
// Word navigation (Option/Alt + Arrow or Ctrl + Arrow)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue