wrong place; signal_init() should be called after the input mode (cbreak

or raw) is set in order to work properly; also clarify related comments


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1710 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-04-07 01:07:50 +00:00
parent d7db0a6dbf
commit edc1ea4c16
2 changed files with 15 additions and 11 deletions

View File

@ -2939,15 +2939,18 @@ void handle_sigwinch(int s)
/* Turn cursor back on for sure. */ /* Turn cursor back on for sure. */
curs_set(1); 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 /* Set up the signal handlers again, so that the special control
* keys all work the same as before. */ * keys all work the same as before. */
signal_init(); signal_init();
/* Switch to cbreak mode and turn the keypad on, so that the keypad /* Turn the keypad on in the windows we'll be reading input from. */
* and input still work if we resized during verbatim input. */
#ifdef _POSIX_VDISABLE
cbreak();
#endif
keypad(edit, TRUE); keypad(edit, TRUE);
keypad(bottomwin, TRUE); keypad(bottomwin, TRUE);

View File

@ -74,10 +74,11 @@ int *get_verbatim_kbinput(WINDOW *win, int *kbinput_len, int
allow_pending_sigwinch(TRUE); allow_pending_sigwinch(TRUE);
#endif #endif
/* Switch to raw mode so that we can type ^C, ^Q, ^S, ^Z, and ^\ /* Switch to raw mode if necessary so that we can type ^C, ^Q, ^S,
* (and ^Y on systems supporting delayed suspend) without getting * ^Z, and ^\ (and ^Y on systems supporting delayed suspend) without
* interrupts, and turn the keypad off so that we don't get extended * getting interrupts, and turn the keypad off so that we don't get
* keypad values, all of which are outside the ASCII range. */ * extended keypad values, all of which are outside the ASCII
* range. */
#ifdef _POSIX_VDISABLE #ifdef _POSIX_VDISABLE
raw(); raw();
#endif #endif
@ -103,8 +104,8 @@ int *get_verbatim_kbinput(WINDOW *win, int *kbinput_len, int
nodelay(win, FALSE); nodelay(win, FALSE);
} }
/* Switch back to cbreak mode and turn the keypad back on now that /* Switch back to cbreak mode if necessary and turn the keypad back
* we're done. */ * on now that we're done. */
#ifdef _POSIX_VDISABLE #ifdef _POSIX_VDISABLE
cbreak(); cbreak();
#endif #endif