mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 23:35:54 +01:00
Include remote debug extension host env in remote terminal shell env (#299007)
* Include remote debug extension host env in remote terminal shell env * Update src/vs/workbench/services/environment/browser/environmentService.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update src/vs/workbench/contrib/terminal/common/remote/remoteTerminalChannel.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
@@ -8,6 +8,7 @@ import { URI, UriComponents } from '../../../../../base/common/uri.js';
|
|||||||
import { IChannel } from '../../../../../base/parts/ipc/common/ipc.js';
|
import { IChannel } from '../../../../../base/parts/ipc/common/ipc.js';
|
||||||
import { IWorkbenchConfigurationService } from '../../../../services/configuration/common/configuration.js';
|
import { IWorkbenchConfigurationService } from '../../../../services/configuration/common/configuration.js';
|
||||||
import { IRemoteAuthorityResolverService } from '../../../../../platform/remote/common/remoteAuthorityResolver.js';
|
import { IRemoteAuthorityResolverService } from '../../../../../platform/remote/common/remoteAuthorityResolver.js';
|
||||||
|
import { IWorkbenchEnvironmentService } from '../../../../services/environment/common/environmentService.js';
|
||||||
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js';
|
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js';
|
||||||
import { serializeEnvironmentDescriptionMap, serializeEnvironmentVariableCollection } from '../../../../../platform/terminal/common/environmentVariableShared.js';
|
import { serializeEnvironmentDescriptionMap, serializeEnvironmentVariableCollection } from '../../../../../platform/terminal/common/environmentVariableShared.js';
|
||||||
import { IConfigurationResolverService } from '../../../../services/configurationResolver/common/configurationResolver.js';
|
import { IConfigurationResolverService } from '../../../../services/configurationResolver/common/configurationResolver.js';
|
||||||
@@ -111,6 +112,7 @@ export class RemoteTerminalChannelClient implements IPtyHostController {
|
|||||||
@ITerminalLogService private readonly _logService: ITerminalLogService,
|
@ITerminalLogService private readonly _logService: ITerminalLogService,
|
||||||
@IEditorService private readonly _editorService: IEditorService,
|
@IEditorService private readonly _editorService: IEditorService,
|
||||||
@ILabelService private readonly _labelService: ILabelService,
|
@ILabelService private readonly _labelService: ILabelService,
|
||||||
|
@IWorkbenchEnvironmentService private readonly _environmentService: IWorkbenchEnvironmentService,
|
||||||
) { }
|
) { }
|
||||||
|
|
||||||
restartPtyHost(): Promise<void> {
|
restartPtyHost(): Promise<void> {
|
||||||
@@ -152,7 +154,13 @@ export class RemoteTerminalChannelClient implements IPtyHostController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const resolverResult = await this._remoteAuthorityResolverService.resolveAuthority(this._remoteAuthority);
|
const resolverResult = await this._remoteAuthorityResolverService.resolveAuthority(this._remoteAuthority);
|
||||||
const resolverEnv = resolverResult.options && resolverResult.options.extensionHostEnv;
|
const resolverEnv = {
|
||||||
|
/**
|
||||||
|
* If the extension host was spawned via a launch configuration,
|
||||||
|
* include the environment provided by that launch configuration.
|
||||||
|
*/
|
||||||
|
...(this._environmentService.debugExtensionHost.env ?? {}), ...resolverResult.options?.extensionHostEnv
|
||||||
|
};
|
||||||
|
|
||||||
const workspace = this._workspaceContextService.getWorkspace();
|
const workspace = this._workspaceContextService.getWorkspace();
|
||||||
const workspaceFolders = workspace.folders;
|
const workspaceFolders = workspace.folders;
|
||||||
|
|||||||
@@ -322,6 +322,13 @@ export class BrowserWorkbenchEnvironmentService implements IBrowserWorkbenchEnvi
|
|||||||
case 'inspect-extensions':
|
case 'inspect-extensions':
|
||||||
extensionHostDebugEnvironment.params.port = parseInt(value);
|
extensionHostDebugEnvironment.params.port = parseInt(value);
|
||||||
break;
|
break;
|
||||||
|
case 'extensionEnvironment':
|
||||||
|
try {
|
||||||
|
extensionHostDebugEnvironment.params.env = JSON.parse(value);
|
||||||
|
} catch (error) {
|
||||||
|
onUnexpectedError(error);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'enableProposedApi':
|
case 'enableProposedApi':
|
||||||
extensionHostDebugEnvironment.extensionEnabledProposedApi = [];
|
extensionHostDebugEnvironment.extensionEnabledProposedApi = [];
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user