Handle Escape after doing internal modes so Escape can be used to terminate a mode.