mirror of
https://github.com/tio/tio.git
synced 2026-05-01 14:57:59 +02:00
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:
parent
a96bfc5745
commit
288a88aa15
1 changed files with 4 additions and 6 deletions
10
src/tty.c
10
src/tty.c
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue