fix(coding-agent): make terminal progress escape sequences configurable, disabled by default

Adds terminal.showTerminalProgress setting (default false) and wires it
to /settings. Guards all OSC 9;4 setProgress calls in interactive-mode.

closes #3588
This commit is contained in:
Mario Zechner
2026-04-23 12:27:51 +02:00
parent 010e9acfe9
commit 8cc046f86e
4 changed files with 52 additions and 5 deletions

View File

@@ -2594,7 +2594,9 @@ export class InteractiveMode {
switch (event.type) {
case "agent_start":
this.ui.terminal.setProgress(true);
if (this.settingsManager.getShowTerminalProgress()) {
this.ui.terminal.setProgress(true);
}
// Restore main escape handler if retry handler is still active
// (retry success event fires later, but we need main handler now)
if (this.retryEscapeHandler) {
@@ -2769,7 +2771,9 @@ export class InteractiveMode {
}
case "agent_end":
this.ui.terminal.setProgress(false);
if (this.settingsManager.getShowTerminalProgress()) {
this.ui.terminal.setProgress(false);
}
if (this.loadingAnimation) {
this.loadingAnimation.stop();
this.loadingAnimation = undefined;
@@ -2788,7 +2792,9 @@ export class InteractiveMode {
break;
case "compaction_start": {
this.ui.terminal.setProgress(true);
if (this.settingsManager.getShowTerminalProgress()) {
this.ui.terminal.setProgress(true);
}
// Keep editor active; submissions are queued during compaction.
this.autoCompactionEscapeHandler = this.defaultEditor.onEscape;
this.defaultEditor.onEscape = () => {
@@ -2812,7 +2818,9 @@ export class InteractiveMode {
}
case "compaction_end": {
this.ui.terminal.setProgress(false);
if (this.settingsManager.getShowTerminalProgress()) {
this.ui.terminal.setProgress(false);
}
if (this.autoCompactionEscapeHandler) {
this.defaultEditor.onEscape = this.autoCompactionEscapeHandler;
this.autoCompactionEscapeHandler = undefined;
@@ -3711,6 +3719,7 @@ export class InteractiveMode {
autocompleteMaxVisible: this.settingsManager.getAutocompleteMaxVisible(),
quietStartup: this.settingsManager.getQuietStartup(),
clearOnShrink: this.settingsManager.getClearOnShrink(),
showTerminalProgress: this.settingsManager.getShowTerminalProgress(),
},
{
onAutoCompactChange: (enabled) => {
@@ -3821,6 +3830,9 @@ export class InteractiveMode {
this.settingsManager.setClearOnShrink(enabled);
this.ui.setClearOnShrink(enabled);
},
onShowTerminalProgressChange: (enabled) => {
this.settingsManager.setShowTerminalProgress(enabled);
},
onCancel: () => {
done();
this.ui.requestRender();
@@ -5329,7 +5341,9 @@ export class InteractiveMode {
stop(): void {
this.unregisterSignalHandlers();
this.ui.terminal.setProgress(false);
if (this.settingsManager.getShowTerminalProgress()) {
this.ui.terminal.setProgress(false);
}
if (this.loadingAnimation) {
this.loadingAnimation.stop();
this.loadingAnimation = undefined;