TTY: Treat carriage return as newline
Before this change, more-prompts and input text -prompts could not be accepted with carriage return. Now, just like in menus, carriage return is treated the same as a newline. To test, use 'stty -icrnl'
This commit is contained in:
@@ -596,6 +596,7 @@ PANICTRACE: PANICTRACE_GDB used wrong value for ARGV0 when launching gdb if
|
|||||||
win32gui: gather raw_print error messages into a single dialog window
|
win32gui: gather raw_print error messages into a single dialog window
|
||||||
win32tty: fix display errors when using a font with double wide or ambiguous
|
win32tty: fix display errors when using a font with double wide or ambiguous
|
||||||
width characters
|
width characters
|
||||||
|
tty: treat carriage return as a newline for input text and more-prompts
|
||||||
|
|
||||||
|
|
||||||
General New Features
|
General New Features
|
||||||
|
|||||||
+2
-6
@@ -129,11 +129,7 @@ getlin_hook_proc hook;
|
|||||||
#endif /* NEWAUTOCOMP */
|
#endif /* NEWAUTOCOMP */
|
||||||
} else
|
} else
|
||||||
tty_nhbell();
|
tty_nhbell();
|
||||||
#if defined(apollo)
|
|
||||||
} else if (c == '\n' || c == '\r') {
|
} else if (c == '\n' || c == '\r') {
|
||||||
#else
|
|
||||||
} else if (c == '\n') {
|
|
||||||
#endif
|
|
||||||
#ifndef NEWAUTOCOMP
|
#ifndef NEWAUTOCOMP
|
||||||
*bufp = 0;
|
*bufp = 0;
|
||||||
#endif /* not NEWAUTOCOMP */
|
#endif /* not NEWAUTOCOMP */
|
||||||
@@ -213,7 +209,7 @@ register const char *s; /* chars allowed besides return */
|
|||||||
!program_state.done_hup &&
|
!program_state.done_hup &&
|
||||||
#endif
|
#endif
|
||||||
(c = tty_nhgetch()) != EOF) {
|
(c = tty_nhgetch()) != EOF) {
|
||||||
if (c == '\n')
|
if (c == '\n' || c == '\r')
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (iflags.cbreak) {
|
if (iflags.cbreak) {
|
||||||
@@ -223,7 +219,7 @@ register const char *s; /* chars allowed besides return */
|
|||||||
morc = '\033';
|
morc = '\033';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if ((s && index(s, c)) || c == x) {
|
if ((s && index(s, c)) || c == x || (x == '\n' && c == '\r')) {
|
||||||
morc = (char) c;
|
morc = (char) c;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1167,6 +1167,8 @@ tty_askname()
|
|||||||
while ((c = tty_nhgetch()) != '\n') {
|
while ((c = tty_nhgetch()) != '\n') {
|
||||||
if (c == EOF)
|
if (c == EOF)
|
||||||
c = '\033';
|
c = '\033';
|
||||||
|
if (c == '\r')
|
||||||
|
break;
|
||||||
if (c == '\033') {
|
if (c == '\033') {
|
||||||
ct = 0;
|
ct = 0;
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user