diff --git a/src/tty.c b/src/tty.c index 4d5e136..3eee2b7 100644 --- a/src/tty.c +++ b/src/tty.c @@ -1293,6 +1293,10 @@ void handle_command_sequence(char input_char, char *output_char, bool *forward) tio_printf("Turn off raw mode for non-interactive use"); break; } + if (state != STATE_INTERACTIVE) + { + tty_tcsetattr(device_fd); + } break; case KEY_SHIFT_J: @@ -1311,6 +1315,10 @@ void handle_command_sequence(char input_char, char *output_char, bool *forward) tio_printf("Turn off raw mode for interactive use"); break; } + if (state == STATE_INTERACTIVE) + { + tty_tcsetattr(device_fd); + } break; case KEY_K: