mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-18 06:04:05 +00:00
Add helper functions for key detection and update usage
- Add isCtrlA/C/E/K/O/P/T/U/W helper functions that check both raw and Kitty formats - Add isAltBackspace helper function - Refactor editor.ts, input.ts, select-list.ts to use helper functions - Refactor custom-editor.ts, session-selector.ts, user-message-selector.ts - Add CHANGELOG entry for the Shift+Enter fix
This commit is contained in:
parent
4a4531f887
commit
c3c2bffc68
9 changed files with 146 additions and 50 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import { type Component, Container, Keys, Spacer, Text, truncateToWidth } from "@mariozechner/pi-tui";
|
||||
import { type Component, Container, isCtrlC, Spacer, Text, truncateToWidth } from "@mariozechner/pi-tui";
|
||||
import { theme } from "../theme/theme.js";
|
||||
import { DynamicBorder } from "./dynamic-border.js";
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ class UserMessageList implements Component {
|
|||
this.onCancel();
|
||||
}
|
||||
}
|
||||
// Ctrl+C - cancel (raw byte or Kitty keyboard protocol)
|
||||
else if (keyData === "\x03" || keyData === Keys.CTRL_C) {
|
||||
// Ctrl+C - cancel
|
||||
else if (isCtrlC(keyData)) {
|
||||
if (this.onCancel) {
|
||||
this.onCancel();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue