Fix <escape> behavior in Emacs mode