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

Background processes not spawning for bash #99618

Closed
Twiggeh opened this issue Jun 8, 2020 · 2 comments
Closed

Background processes not spawning for bash #99618

Twiggeh opened this issue Jun 8, 2020 · 2 comments
Assignees

Comments

@Twiggeh
Copy link

Twiggeh commented Jun 8, 2020

Can't create background processes from tasks.json . Basically if I append & to a command it doesn't work …

tasks.json

  "tasks": [
    {
      "type": "shell",
      "label": "start webpack",
      "command": "cd bin && ./startWebpack.sh &"
    },
]

startWebpack.sh

#!/bin/bash
echo "Starting webpack-dev-server"
cd .. && cd client && yarn debug &

Example recording

I start the command just by itself in bash & the script runs, if I start it from vsc it doesn't. This setup still worked yesterday …
Peek 2020-06-08 15-46

@Twiggeh Twiggeh changed the title Background processes broken for bash Background processes not spawning for bash Jun 8, 2020
@connor4312
Copy link
Member

I don't think this is related to js-debug, as tasks are handled separately. Transferring to vscode and Alex.

@connor4312 connor4312 transferred this issue from microsoft/vscode-js-debug Jun 8, 2020
@alexr00
Copy link
Member

alexr00 commented Jun 9, 2020

When your shell is bash, tasks are run like this:

bash -c cd bin && ./startWebpack.sh &

If you can get your command to run like that, then that's great. However, tasks does provide easier mechanisms for what you're trying to do.
If you want to run a task without showing it and start it in a different directory, try something like this:

		{
			"type": "shell",
			"label": "start webpack",
			"command": "./startWebpack.sh",
			"options": {
				"cwd": "${workspaceFolder}/bin"
			},
			"presentation": {
				"reveal": "never"
			}
		

@alexr00 alexr00 closed this as completed Jun 9, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants