Save and close mappings for emacs running inside term