Closed ttodua closed 2 years ago
You need to create a task in the VSCode https://code.visualstudio.com/docs/editor/tasks.
E.g.
{
"version": "2.0.0",
"tasks": [
{
"label": "Run tests",
"type": "shell",
"command": "./scripts/test.sh",
"windows": {
"command": ".\\scripts\\test.cmd"
},
"group": "test",
"presentation": {
"reveal": "always",
"panel": "new"
}
}
]
}
Then go to the extension settings and set the next to the custom button command workbench.action.tasks.runTask| flutter: Run tests
where Run tests
is the task label.
i've tried and made it work, however, isn't it possible to just run any sample command directly in the open terminal, without starting the task (being placed in toolbar with loading icon aside : https://i.imgur.com/klEqRww.png ) ?
closing due to no activity
well, no activity because I've not got an answer. thanks anyway
@ttodua It's tricky but I think it's achievable by using multi-command extension and the power of workbench.action.terminal.sendSequence
. You can create a custom command which would send the command (like npm run dev
) to the terminal and execute it. You can mention this custom command in SMB.
https://stackoverflow.com/questions/52786022/shortcut-for-running-terminal-command-in-vs-code https://code.visualstudio.com/docs/editor/integrated-terminal#_send-text-from-a-keybinding
Many thanks for answer. that makes the trick.
Wanted i.e. while clicking on custom button, to run
npm install
command in terminal, but couldnt figure it out.