Isolate why some long-running scripts in Git-Bash trigger post{script} lifecycle scripts after being killed with control-c
while others do not.
This is a problem when running the ideasonpurpose/docker-build start
script since it leaves behind an orphaned Docker instance which much be killed manually.
The usual: npm install
There are four scripts, each of which has an accompanying post{script} that simply echoes its name.
Killing long-running scripts with control-c
should trigger the post{script}, but sometimes fails.
This is just a simple control which prints echo script, then triggers postecho
which prints postecho script.
This uses cross-env-shell to start a python3 webserver on port 8000. The postpyserver
script fails to run after killing this with control-c
.
Runs http-server which listens on port 8080. Killing this should trigger postserver
which echoes its name.
This starts a chokidar file watcher in the current directory. The postwatch
script fails to run after killing this with control-c
.
This only seems to be an issue with Git-Bash for some long-running processes. Post{script} lifecycle scripts work correctly from cmd.exe and Powershell, the same as they do on Mac/Linux.
These may be relevant: