Skip to content

Commit

Permalink
Fix #159 - end terminal session when opening a game
Browse files Browse the repository at this point in the history
  • Loading branch information
fdodino committed Mar 24, 2024
1 parent 5170096 commit 98dc23c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions client/src/commands.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 runTest = ([filter, file, describe, test]: [string|null, string|null, string|null, string|null]): Task =>
wollokCLITask('run tests', 'Wollok run test', [
Expand Down

0 comments on commit 98dc23c

Please sign in to comment.