mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
feat(coding-agent): add Ctrl+G to open external editor
This commit is contained in:
parent
afedf1707a
commit
fe853ed869
2 changed files with 68 additions and 2 deletions
|
|
@ -1,4 +1,14 @@
|
|||
import { Editor, isCtrlC, isCtrlD, isCtrlO, isCtrlP, isCtrlT, isEscape, isShiftTab } from "@mariozechner/pi-tui";
|
||||
import {
|
||||
Editor,
|
||||
isCtrlC,
|
||||
isCtrlD,
|
||||
isCtrlG,
|
||||
isCtrlO,
|
||||
isCtrlP,
|
||||
isCtrlT,
|
||||
isEscape,
|
||||
isShiftTab,
|
||||
} from "@mariozechner/pi-tui";
|
||||
|
||||
/**
|
||||
* Custom editor that handles Escape and Ctrl+C keys for coding-agent
|
||||
|
|
@ -11,8 +21,15 @@ export class CustomEditor extends Editor {
|
|||
public onCtrlP?: () => void;
|
||||
public onCtrlO?: () => void;
|
||||
public onCtrlT?: () => void;
|
||||
public onCtrlG?: () => void;
|
||||
|
||||
handleInput(data: string): void {
|
||||
// Intercept Ctrl+G for external editor
|
||||
if (isCtrlG(data) && this.onCtrlG) {
|
||||
this.onCtrlG();
|
||||
return;
|
||||
}
|
||||
|
||||
// Intercept Ctrl+T for thinking block visibility toggle
|
||||
if (isCtrlT(data) && this.onCtrlT) {
|
||||
this.onCtrlT();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue