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:
Pasi Kallinen
2017-11-14 16:14:06 +02:00
parent b4b3dedd59
commit 59d4ac02f7
3 changed files with 5 additions and 6 deletions
+2
View File
@@ -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;