By default running tasks inside Visual Studio Code opens a new integrated terminal over the current one, which then asks you to press a key to close it. I would really prefer if the current terminal was used instead, as it gets annoying when many new terminals stack over one another after running several tasks. Is there any way of configuring that? I find it hard to believe no one else dislikes the default behavior but can't seem to find anything online or in the settings.
The way I found to have the command copy-pasted on the current terminal is using keybindings.json
command with "workbench.action.terminal.sendSequence"
instead of tasks.json
. As the following example:
{
"key": "<your hotkey here>",
"command": "workbench.action.terminal.sendSequence",
"args": {
"text": "<your command here> \n"
}
}
The \n
at the end will make it actually send the command. Otherwise it will just paste and you will have the press enter.
If I understood your question correctly I think it should be enough if you set panel: "shared"
in the presentation
field of the task json. This will prevent multiple terminals from stacking and they should all try to use the same one.
Source: https://code.visualstudio.com/docs/editor/tasks#_output-behavior
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With