Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use this to restart a continuously running process? #22

Open
nielmond opened this issue Dec 31, 2018 · 1 comment
Open

How to use this to restart a continuously running process? #22

nielmond opened this issue Dec 31, 2018 · 1 comment

Comments

@nielmond
Copy link

nielmond commented Dec 31, 2018

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?

@nielmond
Copy link
Author

nielmond commented Dec 31, 2018

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.

@elyase elyase mentioned this issue Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant