Working state - terminal.c cleaned up.