feat(hooks): expose setTitle to HookUIContext (#446)

This commit is contained in:
Aliou Diallo 2026-01-04 20:55:52 +01:00 committed by GitHub
parent affa618b43
commit 5cb7af1ddc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 34 additions and 1 deletions

View file

@ -93,6 +93,7 @@ function createNoOpUIContext(): HookUIContext {
notify: () => {},
setStatus: () => {},
setWidget: () => {},
setTitle: () => {},
custom: async () => undefined as never,
setEditorText: () => {},
getEditorText: () => "",

View file

@ -59,6 +59,7 @@ const noOpUIContext: HookUIContext = {
notify: () => {},
setStatus: () => {},
setWidget: () => {},
setTitle: () => {},
custom: async () => undefined as never,
setEditorText: () => {},
getEditorText: () => "",

View file

@ -120,6 +120,13 @@ export interface HookUIContext {
*/
setWidget(key: string, content: ((tui: TUI, theme: Theme) => Component & { dispose?(): void }) | undefined): void;
/**
* Set the terminal window/tab title.
* Uses OSC escape sequence (works in most modern terminals).
* @param title - Title text to display
*/
setTitle(title: string): void;
/**
* Show a custom component with keyboard focus.
* The factory receives TUI, theme, and a done() callback to close the component.