diff --git a/src/global.c b/src/global.c
index 91459da10d6b0bfda26e24789ebbeca006ec4118..cb26c26af5fecb442bf0d0b1a999bc06380ea216 100644
--- a/src/global.c
+++ b/src/global.c
@@ -648,7 +648,7 @@ void shortcut_init(bool unjustify)
 #endif
 
     add_to_funcs((void *) cancel_msg,
-	(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR),
+	(MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
 	cancel_msg, IFSCHELP(nano_cancel_msg), FALSE, VIEW);
 
     add_to_funcs(do_exit, MMAIN,
@@ -1140,7 +1140,7 @@ void shortcut_init(bool unjustify)
 #endif
     add_to_sclist(MGOTOLINE, "^T", (void *) gototext_msg, 0, FALSE);
     add_to_sclist(MINSERTFILE|MEXTCMD, "M-F", (void *) new_buffer_msg, 0, FALSE);
-    add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR), 
+    add_to_sclist((MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MWHEREISFILE|MGOTODIR|MYESNO),
 	"^C", (void *) cancel_msg, 0, FALSE);
     add_to_sclist(MHELP, "^X", do_exit, 0, TRUE);
     add_to_sclist(MHELP, "F2", do_exit, 0, TRUE);
diff --git a/src/nano.h b/src/nano.h
index 2688e9ba5a99e40fe16d1f6b6de1c80c9aa11b94..648d9a0e3e1a1679e574e112d39c5c8b51807d07 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -438,6 +438,7 @@ typedef struct subnfunc {
 #define	MBROWSER			(1<<10)
 #define	MWHEREISFILE			(1<<11)
 #define MGOTODIR			(1<<12)
+#define MYESNO				(1<<13)
 /* This really isnt all but close enough */
 #define	MALL				(MMAIN|MWHEREIS|MREPLACE|MREPLACE2|MGOTOLINE|MWRITEFILE|MINSERTFILE|MEXTCMD|MSPELL|MBROWSER|MWHEREISFILE|MGOTODIR|MHELP)
 
diff --git a/src/prompt.c b/src/prompt.c
index f92b72595cd0bca7daed6771934807498987cce6..67f978ddc6461701c656cdcfd61564fd3ea247d2 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -1247,6 +1247,7 @@ int do_yesno_prompt(bool all, const char *msg)
     const char *nostr;		/* Same for No. */
     const char *allstr;		/* And All, surprise! */
     const sc *s;
+    int oldmenu = currmenu;
 
     assert(msg != NULL);
 
@@ -1308,6 +1309,7 @@ int do_yesno_prompt(bool all, const char *msg)
 	int mouse_x, mouse_y;
 #endif
 
+	currmenu = MYESNO;
 	kbinput = get_kbinput(bottomwin, &meta_key, &func_key);
 	s = get_shortcut(currmenu, &kbinput, &meta_key, &func_key);
 
@@ -1358,5 +1360,6 @@ int do_yesno_prompt(bool all, const char *msg)
 	}
     } while (ok == -2);
 
+    currmenu = oldmenu;
     return ok;
 }