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:
@@ -1,4 +1,4 @@
|
||||
import { Keys } from "../keys.js";
|
||||
import { isCtrlC } from "../keys.js";
|
||||
import type { Component } from "../tui.js";
|
||||
import { truncateToWidth } from "../utils.js";
|
||||
|
||||
@@ -162,8 +162,8 @@ export class SelectList implements Component {
|
||||
this.onSelect(selectedItem);
|
||||
}
|
||||
}
|
||||
// Escape or Ctrl+C (raw byte or Kitty keyboard protocol)
|
||||
else if (keyData === "\x1b" || keyData === "\x03" || keyData === Keys.CTRL_C) {
|
||||
// Escape or Ctrl+C
|
||||
else if (keyData === "\x1b" || isCtrlC(keyData)) {
|
||||
if (this.onCancel) {
|
||||
this.onCancel();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user