This commit is contained in:
meganrogge 2021-09-14 13:35:06 -07:00
parent fc69d434fb
commit 6ffb841ede
No known key found for this signature in database
GPG key ID: 3155C8B2F0428C81
2 changed files with 7 additions and 5 deletions

View file

@ -166,6 +166,8 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
private _capabilities: ProcessCapability[] = [];
private _workspaceFolder: string = '';
readonly statusList: ITerminalStatusList;
disableLayout: boolean = false;
private _description: string | undefined = undefined;
@ -655,7 +657,6 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
this._onCursorMove();
return false;
});
this._capabilities = processTraits.capabilities;
}
this._linkManager = this._instantiationService.createInstance(TerminalLinkManager, xterm, this._processManager!);
this._areLinksReady = true;
@ -856,6 +857,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
this._processManager.onProcessReady((e) => {
this._linkManager?.setWidgetManager(this._widgetManager);
this._capabilities = e.capabilities;
this._workspaceFolder = path.basename(e.cwd.toString());
});
// const computedStyle = window.getComputedStyle(this._container);
@ -1802,7 +1804,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
const properties = {
cwd,
cwdFolder: this.getCwdFolder(),
workspaceFolder: path.basename(cwd),
workspaceFolder: this._workspaceFolder,
local: this.shellLaunchConfig.description === 'Local' ? 'Local' : undefined,
process: this._processName,
sequence: this._sequence,
@ -1832,7 +1834,7 @@ export class TerminalInstance extends Disposable implements ITerminalInstance {
if (!cwd ||
!this._capabilities.includes(ProcessCapability.CwdDetection) ||
this._workspaceContextService.getWorkspace().folders.length === 0 ||
(this._equalIgnoringSlashes(this._configHelper.config.cwd || this._workspaceContextService.getWorkspace().folders[0].uri.toString(), cwd))) {
(this._workspaceContextService.getWorkspace().folders.length === 1 && this._equalIgnoringSlashes(this._configHelper.config.cwd || this._workspaceContextService.getWorkspace().folders[0].uri.toString(), cwd))) {
return '';
}
return path.basename(cwd);

View file

@ -12,8 +12,8 @@ import { Registry } from 'vs/platform/registry/common/platform';
const terminalDescriptors = '\n- ' + [
localize('cwd', "`\${cwd}`: the terminal's current working directory"),
localize('cwdFolder', "`\${cwdFolder}`: the terminal's current working directory, displayed when the value differs from the initialCwd on linux or mac. For Windows, see `workspaceFolder`"),
localize('workspaceFolder', "`\${workspaceFolder}`: the workpsace folder to which the terminal belongs"),
localize('cwdFolder', "`\${cwdFolder}`: the terminal's current working directory, displayed for multi-root workspaces or in a single root workspace when the value differs from the initial working directory. This will not be displayed for Windows."),
localize('workspaceFolder', "`\${workspaceFolder}`: the workpsace in which the terminal was launched"),
localize('local', "`\${local}`: indicates a local terminal in a remote workspace"),
localize('process', "`\${process}`: the name of the terminal process"),
localize('separator', "`\${separator}`: a conditional separator (\" - \") that only shows when surrounded by variables with values or static text."),