Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/vs/workbench/contrib/terminal/browser/media/terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,18 @@
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;
white-space: nowrap;
}

.monaco-action-bar .action-item .single-terminal-tab .codicon:first-child {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2717,7 +2717,7 @@ export class TerminalLabelComputer extends Disposable {
super();
}

refreshLabel(instance: Pick<ITerminalInstance, 'shellLaunchConfig' | 'shellType' | 'cwd' | 'fixedCols' | 'fixedRows' | 'initialCwd' | 'processName' | 'sequence' | 'userHome' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description'>, reset?: boolean): void {
refreshLabel(instance: Pick<ITerminalInstance, 'shellLaunchConfig' | 'shellType' | 'cwd' | 'fixedCols' | 'fixedRows' | 'initialCwd' | 'processName' | 'sequence' | 'userHome' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description' | 'progressState'>, 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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ suite('Workbench - TerminalInstance', () => {
let instantiationService: TestInstantiationService;
let capabilities: TerminalCapabilityStore;

function createInstance(partial?: Partial<ITerminalInstance>): Pick<ITerminalInstance, 'shellLaunchConfig' | 'shellType' | 'userHome' | 'cwd' | 'initialCwd' | 'processName' | 'sequence' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description'> {
function createInstance(partial?: Partial<ITerminalInstance>): Pick<ITerminalInstance, 'shellLaunchConfig' | 'shellType' | 'userHome' | 'cwd' | 'initialCwd' | 'processName' | 'sequence' | 'workspaceFolder' | 'staticTitle' | 'capabilities' | 'title' | 'description' | 'progressState'> {
const capabilities = store.add(new TerminalCapabilityStore());
if (!isWindows) {
capabilities.add(TerminalCapability.NaiveCwdDetection, null!);
Expand All @@ -416,6 +416,7 @@ suite('Workbench - TerminalInstance', () => {
title: '',
description: '',
userHome: undefined,
progressState: undefined,
...partial
};
}
Expand Down Expand Up @@ -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', () => {
Expand Down