Fix terminate to kill the running command properly (first ^C, then SIGINT, then SIGKILL).

The code was previously only trying ^C... and was also using the wrong value (ASCII 4 instead of 3).
Code cleanup, more comments & revert a mistake in the previous commit
(we need to kill the whole process group).
Change some comments.