mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-17 15:04:52 +00:00
fix: use configurable expandTools keybinding instead of hardcoded ctrl+o (#717)
- Add expandTools to EditorAction in pi-tui so components can access it
- Update bash-execution, compaction-summary-message, branch-summary-message,
and tool-execution to use getEditorKeybindings().getKeys('expandTools')
- Pass expandTools config to setEditorKeybindings in KeybindingsManager.create()
- Style keybinding with 'dim' color, description with 'muted' (matches startup hints)
This commit is contained in:
parent
30a126f2bd
commit
7f2d2f106e
6 changed files with 70 additions and 17 deletions
|
|
@ -2,7 +2,7 @@
|
|||
* Component for displaying bash command execution with streaming output.
|
||||
*/
|
||||
|
||||
import { Container, Loader, Spacer, Text, type TUI } from "@mariozechner/pi-tui";
|
||||
import { Container, getEditorKeybindings, Loader, Spacer, Text, type TUI } from "@mariozechner/pi-tui";
|
||||
import stripAnsi from "strip-ansi";
|
||||
import {
|
||||
DEFAULT_MAX_BYTES,
|
||||
|
|
@ -166,10 +166,15 @@ export class BashExecutionComponent extends Container {
|
|||
|
||||
// Show how many lines are hidden (collapsed preview)
|
||||
if (hiddenLineCount > 0) {
|
||||
const expandKey = getEditorKeybindings().getKeys("expandTools")[0]!;
|
||||
if (this.expanded) {
|
||||
statusParts.push(theme.fg("dim", "(ctrl+o to collapse)"));
|
||||
statusParts.push(`(${theme.fg("dim", expandKey)}${theme.fg("muted", " to collapse")})`);
|
||||
} else {
|
||||
statusParts.push(theme.fg("dim", `... ${hiddenLineCount} more lines (ctrl+o to expand)`));
|
||||
statusParts.push(
|
||||
theme.fg("muted", `... ${hiddenLineCount} more lines (`) +
|
||||
theme.fg("dim", expandKey) +
|
||||
theme.fg("muted", " to expand)"),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue