Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save ChristianKienle/bc434118eac6c9fa0860c44a4b38f5fb to your computer and use it in GitHub Desktop.
Save ChristianKienle/bc434118eac6c9fa0860c44a4b38f5fb to your computer and use it in GitHub Desktop.
NSTask/Process and exec
I am writing a command line tool which is using Process/NSTask
to launch $x. Internally $x is actually a bash script which
is using exec to execute $y.
Now the user sends SIGINT (ctrl+c in Terminal.app), my process
exits but $y is still running and writes stuff to stdout.
How can I properly handle this case? Usually I would have
just killed/interrupted/terminated $x (which I do) but this
seemingly does nothing. d'oh.😢😪
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment