[Terminal] Add proper handling of exit_action