diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 04d4f53a1..c064ebb7f 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -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 win32tty: fix display errors when using a font with double wide or ambiguous width characters +tty: treat carriage return as a newline for input text and more-prompts General New Features diff --git a/win/tty/getline.c b/win/tty/getline.c index f3dd6cbf2..a73fa4060 100644 --- a/win/tty/getline.c +++ b/win/tty/getline.c @@ -129,11 +129,7 @@ getlin_hook_proc hook; #endif /* NEWAUTOCOMP */ } else tty_nhbell(); -#if defined(apollo) } else if (c == '\n' || c == '\r') { -#else - } else if (c == '\n') { -#endif #ifndef NEWAUTOCOMP *bufp = 0; #endif /* not NEWAUTOCOMP */ @@ -213,7 +209,7 @@ register const char *s; /* chars allowed besides return */ !program_state.done_hup && #endif (c = tty_nhgetch()) != EOF) { - if (c == '\n') + if (c == '\n' || c == '\r') break; if (iflags.cbreak) { @@ -223,7 +219,7 @@ register const char *s; /* chars allowed besides return */ morc = '\033'; break; } - if ((s && index(s, c)) || c == x) { + if ((s && index(s, c)) || c == x || (x == '\n' && c == '\r')) { morc = (char) c; break; } diff --git a/win/tty/wintty.c b/win/tty/wintty.c index 821239c68..32dc6b3c5 100644 --- a/win/tty/wintty.c +++ b/win/tty/wintty.c @@ -1167,6 +1167,8 @@ tty_askname() while ((c = tty_nhgetch()) != '\n') { if (c == EOF) c = '\033'; + if (c == '\r') + break; if (c == '\033') { ct = 0; break;