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).