Fix SUDO_USER problem when running apply-terminal only