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

Cancel a series of tasks with SIGINT #452

Closed
bozdoz opened this issue Dec 5, 2023 · 6 comments · Fixed by #460
Closed

Cancel a series of tasks with SIGINT #452

bozdoz opened this issue Dec 5, 2023 · 6 comments · Fixed by #460
Labels

Comments

@bozdoz
Copy link

bozdoz commented Dec 5, 2023

Description:

I want to run a series of tasks, that are cancellable.

Expected Behaviour:

If I press CTRL-C, I want the entire script (each of the series of tasks) to be aborted (or not started).

Actual Behaviour:

I need to press CTRL-C multiple times to cancel each process.

Reproduction:

Note the -m 1 flag to run one process consecutively.

{
"sleep": "concurrently --kill-others-on-fail -m 1 \"sleep 3\" \"echo 'hi'\" \"sleep 3\" \"echo 'there'\" \"sleep 3\" \"echo 'buddy'\""
}
npm run sleep

> concurrently --kill-others-on-fail -m 1 "sleep 3" "echo 'hi'" "sleep 3" "echo 'there'" "sleep 3" "echo 'buddy'"

^C[0] sleep 3 exited with code SIGINT
[1] hi
[1] echo 'hi' exited with code 0
[2] sleep 3 exited with code 0
[3] there
[3] echo 'there' exited with code 0
[4] sleep 3 exited with code 0
[5] buddy
[5] echo 'buddy' exited with code 0

Is this a bug, or is there a way to do this that is not obvious?

@gustavohenke
Copy link
Member

Duplicate of #433

I think it's more of a bug.

@gustavohenke gustavohenke closed this as not planned Won't fix, can't repro, duplicate, stale Dec 7, 2023
@gustavohenke
Copy link
Member

gustavohenke commented Dec 7, 2023

Sorry, I was a bit hasty marking this as a duplicate of #433.
Signals such as SIGINT received by the main process work separately from --kill-others-on-fail.

@bozdoz
Copy link
Author

bozdoz commented Dec 7, 2023

So would this be a feature request? A bug? User error?

@gustavohenke
Copy link
Member

It's a bug. Just tagged it as such

@SrBrahma
Copy link

SrBrahma commented Jan 7, 2024

Up.

"dev": "concurrently -c blue,green -n tsw,next \"bun tsw\" \"next dev\""

I already tried all the combinations of the --kill options but they won't work. I have to press Ctrl+C twice to kill all.

@gustavohenke
Copy link
Member

🚢 This is now fixed in v9.0.0!
https://github.com/open-cli-tools/concurrently/releases/tag/v9.0.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants