← Back to context

Comment by silon42

6 days ago

It seems wrong that the app would be responsible for cleanup... Shouldn't this be solved in the shell / terminal ? What if kill -9?

When you use ctrl+c, you are not killing the program, you are sending it a SIGTERM signal which essentially means « could you please stop yourself ? » so the program have a chance to clean things before exiting.

kill -9 is sending a SIGKILL signal which, well, kills the program immediately.