From 8a795656ef6ce93b6fa837349759700ed0b436ad Mon Sep 17 00:00:00 2001 From: Cristian Cepeda <43882+pastuxso@users.noreply.github.com> Date: Fri, 8 Nov 2024 17:50:01 -0500 Subject: [PATCH] Auto open new terminal once --- src/extension/features/autoOpenTerminal.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/extension/features/autoOpenTerminal.ts b/src/extension/features/autoOpenTerminal.ts index 44a8cbfef..7f5277046 100644 --- a/src/extension/features/autoOpenTerminal.ts +++ b/src/extension/features/autoOpenTerminal.ts @@ -1,6 +1,7 @@ import { commands } from 'vscode' import { FeatureName } from '../../types' +import ContextState from '../contextState' import { isOnInContextState } from '.' @@ -9,5 +10,8 @@ export async function autoOpenTerminal() { return } - await commands.executeCommand('workbench.action.terminal.new') + if (!ContextState.getKey(FeatureName.AutoOpenTerminal)) { + await commands.executeCommand('workbench.action.terminal.new') + ContextState.addKey(FeatureName.AutoOpenTerminal, true) + } }