Skip --new-session in learning mode so interactive programs can access /dev/tty, and run strace in the foreground to preserve terminal stdin. Also skip template generation when the traced command exits non-zero, since the strace trace would be incomplete.