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 8af1d83 commit bdf4c68
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 runTests = (filter: string): Task =>
wollokCLITask('run tests', 'Wollok run tests', [
Expand Down

0 comments on commit bdf4c68

Please sign in to comment.