diff --git a/abduco.c b/abduco.c index 6c58a27..8cc5908 100644 --- a/abduco.c +++ b/abduco.c @@ -350,7 +350,7 @@ static bool attach_session(const char *name) { cur_term.c_cc[VLNEXT] = _POSIX_VDISABLE; cur_term.c_cc[VMIN] = 1; cur_term.c_cc[VTIME] = 0; - tcsetattr(0, TCSADRAIN, &cur_term); + tcsetattr(STDIN_FILENO, TCSADRAIN, &cur_term); int status = client_mainloop(); client_restore_terminal(); diff --git a/client.c b/client.c index b60d326..87a62fc 100644 --- a/client.c +++ b/client.c @@ -30,7 +30,7 @@ static void client_show_cursor() { static void client_restore_terminal() { if (has_term) - tcsetattr(0, TCSADRAIN, &orig_term); + tcsetattr(STDIN_FILENO, TCSADRAIN, &orig_term); client_show_cursor(); } @@ -44,7 +44,7 @@ static int client_mainloop() { if (client.need_resize) { struct winsize ws; - if (ioctl(0, TIOCGWINSZ, &ws) != -1) { + if (ioctl(STDIN_FILENO, TIOCGWINSZ, &ws) != -1) { Packet pkt = { .type = MSG_RESIZE, .u = { .ws = ws },