Skip to content

Commit 8bba066

Browse files
fix: Propagate forceShellIntegration to remote terminal server (#300428)
Co-authored-by: Megan Rogge <merogge@microsoft.com>
1 parent fdaa8c8 commit 8bba066

5 files changed

Lines changed: 15 additions & 1 deletion

File tree

src/vs/platform/terminal/common/terminal.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,7 @@ export interface IShellLaunchConfigDto {
719719
reconnectionProperties?: IReconnectionProperties;
720720
type?: 'Task' | 'Local';
721721
isFeatureTerminal?: boolean;
722+
forceShellIntegration?: boolean;
722723
tabActions?: ITerminalTabAction[];
723724
shellIntegrationEnvironmentReporting?: boolean;
724725
titleTemplate?: string;

src/vs/platform/terminal/test/node/terminalEnvironment.test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,17 @@ suite('platform - terminalEnvironment', async () => {
184184
});
185185
});
186186
suite('bash', async () => {
187+
suite('forceShellIntegration', async () => {
188+
test('should inject when isFeatureTerminal is true but forceShellIntegration overrides it', async () => {
189+
strictEqual((await getShellIntegrationInjection({ executable: 'bash', args: [], isFeatureTerminal: true, forceShellIntegration: true }, enabledProcessOptions, defaultEnvironment, logService, productService, true)).type, 'injection');
190+
});
191+
test('should not inject when isFeatureTerminal is true and forceShellIntegration is false', async () => {
192+
strictEqual((await getShellIntegrationInjection({ executable: 'bash', args: [], isFeatureTerminal: true, forceShellIntegration: false }, enabledProcessOptions, defaultEnvironment, logService, productService, true)).type, 'failure');
193+
});
194+
test('should not inject when isFeatureTerminal is true and forceShellIntegration is not set', async () => {
195+
strictEqual((await getShellIntegrationInjection({ executable: 'bash', args: [], isFeatureTerminal: true }, enabledProcessOptions, defaultEnvironment, logService, productService, true)).type, 'failure');
196+
});
197+
});
187198
suite('should override args', async () => {
188199
test('when undefined, [], empty string', async () => {
189200
const enabledExpectedResult = Object.freeze<IShellIntegrationConfigInjection>({

src/vs/server/node/remoteTerminalChannel.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ export class RemoteTerminalChannel extends Disposable implements IServerChannel<
204204
reconnectionProperties: args.shellLaunchConfig.reconnectionProperties,
205205
type: args.shellLaunchConfig.type,
206206
isFeatureTerminal: args.shellLaunchConfig.isFeatureTerminal,
207+
forceShellIntegration: args.shellLaunchConfig.forceShellIntegration,
207208
tabActions: args.shellLaunchConfig.tabActions,
208209
shellIntegrationEnvironmentReporting: args.shellLaunchConfig.shellIntegrationEnvironmentReporting,
209210
};

src/vs/workbench/api/node/extHostDebugService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export class ExtHostDebugService extends ExtHostDebugServiceBase {
9090

9191
const terminalName = args.title || nls.localize('debug.terminal.title', "Debug Process");
9292

93-
const shellConfig = JSON.stringify({ shell, shellArgs });
93+
const shellConfig = JSON.stringify({ shell, shellArgs, cwd: args.cwd });
9494
let terminal = await this._integratedTerminalInstances.checkout(shellConfig, terminalName);
9595

9696
let cwdForPrepareCommand: string | undefined;

src/vs/workbench/contrib/terminal/browser/remoteTerminalBackend.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,7 @@ class RemoteTerminalBackend extends BaseTerminalBackend implements ITerminalBack
191191
reconnectionProperties: shellLaunchConfig.reconnectionProperties,
192192
type: shellLaunchConfig.type,
193193
isFeatureTerminal: shellLaunchConfig.isFeatureTerminal,
194+
forceShellIntegration: shellLaunchConfig.forceShellIntegration,
194195
tabActions: shellLaunchConfig.tabActions,
195196
shellIntegrationEnvironmentReporting: shellLaunchConfig.shellIntegrationEnvironmentReporting,
196197
};

0 commit comments

Comments
 (0)