From bdf4c684aad21f5c50f75a50eab4c71df4297000 Mon Sep 17 00:00:00 2001 From: Fernando Dodino Date: Sun, 24 Mar 2024 01:27:19 -0300 Subject: [PATCH] Fix #159 - end terminal session when opening a game --- client/src/commands.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/client/src/commands.ts b/client/src/commands.ts index 33eaa904..d9eefe04 100644 --- a/client/src/commands.ts +++ b/client/src/commands.ts @@ -34,13 +34,16 @@ export const subscribeWollokCommands = (context: ExtensionContext): void => { * CLI Commands */ -export const runProgram = (isGame = false) => (fqn: string): Task => - wollokCLITask('run program', `Wollok run ${isGame ? 'game' : 'program'}`, [ +export const runProgram = (isGame = false) => (fqn: string): Task => { + // Terminate previous terminal session + vscode.commands.executeCommand('workbench.action.terminal.killAll') + return wollokCLITask('run program', `Wollok run ${isGame ? 'game' : 'program'}`, [ 'run', ...isGame ? ['-g'] : [], `'${fqn}'`, '--skipValidations', ]) +} export const runTests = (filter: string): Task => wollokCLITask('run tests', 'Wollok run tests', [