turn off extended input processing (the IEXTEN termios flag) as nano

1.2.x does


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1939 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
David Lawrence Ramsey 2004-09-22 22:45:08 +00:00
parent d08348b99c
commit 013344c4c5
3 changed files with 18 additions and 4 deletions

View File

@ -44,6 +44,9 @@ CVS code -
(Meta-9), Meta-) (Meta-0), and Meta-J, respectively. Also add (Meta-9), Meta-) (Meta-0), and Meta-J, respectively. Also add
these functions to the main shortcut list, as Pico's practice these functions to the main shortcut list, as Pico's practice
of putting them in the search menu is rather odd. (DLR) of putting them in the search menu is rather odd. (DLR)
- Turn off extended input processing (the IEXTEN termios flag)
as nano 1.2.x does. New function disable_extended_input();
changes to terminal_init(). (DLR)
- files.c: - files.c:
do_insertfile() do_insertfile()
- Readd the NANO_SMALL #ifdef around the start_again: label to - Readd the NANO_SMALL #ifdef around the start_again: label to

View File

@ -2917,6 +2917,15 @@ void do_toggle(const toggle *which)
} }
#endif /* !NANO_SMALL */ #endif /* !NANO_SMALL */
void disable_extended_input(void)
{
struct termios term;
tcgetattr(0, &term);
term.c_lflag &= ~IEXTEN;
tcsetattr(0, TCSANOW, &term);
}
void disable_signals(void) void disable_signals(void)
{ {
struct termios term; struct termios term;
@ -2959,15 +2968,16 @@ void enable_flow_control(void)
* character at a time and interpret the special control keys), disable * character at a time and interpret the special control keys), disable
* translation of carriage return (^M) into newline (^J) so that we can * translation of carriage return (^M) into newline (^J) so that we can
* tell the difference between the Enter key and Ctrl-J, and disable * tell the difference between the Enter key and Ctrl-J, and disable
* echoing of characters as they're typed. Finally, disable * echoing of characters as they're typed. Finally, disable extended
* interpretation of the special control keys, and if we're not in * input processing, disable interpretation of the special control keys,
* preserve mode, disable interpretation of the flow control characters * and if we're not in preserve mode, disable interpretation of the flow
* too. */ * control characters too. */
void terminal_init(void) void terminal_init(void)
{ {
cbreak(); cbreak();
nonl(); nonl();
noecho(); noecho();
disable_extended_input();
disable_signals(); disable_signals();
if (!ISSET(PRESERVE)) if (!ISSET(PRESERVE))
disable_flow_control(); disable_flow_control();

View File

@ -363,6 +363,7 @@ void allow_pending_sigwinch(bool allow);
#ifndef NANO_SMALL #ifndef NANO_SMALL
void do_toggle(const toggle *which); void do_toggle(const toggle *which);
#endif #endif
void disable_extended_input(void);
void disable_signals(void); void disable_signals(void);
#ifndef NANO_SMALL #ifndef NANO_SMALL
void enable_signals(void); void enable_signals(void);