Add terminal title support to TUI framework (#407)
Add setTitle() method to Terminal interface for setting window title. Uses standard OSC escape sequence \x1b]0;...\x07 for broad terminal compatibility (macOS Terminal, iTerm2, Kitty, WezTerm, Ghostty, etc.). Changes: - Add setTitle(title: string) to Terminal interface - Implement in ProcessTerminal using OSC sequence - Implement no-op in VirtualTerminal for testing - Use in interactive mode to set title as "pi - <dirname>"
This commit is contained in:
@@ -303,6 +303,10 @@ export class InteractiveMode {
|
||||
this.ui.start();
|
||||
this.isInitialized = true;
|
||||
|
||||
// Set terminal title
|
||||
const cwdBasename = path.basename(process.cwd());
|
||||
this.ui.terminal.setTitle(`pi - ${cwdBasename}`);
|
||||
|
||||
// Initialize hooks with TUI-based UI context
|
||||
await this.initHooksAndCustomTools();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user