mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-16 20:01:24 +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
|
|
@ -8,6 +8,7 @@ import {
|
|||
isCtrlK,
|
||||
isCtrlU,
|
||||
isCtrlW,
|
||||
isDelete,
|
||||
isEnter,
|
||||
} from "../keys.js";
|
||||
import type { Component } from "../tui.js";
|
||||
|
|
@ -118,7 +119,7 @@ export class Input implements Component {
|
|||
return;
|
||||
}
|
||||
|
||||
if (data === "\x1b[3~") {
|
||||
if (isDelete(data)) {
|
||||
// Delete - delete grapheme at cursor (handles emojis, etc.)
|
||||
if (this.cursor < this.value.length) {
|
||||
const afterCursor = this.value.slice(this.cursor);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue