/* Turn cursor back on for sure. */
curs_set(1);
+ /* Put the terminal in cbreak mode (read one character at a time and
+ * interpret the special control keys) if we can selectively disable
+ * the special control keys. */
+#ifdef _POSIX_VDISABLE
+ cbreak();
+#endif
+
/* 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
- cbreak();
-#endif
+ /* Turn the keypad on in the windows we'll be reading input from. */
keypad(edit, TRUE);
keypad(bottomwin, TRUE);
allow_pending_sigwinch(TRUE);
#endif
- /* Switch to raw mode so that we can type ^C, ^Q, ^S, ^Z, and ^\
- * (and ^Y on systems supporting delayed suspend) without getting
- * interrupts, and turn the keypad off so that we don't get extended
- * keypad values, all of which are outside the ASCII range. */
+ /* Switch to raw mode if necessary so that we can type ^C, ^Q, ^S,
+ * ^Z, and ^\ (and ^Y on systems supporting delayed suspend) without
+ * getting interrupts, and turn the keypad off so that we don't get
+ * extended keypad values, all of which are outside the ASCII
+ * range. */
#ifdef _POSIX_VDISABLE
raw();
#endif
nodelay(win, FALSE);
}
- /* Switch back to cbreak mode and turn the keypad back on now that
- * we're done. */
+ /* Switch back to cbreak mode if necessary and turn the keypad back
+ * on now that we're done. */
#ifdef _POSIX_VDISABLE
cbreak();
#endif