> The main block of this code looks identical to the BSD specific code > just underneath (#ifdef TIOCNOTTY), is there a reason we can’t reuse > that? I don't see why not. Proposed patch attached; please give it a try as I don't use macOS.