Skip to content

Commit 70cec08

Browse files
committed
Rename getShellIntegrationEnabledSetting
1 parent f10e606 commit 70cec08

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

src/features/terminal/shells/bash/bashStartup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import which from 'which';
55
import { traceError, traceInfo, traceVerbose } from '../../../../common/logging';
66
import { ShellConstants } from '../../../common/shellConstants';
77
import { hasStartupCode, insertStartupCode, removeStartupCode } from '../common/editUtils';
8-
import { getShellIntegrationEnabledCache, isWsl, shellIntegrationForActiveTerminal } from '../common/shellUtils';
8+
import { getShellIntegrationEnabledSetting, isWsl, shellIntegrationForActiveTerminal } from '../common/shellUtils';
99
import { ShellScriptEditState, ShellSetupState, ShellStartupScriptProvider } from '../startupProvider';
1010
import { BASH_ENV_KEY, BASH_OLD_ENV_KEY, BASH_SCRIPT_VERSION, ZSH_ENV_KEY, ZSH_OLD_ENV_KEY } from './bashConstants';
1111

@@ -69,7 +69,7 @@ async function isStartupSetup(profile: string, key: string): Promise<ShellSetupS
6969
return ShellSetupState.NotSetup;
7070
}
7171
async function setupStartup(profile: string, key: string, name: string): Promise<boolean> {
72-
const shellIntegrationEnabled = await getShellIntegrationEnabledCache();
72+
const shellIntegrationEnabled = await getShellIntegrationEnabledSetting();
7373
if ((shellIntegrationEnabled || (await shellIntegrationForActiveTerminal(name, profile))) && !isWsl()) {
7474
removeStartup(profile, key);
7575
return true;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ export function isWsl(): boolean {
126126
return !!(process.env.WSL_DISTRO_NAME || process.env.WSL_INTEROP || process.env.WSLENV);
127127
}
128128

129-
export async function getShellIntegrationEnabledCache(): Promise<boolean> {
129+
export async function getShellIntegrationEnabledSetting(): Promise<boolean> {
130130
const shellIntegrationInspect =
131131
getConfiguration('terminal.integrated').inspect<boolean>('shellIntegration.enabled');
132132

src/features/terminal/shells/fish/fishStartup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import which from 'which';
66
import { traceError, traceInfo, traceVerbose } from '../../../../common/logging';
77
import { ShellConstants } from '../../../common/shellConstants';
88
import { hasStartupCode, insertStartupCode, removeStartupCode } from '../common/editUtils';
9-
import { getShellIntegrationEnabledCache, isWsl, shellIntegrationForActiveTerminal } from '../common/shellUtils';
9+
import { getShellIntegrationEnabledSetting, isWsl, shellIntegrationForActiveTerminal } from '../common/shellUtils';
1010
import { ShellScriptEditState, ShellSetupState, ShellStartupScriptProvider } from '../startupProvider';
1111
import { FISH_ENV_KEY, FISH_OLD_ENV_KEY, FISH_SCRIPT_VERSION } from './fishConstants';
1212

@@ -58,7 +58,7 @@ async function isStartupSetup(profilePath: string, key: string): Promise<boolean
5858

5959
async function setupStartup(profilePath: string, key: string): Promise<boolean> {
6060
try {
61-
const shellIntegrationEnabled = await getShellIntegrationEnabledCache();
61+
const shellIntegrationEnabled = await getShellIntegrationEnabledSetting();
6262
if ((shellIntegrationEnabled || (await shellIntegrationForActiveTerminal('fish', profilePath))) && !isWsl()) {
6363
removeFishStartup(profilePath, key);
6464
return true;

src/features/terminal/shells/pwsh/pwshStartup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { ShellConstants } from '../../../common/shellConstants';
1313
import { hasStartupCode, insertStartupCode, removeStartupCode } from '../common/editUtils';
1414
import {
1515
extractProfilePath,
16-
getShellIntegrationEnabledCache,
16+
getShellIntegrationEnabledSetting,
1717
isWsl,
1818
PROFILE_TAG_END,
1919
PROFILE_TAG_START,
@@ -169,7 +169,7 @@ async function isPowerShellStartupSetup(shell: string, profile: string): Promise
169169
}
170170

171171
async function setupPowerShellStartup(shell: string, profile: string): Promise<boolean> {
172-
const shellIntegrationEnabled = await getShellIntegrationEnabledCache();
172+
const shellIntegrationEnabled = await getShellIntegrationEnabledSetting();
173173

174174
if ((shellIntegrationEnabled || (await shellIntegrationForActiveTerminal(shell, profile))) && !isWsl()) {
175175
removePowerShellStartup(shell, profile, POWERSHELL_OLD_ENV_KEY);

src/features/terminal/terminalManager.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import { isActivatableEnvironment } from '../common/activation';
1717
import { identifyTerminalShell } from '../common/shellDetector';
1818
import { getPythonApi } from '../pythonApi';
1919
import {
20-
getShellIntegrationEnabledCache,
20+
getShellIntegrationEnabledSetting,
2121
isWsl,
2222
shellIntegrationForActiveTerminal,
2323
shouldUseProfileActivation,
@@ -144,7 +144,7 @@ export class TerminalManagerImpl implements TerminalManager {
144144
}
145145
if (e.affectsConfiguration('terminal.integrated.shellIntegration.enabled')) {
146146
traceInfo('Shell integration setting changed, invalidating cache');
147-
const updatedShellIntegrationSetting = await getShellIntegrationEnabledCache();
147+
const updatedShellIntegrationSetting = await getShellIntegrationEnabledSetting();
148148
if (!updatedShellIntegrationSetting) {
149149
const shells = new Set(
150150
terminals()
@@ -171,7 +171,7 @@ export class TerminalManagerImpl implements TerminalManager {
171171
await Promise.all(
172172
providers.map(async (p) => {
173173
const state = await p.isSetup();
174-
const shellIntegrationEnabledSetting = await getShellIntegrationEnabledCache();
174+
const shellIntegrationEnabledSetting = await getShellIntegrationEnabledSetting();
175175
const shellIntegrationActiveTerminal = await shellIntegrationForActiveTerminal(p.name);
176176
const shellIntegrationLikelyAvailable =
177177
shellIntegrationEnabledSetting || shellIntegrationActiveTerminal;

0 commit comments

Comments
 (0)