Open nielmond opened 5 years ago
Actually I found this works
"saveAndRun": {
"commands": [
{
"match": "\\.whatever$",
"cmd": "\u0003",
"useShortcut": false,
"silent": false
},
{
"match": "\\.whatever$",
"cmd": "<start server command>",
"useShortcut": false,
"silent": false
}
]
}
The \u0003
command kills whatever is running. Chaining the commands with &&
didn't work (maybe I wasn't escaping it correctly), but two separate entries well enough.
Maybe there's a more elegant way? If not, feel free to close this.
I want to restart a server, something like this https://stackoverflow.com/questions/35248007/vscode-editor-restart-nodejs-server-when-file-is-changed, but more generic.
Maybe there is a way to send a SIGINT?