tty: support IUCLC since we support OLCUC

This commit is contained in:
K. Lange 2023-02-17 09:00:22 +09:00
parent ee7d2e76b4
commit 81cf0f729e
2 changed files with 6 additions and 0 deletions

View File

@ -170,6 +170,7 @@ static int show_settings(int all) {
print_iflag("ixany", IXANY, 0);
print_iflag("ixoff", IXOFF, 0);
print_iflag("ixon", IXON, 0);
print_iflag("iuclc", IUCLC, 0);
print_iflag("parmrk", PARMRK, 0);
if (printed) { fprintf(stdout, "\n"); printed = 0; }
@ -323,6 +324,7 @@ int main(int argc, char * argv[]) {
set_iflag("ixon", IXON);
set_iflag("ixany", IXANY);
set_iflag("ixoff", IXOFF);
set_iflag("iuclc", IUCLC);
set_oflag("olcuc", OLCUC);
set_oflag("opost", OPOST);

View File

@ -178,6 +178,10 @@ void tty_input_process(pty_t * pty, uint8_t c) {
c = '\n';
}
if ((pty->tios.c_iflag & IUCLC) && (c >= 'A' && c <= 'Z')) {
c = c - 'A' + 'a';
}
if (pty->tios.c_lflag & ICANON) {
if (c == pty->tios.c_cc[VLNEXT] && (pty->tios.c_lflag & IEXTEN)) {