Use raw mode if _POSIX_VDISABLE isn't available, to allow support under cygwin

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@210 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
master
Chris Allegretta 2000-09-06 15:19:18 +00:00
parent 43932bd17b
commit 9239d742d6
3 changed files with 31 additions and 6 deletions

View File

@ -6,6 +6,10 @@ CVS code -
do_cut_text()
- Don't immediately abort if we're on filebot and the marker is
set (fixes bug #42).
- nano.c:
- main()
- Added check for _POSIX_VDISABLE and use raw mode if not
available, allows nano to work with cygwin.
nano-0.9.17 - 09/04/2000
- General

21
nano.c
View File

@ -1825,11 +1825,13 @@ int main(int argc, char *argv[])
/* First back up the old settings so they can be restored, duh */
tcgetattr(0, &oldterm);
#ifdef _POSIX_VDISABLE
term = oldterm;
term.c_cc[VINTR] = _POSIX_VDISABLE;
term.c_cc[VQUIT] = _POSIX_VDISABLE;
term.c_lflag &= ~IEXTEN;
tcsetattr(0, TCSANOW, &term);
#endif
/* now ncurses init stuff... */
initscr();
@ -1886,6 +1888,12 @@ int main(int argc, char *argv[])
reset_cursor();
while (1) {
#ifndef _POSIX_VDISABLE
/* We're going to have to do it the old way, i.e. on cygwin */
raw();
#endif
kbinput = wgetch(edit);
if (kbinput == 27) { /* Grab Alt-key stuff first */
switch (kbinput = wgetch(edit)) {
@ -1981,6 +1989,19 @@ int main(int argc, char *argv[])
keyhandled = 1;
}
}
#ifndef _POSIX_VDISABLE
/* Since we're in raw mode, we have to catch ^Q and ^S */
if (kbinput == 17 || kbinput == 19)
keyhandled = 1;
/* And catch ^Z by hand when triggered */
if (kbinput == 26) {
if (ISSET(SUSPEND))
do_suspend(0);
keyhandled = 1;
}
#endif
/* Last gasp, stuff that's not in the main lists */
if (!keyhandled)
switch (kbinput) {

View File

@ -6,7 +6,7 @@
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2000-09-06 10:16-0400\n"
"POT-Creation-Date: 2000-09-06 11:26-0400\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -675,24 +675,24 @@ msgstr ""
msgid "Cannot move bottom win"
msgstr ""
#: nano.c:1850
#: nano.c:1852
msgid "Main: set up windows\n"
msgstr ""
#: nano.c:1865
#: nano.c:1867
msgid "Main: bottom win\n"
msgstr ""
#: nano.c:1871
#: nano.c:1873
msgid "Main: open file\n"
msgstr ""
#: nano.c:1939
#: nano.c:1947
#, c-format
msgid "I got Alt-[-%c! (%d)\n"
msgstr ""
#: nano.c:1965
#: nano.c:1973
#, c-format
msgid "I got Alt-%c! (%d)\n"
msgstr ""