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:
@@ -86,6 +86,11 @@ export class VirtualTerminal implements Terminal {
|
||||
this.xterm.write("\x1b[2J\x1b[H"); // Clear screen and move to home (1,1)
|
||||
}
|
||||
|
||||
setTitle(title: string): void {
|
||||
// OSC 0;title BEL - set terminal window title
|
||||
this.xterm.write(`\x1b]0;${title}\x07`);
|
||||
}
|
||||
|
||||
// Test-specific methods not in Terminal interface
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user