Commit 67412f13 authored by Matheus Andrade's avatar Matheus Andrade
Browse files

Fixing termios flags on macOS

Accordinng to
If this bit is set, it indicates that the terminal is connected "locally" and that the modem status lines (such as carrier detect) should be ignored.
On many systems if this bit is not set and you call open without the O_NONBLOCK flag set, open blocks until a modem connection is established."

Apparently (by testing and from a tip online), macOS is one of those systems.
parent 3820fba8
......@@ -151,6 +151,9 @@ void ttyopen(CleanString fn, int baudrate, int bytesize, int parity,
tio.c_lflag &= ~(ECHO | ECHONL | ICANON | IEXTEN | ISIG);
// tio.c_lflag |= ICANON;
#ifdef __APPLE__
tio.c_cflag |= CLOCAL;
tcsetattr(*fd, TCSANOW, &tio);
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment