From: Gerd Möllmann Date: Wed, 13 Mar 2024 19:27:20 +0000 (+0100) Subject: ns_select fix for macOS terminals (bug#69561) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=78c38ec5f0319af6f6fe3d8366d5317fcd23e1af;p=emacs.git ns_select fix for macOS terminals (bug#69561) * src/nsterm.m (ns_select_1): Return early for terminals. (cherry picked from commit d95f2a882d5f0587a8e02c5be6f0fd005d4a6a43) --- diff --git a/src/nsterm.m b/src/nsterm.m index f161edc4ac2..faf9324402b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -4757,8 +4757,12 @@ ns_select_1 (int nfds, fd_set *readfds, fd_set *writefds, if (writefds && FD_ISSET(k, writefds)) ++nr; } - if (NSApp == nil - || ![NSThread isMainThread] + /* emacs -nw doesn't have an NSApp, so we're done. */ + if (NSApp == nil) + return thread_select (pselect, nfds, readfds, writefds, exceptfds, + timeout, sigmask); + + if (![NSThread isMainThread] || (timeout && timeout->tv_sec == 0 && timeout->tv_nsec == 0)) thread_select (pselect, nfds, readfds, writefds, exceptfds, timeout, sigmask);