Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 7e32618

Browse files
author
Akash Satheesan
committed
fix(lib/vscode): fix terminal channel
1 parent 9665127 commit 7e32618

File tree

1 file changed

+13
-15
lines changed

1 file changed

+13
-15
lines changed

‎lib/vscode/src/vs/server/node/channel.ts‎

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ import { ExtensionScanner, ExtensionScannerInput } from 'vs/workbench/services/e
4343
class Watcher extends DiskFileSystemProvider {
4444
public readonly watches = new Map<number, IDisposable>();
4545

46-
public dispose(): void {
46+
public overridedispose(): void {
4747
this.watches.forEach((w) => w.dispose());
4848
this.watches.clear();
4949
super.dispose();
@@ -263,6 +263,7 @@ export class ExtensionEnvironmentChannel implements IServerChannel {
263263
globalStorageHome: this.environment.globalStorageHome,
264264
workspaceStorageHome: this.environment.workspaceStorageHome,
265265
userHome: this.environment.userHome,
266+
useHostProxy: false,
266267
os: platform.OS,
267268
marks: []
268269
};
@@ -382,7 +383,7 @@ class VariableResolverService extends AbstractVariableResolverService {
382383
getLineNumber: (): string | undefined => {
383384
return args.resolvedVariables.selectedText;
384385
},
385-
}, undefined, env);
386+
}, undefined, Promise.resolve(env));
386387
}
387388
}
388389

@@ -442,6 +443,7 @@ class Terminal extends TerminalProcess {
442443
workspaceId: this.workspaceId,
443444
workspaceName: this.workspaceName,
444445
isOrphan: this.isOrphan,
446+
icon: 'bash' // TODO@oxy: currently unused by vscode
445447
};
446448
}
447449
}
@@ -472,8 +474,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
472474

473475
// Buffer to reduce the number of messages going to the renderer.
474476
private readonly bufferer = new TerminalDataBufferer((id, data) => {
475-
// TODO: Not sure what sync means.
476-
this._onProcessData.fire({ id, event: { data, sync: true }});
477+
this._onProcessData.fire({ id, event: data });
477478
});
478479

479480
public constructor (private readonly logService: ILogService) {}
@@ -564,27 +565,26 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
564565
toResource: (relativePath: string) => resources.joinPath(activeWorkspaceUri, relativePath),
565566
} : undefined;
566567

567-
const resolverService = new VariableResolverService(remoteAuthority, args, process.envasplatform.IProcessEnvironment);
568-
const resolver = terminalEnvironment.createVariableResolver(activeWorkspace, resolverService);
568+
const resolverService = new VariableResolverService(remoteAuthority, args, process.env);
569+
const resolver = terminalEnvironment.createVariableResolver(activeWorkspace, process.env,resolverService);
569570

570571
const getDefaultShellAndArgs = async (): Promise<{ executable: string; args: string[] | string }> => {
571572
if (shellLaunchConfig.executable) {
572-
const executable = resolverService.resolve(activeWorkspace, shellLaunchConfig.executable);
573+
const executable = awaitresolverService.resolveAsync(activeWorkspace, shellLaunchConfig.executable);
573574
let resolvedArgs: string[] | string = [];
574575
if (shellLaunchConfig.args && Array.isArray(shellLaunchConfig.args)) {
575576
for (const arg of shellLaunchConfig.args) {
576-
resolvedArgs.push(resolverService.resolve(activeWorkspace, arg));
577+
resolvedArgs.push(awaitresolverService.resolveAsync(activeWorkspace, arg));
577578
}
578579
} else if (shellLaunchConfig.args) {
579-
resolvedArgs = resolverService.resolve(activeWorkspace, shellLaunchConfig.args);
580+
resolvedArgs = awaitresolverService.resolveAsync(activeWorkspace, shellLaunchConfig.args);
580581
}
581582
return { executable, args: resolvedArgs };
582583
}
583584

584585
const executable = terminalEnvironment.getDefaultShell(
585586
(key) => args.configuration[key],
586-
args.isWorkspaceShellAllowed,
587-
await getSystemShell(platform.platform, process.env as platform.IProcessEnvironment),
587+
await getSystemShell(platform.OS, process.env as platform.IProcessEnvironment),
588588
process.env.hasOwnProperty('PROCESSOR_ARCHITEW6432'),
589589
process.env.windir,
590590
resolver,
@@ -594,7 +594,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
594594

595595
const resolvedArgs = terminalEnvironment.getDefaultShellArgs(
596596
(key) => args.configuration[key],
597-
args.isWorkspaceShellAllowed,
598597
false, // useAutomationShell
599598
resolver,
600599
this.logService,
@@ -625,7 +624,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
625624
logger.debug('Resolved shell launch configuration', field('id', terminalId));
626625

627626
// Use instead of `terminal.integrated.env.${platform}` to make types work.
628-
const getEnvFromConfig = (): terminal.ISingleTerminalConfiguration<ITerminalEnvironment> => {
627+
const getEnvFromConfig = (): ITerminalEnvironment => {
629628
if (platform.isWindows) {
630629
return args.configuration['terminal.integrated.env.windows'];
631630
} else if (platform.isMacintosh) {
@@ -635,7 +634,7 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
635634
};
636635

637636
const getNonInheritedEnv = async (): Promise<platform.IProcessEnvironment> => {
638-
const env = await getMainProcessParentEnv();
637+
const env = await getMainProcessParentEnv(process.env);
639638
env.VSCODE_IPC_HOOK_CLI = process.env['VSCODE_IPC_HOOK_CLI']!;
640639
return env;
641640
};
@@ -644,7 +643,6 @@ export class TerminalProviderChannel implements IServerChannel<RemoteAgentConnec
644643
shellLaunchConfig,
645644
getEnvFromConfig(),
646645
resolver,
647-
args.isWorkspaceShellAllowed,
648646
product.version,
649647
args.configuration['terminal.integrated.detectLocale'],
650648
args.configuration['terminal.integrated.inheritEnv'] !== false

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /