aboutsummaryrefslogtreecommitdiff
path: root/loginutils
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2014-10-02 13:45:21 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2014-10-02 13:45:21 +0200
commitcf76b5ce12a685b0c0a8ea53fa95cb0f0922a4f1 (patch)
treea69fc46fd6715d31438e57fbb36fb34a48ad1ac4 /loginutils
parentd3fe9602714e01b228fa0c625901e748912a7775 (diff)
downloadbusybox-cf76b5ce12a685b0c0a8ea53fa95cb0f0922a4f1.tar.gz
getty: set tty attrs so that control chars are shown as ^c
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'loginutils')
-rw-r--r--loginutils/getty.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/loginutils/getty.c b/loginutils/getty.c
index 4b1b73bef..174542841 100644
--- a/loginutils/getty.c
+++ b/loginutils/getty.c
@@ -334,18 +334,19 @@ static void finalize_tty_attrs(void)
* observed to improve backspacing through Unicode chars
*/
- /* line buffered input (NL or EOL or EOF chars end a line);
- * recognize INT/QUIT/SUSP chars;
- * echo input chars;
- * echo BS-SP-BS on erase character;
- * echo kill char specially, not as ^c (ECHOKE controls how exactly);
- * erase all input via BS-SP-BS on kill char (else go to next line)
+ /* ICANON line buffered input (NL or EOL or EOF chars end a line);
+ * ISIG recognize INT/QUIT/SUSP chars;
+ * ECHO echo input chars;
+ * ECHOE echo BS-SP-BS on erase character;
+ * ECHOK echo kill char specially, not as ^c (ECHOKE controls how exactly);
+ * ECHOKE erase all input via BS-SP-BS on kill char (else go to next line)
+ * ECHOCTL Echo ctrl chars as ^c (else echo verbatim:
+ * e.g. up arrow emits "ESC-something" and thus moves cursor up!)
*/
- G.tty_attrs.c_lflag |= ICANON | ISIG | ECHO | ECHOE | ECHOK | ECHOKE;
+ G.tty_attrs.c_lflag |= ICANON | ISIG | ECHO | ECHOE | ECHOK | ECHOKE | ECHOCTL;
/* Other bits in c_lflag:
* XCASE Map uppercase to \lowercase [tried, doesn't work]
* ECHONL Echo NL even if ECHO is not set
- * ECHOCTL Echo ctrl chars as ^c (else don't echo) - maybe set this?
* ECHOPRT On erase, echo erased chars
* [qwe<BS><BS><BS> input looks like "qwe\ewq/" on screen]
* NOFLSH Don't flush input buffer after interrupt or quit chars