summaryrefslogtreecommitdiff
authorRay Strode <rstrode@redhat.com>2010-06-30 23:43:16 (GMT)
committer Ray Strode <rstrode@redhat.com>2010-06-30 23:43:16 (GMT)
commit4081bd29fb471a93daba746643419d858f06bdfe (patch) (side-by-side diff)
tree040895fc9191de5552ecf929a2d0b6a8219f00b8
parent3875c30854b4e2aa1d23b077609c8b088f85110a (diff)
downloadplymouth-4081bd29fb471a93daba746643419d858f06bdfe.zip
plymouth-4081bd29fb471a93daba746643419d858f06bdfe.tar.gz
[terminal] Force enter to output newline
This matches the default unix behavior, and so we're going to be a lot more robust against our terminal settings getting mucked with.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/libply-splash-core/ply-keyboard.c2
-rw-r--r--src/libply-splash-core/ply-terminal.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/libply-splash-core/ply-keyboard.c b/src/libply-splash-core/ply-keyboard.c
index 0f26bb4..b5b4c39 100644
--- a/src/libply-splash-core/ply-keyboard.c
+++ b/src/libply-splash-core/ply-keyboard.c
@@ -45,7 +45,7 @@
#define KEY_CTRL_W ('\100' ^'W')
#define KEY_CTRL_V ('\100' ^'V')
#define KEY_ESCAPE ('\100' ^'[')
-#define KEY_RETURN '\r'
+#define KEY_RETURN '\n'
#define KEY_BACKSPACE '\177'
typedef void (* ply_keyboard_handler_t) (void *);
diff --git a/src/libply-splash-core/ply-terminal.c b/src/libply-splash-core/ply-terminal.c
index 6140fa4..028551d 100644
--- a/src/libply-splash-core/ply-terminal.c
+++ b/src/libply-splash-core/ply-terminal.c
@@ -182,6 +182,9 @@ ply_terminal_set_unbuffered_input (ply_terminal_t *terminal)
cfmakeraw (&term_attributes);
+ /* Make return output new line like canonical mode */
+ term_attributes.c_iflag |= ICRNL;
+
/* Make \n return go to the beginning of the next line */
term_attributes.c_oflag |= ONLCR;