diff --git a/src/nano.c b/src/nano.c
index 1e37e9a8c76042a047ac0ef8c120355f84cab21d..ad6322ed88cd5f7b2686a56789d67ed0d54b2a38 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2939,6 +2939,10 @@ void handle_sigwinch(int s)
     /* Turn cursor back on for sure. */
     curs_set(1);
 
+    /* Set up the signal handlers again, so that the special control
+     * keys all work the same as before. */
+    signal_init();
+
     /* Switch to cbreak mode and turn the keypad on, so that the keypad
      * and input still work if we resized during verbatim input. */
 #ifdef _POSIX_VDISABLE
@@ -2947,10 +2951,6 @@ void handle_sigwinch(int s)
     keypad(edit, TRUE);
     keypad(bottomwin, TRUE);
 
-    /* Set up the signal handlers again, so that the special control
-     * keys all work the same as before. */
-    signal_init();
-
     /* Jump back to the main loop. */
     siglongjmp(jmpbuf, 1);
 }