Skip to content

Commit 46ea0b9

Browse files
committed
listen to change event since windows shell detection is slower
1 parent ce764c7 commit 46ea0b9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/features/common/activation.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
import { Terminal } from 'vscode';
1+
import { Terminal, window } from 'vscode';
22
import { PythonCommandRunConfiguration, PythonEnvironment } from '../../api';
33
import { identifyTerminalShell } from './shellDetector';
4+
import { traceLog } from '../../common/logging';
45

56
export function isActivatableEnvironment(environment: PythonEnvironment): boolean {
67
return !!environment.execInfo?.activation || !!environment.execInfo?.shellActivation;
@@ -15,6 +16,11 @@ export function getActivationCommand(
1516
environment: PythonEnvironment,
1617
): PythonCommandRunConfiguration[] | undefined {
1718
const shell = identifyTerminalShell(terminal);
19+
traceLog('getActivationCommand: Shell type from API:', shell);
20+
window.onDidChangeTerminalState((e) => {
21+
// traceLog('getActivationCommand: Terminal state changed:', e);
22+
traceLog('the shell type from API inside the listener:', e.state.shell);
23+
});
1824

1925
let activation: PythonCommandRunConfiguration[] | undefined;
2026
if (environment.execInfo?.shellActivation) {

0 commit comments

Comments
 (0)