I have a task at version 0.1.0 that I try to migrate to 2.0.0.
This task simply transpiles Typescript to Javascript using a Gulp script. The output is shown in the "output" console, there is no terminal involved and I want it to keep it that way (mostly because of the infamous message "Terminal will be reused by tasks, press any key to close it.
" at the end of any command in the terminal!).
I can't see how to migrate this task to version 2.0.0 so no terminal is involved!
Here's the version 0.1.0 :
{
"version": "0.1.0",
"command": "${workspaceRoot}/node_modules/.bin/gulp",
"isShellCommand": true,
"showOutput": "always",
"suppressTaskName": true,
"tasks": [
{
"taskName": "compile",
"args": [
"compile",
"exit"
],
"isBuildCommand": true,
"problemMatcher": "$tsc"
}
]
}
Here's my current try for version 2.0.0 :
{
"version": "2.0.0",
"tasks": [
{
"identifier": "compile",
"type": "shell",
"taskName": "compile",
"presentation": {
"echo": true,
"reveal": "always",
"focus": true,
"panel": "new"
},
"command": "${workspaceRoot}/node_modules/.bin/gulp compile exit",
"problemMatcher": [
"$tsc"
],
"group": {
"kind": "build",
"isDefault": true
}
}
]
}
This does show the output in the integrated terminal.
How can I make it use the output console instead?
Open your C code file in Text Editor, then use shortcut Ctrl+Alt+N , or press F1 and then select/type Run Code , or right click the Text Editor and then click Run Code in context menu, the code will be compiled and run, and the output will be shown in the Output Window.
If you don't want it to run in the terminal, then in the Code Runner settings uncheck the “Run in Terminal” option. When you run your code, make sure that you have selected “Code” from the OUTPUT dropdown.
Using the tasks panel is the recommended way to go, but if you really need to use the output panel. You'd need to implement a CustomExecution and get the output of your command. Then to write to the output panel, first you would need to create a dedicated output channel and write to it:
let outputChannel = vscode.window.createOutputChannel('channelName');
outputChannel.appendLine('message');
Try change "reveal": "always",
to "reveal": "never",
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