From 8151fa5d569384be896235d78336482099151512 Mon Sep 17 00:00:00 2001 From: Arnav Nagzirkar <113314200+arnavnagzirkar@users.noreply.github.com> Date: Sun, 31 May 2026 21:07:30 -0700 Subject: [PATCH 1/2] fix: terminal progress display overflow Fixes microsoft/vscode#312970 --- .../workbench/contrib/terminal/browser/media/terminal.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/vs/workbench/contrib/terminal/browser/media/terminal.css b/src/vs/workbench/contrib/terminal/browser/media/terminal.css index 9370b48b871f6..3497531115364 100644 --- a/src/vs/workbench/contrib/terminal/browser/media/terminal.css +++ b/src/vs/workbench/contrib/terminal/browser/media/terminal.css @@ -474,9 +474,17 @@ display: block; } +.monaco-action-bar .action-item:has(> .single-terminal-tab) { + flex: 1; + min-width: 0; + overflow: hidden; +} + .monaco-action-bar .action-item .single-terminal-tab { display: flex !important; align-items: center; + overflow: hidden; + min-width: 0; } .monaco-action-bar .action-item .single-terminal-tab .codicon:first-child { From 093a9a9cfcb0aa96854c6ba4d3d96336eeed5b0f Mon Sep 17 00:00:00 2001 From: Arnav Nagzirkar <113314200+arnavnagzirkar@users.noreply.github.com> Date: Wed, 17 Jun 2026 11:11:30 -0700 Subject: [PATCH 2/2] fix: terminal progress display overflow Fixes microsoft/vscode#312970 --- .../terminal/browser/media/terminal.css | 1 + .../terminal/browser/terminalInstance.ts | 2 +- .../test/browser/terminalInstance.test.ts | 33 ++++++++++++++++++- 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/src/vs/workbench/contrib/terminal/browser/media/terminal.css b/src/vs/workbench/contrib/terminal/browser/media/terminal.css index 3497531115364..d06a2144d63f3 100644 --- a/src/vs/workbench/contrib/terminal/browser/media/terminal.css +++ b/src/vs/workbench/contrib/terminal/browser/media/terminal.css @@ -485,6 +485,7 @@ align-items: center; overflow: hidden; min-width: 0; + white-space: nowrap; } .monaco-action-bar .action-item .single-terminal-tab .codicon:first-child { diff --git a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts index 419fcddfbb85a..a8b276c11ce12 100644 --- a/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts +++ b/src/vs/workbench/contrib/terminal/browser/terminalInstance.ts @@ -2717,7 +2717,7 @@ export class TerminalLabelComputer extends Disposable { super(); } - refreshLabel(instance: Pick, reset?: boolean): void { + refreshLabel(instance: Pick, reset?: boolean): void { const tabs = this._terminalConfigurationService.config.tabs; const useAgentCliTitle = tabs.allowAgentCliTitle && TerminalLabelComputer.agentCliShellTypes.has(instance.shellType as GeneralShellType); const titleTemplate = instance.shellLaunchConfig.titleTemplate ?? (useAgentCliTitle ? '${sequence}' : tabs.title); diff --git a/src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts b/src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts index 6797f7d6c464c..c03c5cfbd9277 100644 --- a/src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts +++ b/src/vs/workbench/contrib/terminal/test/browser/terminalInstance.test.ts @@ -398,7 +398,7 @@ suite('Workbench - TerminalInstance', () => { let instantiationService: TestInstantiationService; let capabilities: TerminalCapabilityStore; - function createInstance(partial?: Partial): Pick { + function createInstance(partial?: Partial): Pick { const capabilities = store.add(new TerminalCapabilityStore()); if (!isWindows) { capabilities.add(TerminalCapability.NaiveCwdDetection, null!); @@ -416,6 +416,7 @@ suite('Workbench - TerminalInstance', () => { title: '', description: '', userHome: undefined, + progressState: undefined, ...partial }; } @@ -553,6 +554,36 @@ suite('Workbench - TerminalInstance', () => { strictEqual(terminalLabelComputer.description, 'root2'); } }); + test('should resolve progress state 0 (no progress) as empty string', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: { state: 0, value: 0 } })); + strictEqual(terminalLabelComputer.title, 'bash'); + }); + test('should resolve progress state 1 (normal) as percentage', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: { state: 1, value: 75 } })); + strictEqual(terminalLabelComputer.title, 'bash - 75%'); + }); + test('should resolve progress state 2 (error) as error icon', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: { state: 2, value: 0 } })); + strictEqual(terminalLabelComputer.title, 'bash - $(error)'); + }); + test('should resolve progress state 3 (indeterminate) as loading icon', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: { state: 3, value: 0 } })); + strictEqual(terminalLabelComputer.title, 'bash - $(loading~spin)'); + }); + test('should resolve progress state 4 (warning) as alert icon', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: { state: 4, value: 0 } })); + strictEqual(terminalLabelComputer.title, 'bash - $(alert)'); + }); + test('should resolve progress as empty when progressState is undefined', () => { + const terminalLabelComputer = createLabelComputer({ terminal: { integrated: { tabs: { separator: ' - ', title: '${process}${separator}${progress}', description: '' } } } }); + terminalLabelComputer.refreshLabel(createInstance({ capabilities, processName: 'bash', progressState: undefined })); + strictEqual(terminalLabelComputer.title, 'bash'); + }); }); suite('getCwdResource', () => {