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:
Mario Zechner
2026-04-22 11:54:46 +02:00
parent df84e3d22f
commit a900d25119
6 changed files with 62 additions and 28 deletions

View File

@@ -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");
}
}
}