Skip to content

Commit 99adc96

Browse files
committed
add activeTerminalShellIntegration to window.apis.ts
1 parent b8bdc96 commit 99adc96

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/common/window.apis.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ export function activeTerminal(): Terminal | undefined {
6161
return window.activeTerminal;
6262
}
6363

64+
export function activeTerminalShellIntegration() {
65+
return window.activeTerminal?.shellIntegration;
66+
}
67+
6468
export function activeTextEditor(): TextEditor | undefined {
6569
return window.activeTextEditor;
6670
}

src/features/terminal/shells/common/shellUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { window } from 'vscode';
21
import { PythonCommandRunConfiguration, PythonEnvironment } from '../../../../api';
32
import { traceInfo } from '../../../../common/logging';
43
import { isWindows } from '../../../../common/utils/platformUtils';
4+
import { activeTerminalShellIntegration } from '../../../../common/window.apis';
55
import { ShellConstants } from '../../../common/shellConstants';
66
import { quoteArgs } from '../../../execution/execUtils';
77

@@ -99,7 +99,7 @@ export function extractProfilePath(content: string): string | undefined {
9999
}
100100

101101
export function shellIntegrationForActiveTerminal(name: string, profile: string): boolean {
102-
const hasShellIntegration = window.activeTerminal?.shellIntegration;
102+
const hasShellIntegration = activeTerminalShellIntegration();
103103

104104
if (hasShellIntegration) {
105105
traceInfo(

0 commit comments

Comments
 (0)