mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 17:00:59 +00:00
feat(hooks): expose setTitle to HookUIContext (#446)
This commit is contained in:
parent
affa618b43
commit
5cb7af1ddc
9 changed files with 34 additions and 1 deletions
|
|
@ -437,6 +437,9 @@ ctx.ui.setWidget("my-todos", [
|
|||
]);
|
||||
ctx.ui.setWidget("my-todos", undefined); // Clear widget
|
||||
|
||||
// Set the terminal window/tab title
|
||||
ctx.ui.setTitle("pi - my-project");
|
||||
|
||||
// Set the core input editor text (pre-fill prompts, generated content)
|
||||
ctx.ui.setEditorText("Generated prompt text here...");
|
||||
|
||||
|
|
@ -457,6 +460,10 @@ const currentText = ctx.ui.getEditorText();
|
|||
- Supports ANSI styling via `ctx.ui.theme` (including `strikethrough`)
|
||||
- **Caution:** Keep widgets small (a few lines). Large widgets from multiple hooks can cause viewport overflow and TUI flicker. Max 10 lines total across all string widgets.
|
||||
|
||||
**Terminal title notes:**
|
||||
- Uses OSC escape sequence (works in most modern terminals like iTerm2, Terminal.app, Windows Terminal)
|
||||
- Useful for showing project name, current task, or session status in the terminal tab/window title
|
||||
|
||||
**Custom widget components:**
|
||||
|
||||
For more complex widgets, pass a factory function to `setWidget()`:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue