Skip to content

Commit 122680e

Browse files
committed
guard against wsl
1 parent b8cc93d commit 122680e

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/client/common/terminal/service.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import {
2121
} from './types';
2222
import { traceVerbose } from '../../logging';
2323
import { getConfiguration } from '../vscodeApis/workspaceApis';
24-
import { isWindows } from '../utils/platform';
24+
import { isWindows, isWsl } from '../utils/platform';
2525

2626
@injectable()
2727
export class TerminalService implements ITerminalService, Disposable {
@@ -105,7 +105,7 @@ export class TerminalService implements ITerminalService, Disposable {
105105

106106
const config = getConfiguration('python');
107107
const pythonrcSetting = config.get<boolean>('terminal.shellIntegration.enabled');
108-
if ((isPythonShell && !pythonrcSetting) || (isPythonShell && isWindows())) {
108+
if ((isPythonShell && !pythonrcSetting) || (isPythonShell && isWindows()) || (isPythonShell && isWsl())) {
109109
// If user has explicitly disabled SI for Python, use sendText for inside Terminal REPL.
110110
terminal.sendText(commandLine);
111111
return undefined;

src/client/common/utils/platform.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33

44
'use strict';
55

6+
import { env } from 'vscode';
67
import { EnvironmentVariables } from '../variables/types';
7-
88
export enum Architecture {
99
Unknown = 1,
1010
x86 = 2,
@@ -30,6 +30,10 @@ export function getOSType(platform: string = process.platform): OSType {
3030
}
3131
}
3232

33+
export function isWsl(): boolean {
34+
return env.remoteName === 'wsl';
35+
}
36+
3337
const architectures: Record<string, Architecture> = {
3438
x86: Architecture.x86, // 32-bit
3539
x64: Architecture.x64, // 64-bit

0 commit comments

Comments
 (0)