mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
fix #133103
This commit is contained in:
parent
fc69d434fb
commit
6ffb841ede
|
@ -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);
|
||||
|
|
|
@ -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."),
|
||||
|
|
Loading…
Reference in a new issue