--- screen.c.orig	2024-08-29 03:55:03.000000000 +0800
+++ screen.c	2024-09-07 14:59:55.000000000 +0800
@@ -59,7 +59,12 @@
 #include "utmp.h"
 #include "winmsg.h"
 
+#ifdef __APPLE__
+#include <crt_externs.h>
+#define environ (*_NSGetEnviron())
+#else
 extern char **environ;
+#endif
 
 int           force_vt = 1;
 int           VBellWait;
