feat(tui,coding-agent): add OSC 9;4 terminal progress indicators
Emit OSC 9;4 progress start/end sequences during agent streaming and compaction so terminals (iTerm2, WezTerm, Windows Terminal, Kitty, etc.) show activity in their tab bar. Made with love for @lucasmeijer
This commit is contained in:
@@ -48,6 +48,9 @@ export interface Terminal {
|
||||
|
||||
// Title operations
|
||||
setTitle(title: string): void; // Set terminal window title
|
||||
|
||||
// Progress indicator (OSC 9;4)
|
||||
setProgress(active: boolean): void;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -357,4 +360,14 @@ export class ProcessTerminal implements Terminal {
|
||||
// OSC 0;title BEL - set terminal window title
|
||||
process.stdout.write(`\x1b]0;${title}\x07`);
|
||||
}
|
||||
|
||||
setProgress(active: boolean): void {
|
||||
if (active) {
|
||||
// OSC 9;4;1;0 - indeterminate progress
|
||||
process.stdout.write("\x1b]9;4;1;0\x07");
|
||||
} else {
|
||||
// OSC 9;4;0 - clear progress
|
||||
process.stdout.write("\x1b]9;4;0;\x07");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user