mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
tty: fix ECHOCTL
This commit is contained in:
+9
-9
@@ -52,6 +52,15 @@ void tty_process(tty_t *tty, char c) {
|
|||||||
|
|
||||||
// TODO VSTART VSTOP
|
// TODO VSTART VSTOP
|
||||||
|
|
||||||
|
char echoc = (tty->termios.c_lflag & ECHO) ? c : '\0';
|
||||||
|
|
||||||
|
// echo control characters
|
||||||
|
if ((tty->termios.c_lflag & ECHOCTL) && (tty->termios.c_lflag & ECHO) && c < 32 && c != '\n' && c != '\r' && c != '\b' && c != '\t' && c != '\e') {
|
||||||
|
char tmp[2] = {'^', c + 0x40};
|
||||||
|
tty->writetodevice(tty->deviceinternal, tmp, 2);
|
||||||
|
echoc = false;
|
||||||
|
}
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ISIG) {
|
if (tty->termios.c_lflag & ISIG) {
|
||||||
int signal = -1;
|
int signal = -1;
|
||||||
if (tty->termios.c_cc[VINTR] == c)
|
if (tty->termios.c_cc[VINTR] == c)
|
||||||
@@ -71,15 +80,6 @@ void tty_process(tty_t *tty, char c) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char echoc = (tty->termios.c_lflag & ECHO) ? c : '\0';
|
|
||||||
|
|
||||||
// echo control characters
|
|
||||||
if ((tty->termios.c_lflag & ECHOCTL) && c < 32 && c != '\n' && c != '\r' && c != '\b' && c != '\t' && c != '\e') {
|
|
||||||
char tmp[2] = {'^', c + 0x40};
|
|
||||||
tty->writetodevice(tty->deviceinternal, tmp, 2);
|
|
||||||
echoc = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tty->termios.c_lflag & ICANON) {
|
if (tty->termios.c_lflag & ICANON) {
|
||||||
bool flush = false;
|
bool flush = false;
|
||||||
if (c == tty->termios.c_cc[VERASE]) {
|
if (c == tty->termios.c_cc[VERASE]) {
|
||||||
|
|||||||
Reference in New Issue
Block a user