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. */
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);

View File

@ -74,10 +74,11 @@ int *get_verbatim_kbinput(WINDOW *win, int *kbinput_len, int
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
@ -103,8 +104,8 @@ int *get_verbatim_kbinput(WINDOW *win, int *kbinput_len, int
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