Skip to content

Commit

Permalink
Handle SIGWINCH in main thread
Browse files Browse the repository at this point in the history
For the SIGWINCH signal to be caught, it needs to be set in sigaction
on the main thread. Previously, this was broken, and updateWindowSize
was never being called. Tested on macOS 10.14.
  • Loading branch information
matthewbauer committed Jun 5, 2019
1 parent fb0ad89 commit 4a3e962
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/libmain/shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ void initNix()
act.sa_handler = sigHandler;
if (sigaction(SIGUSR1, &act, 0)) throw SysError("handling SIGUSR1");

/* Make sure SIGWINCH is handled as well. */
if (sigaction(SIGWINCH, &act, 0)) throw SysError("handling SIGWINCH");

/* Register a SIGSEGV handler to detect stack overflows. */
detectStackOverflow();

Expand Down

0 comments on commit 4a3e962

Please sign in to comment.