cargo-make: script hangs terminal
Describe the bug
Running a task that launches npx webpack-dev-server causes a hang in windows when exiting
To Reproduce
- Install node, npm, etc.
- Create a minimal webpack project (and install webpack-dev-server)
- Start the webpack-dev-server via npx directly:
npx webpack-dev-server --config webpack.config.js
- Control-C to break out
- No problem so far… can type on the console, task manager looks clean - all good
- Now try via
cargo make… - Create following in Makefile.toml
[tasks.webpack-development-server]
script = ["npx webpack-dev-server --config webpack.config.js"]
- Launch it via
cargo make webpack-development-server - Starts fine
- Control-C to exit
- Appears to exit but then terminal is messed up - can’t enter text
- Also task manager shows additional consoles (this is after hitting control-c in the terminal but before closing the window entirely):

Error Stack
None - it’s just that the terminal becomes unusable
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 29 (12 by maintainers)
Commits related to this issue
- Enable to pipe stdin for scripts #355 — committed to sagiegurari/cargo-make by sagiegurari 4 years ago
Can’t check today but will try tomorrow… in the meantime, thanks 😃
I found a workaround by abusing the script command.
scriptwill swallow <kbd>Ctrl</kbd><kbd>C</kbd> and does not require super user permissions likesetsid.I’ve updated my dummy project with an example.
I’ll keep an eye out for a cargo-make update with a flag or option, since that will be a lot less hacky.
scripts are executed in the command.rs and it is using another library run_script (also mine) which creates a script file and executes it.