Fix error applying new stdout settings

On Fedora 26 tio will quit with the following error message:

"Error: Could not apply new stdout settings (Invalid argument)"

In case of Fedora, it turns out that the new stdout settings used are a
bit too agressive because an empty termios structure is used. To remedy
this we reuse the existing stdout settings and only reconfigure the
specific options we need to make a "raw" stdout configuration.
This commit is contained in:
Martin Lund 2017-10-15 23:15:49 +02:00
parent a96bfc5745
commit 288a88aa15

View file

@ -173,13 +173,11 @@ void stdout_configure(void)
}
/* Prepare new stdout settings */
memset(&new_stdout, 0, sizeof(new_stdout));
memcpy(&new_stdout, &old_stdout, sizeof(old_stdout));
/* Control, input, output, local modes for stdout */
new_stdout.c_cflag = 0;
new_stdout.c_iflag = 0;
new_stdout.c_oflag = 0;
new_stdout.c_lflag = 0;
/* Reconfigure stdout (RAW configuration) */
new_stdout.c_oflag &= ~(OPOST);
new_stdout.c_lflag &= ~(ECHO|ICANON|ISIG|ECHOE|ECHOK|ECHONL);
/* Control characters */
new_stdout.c_cc[VTIME] = 0; /* Inter-character timer unused */