Apple's changes between upstream screen-4.0.3
and their release of screen, called screen-22.
You can view the screen-22 source at
https://opensource.apple.com/tarballs/screen/
Upstream screen-4.0.3 is released under the GPLv2,
so Apple's changes (this patch) is a derivative work and
also licensed under the GPLv2.
This patch was then rebased against the latest upstream
GNU Screen, which was version 4.6.2 and no longer required
many of Apple's changes. This was done by David Gilman
diff -rU 3 screen-4.6.2-orig/screen.c screen-4.6.2/screen.c
--- screen.c 2018-08-22 14:34:15.477730848 -0400
+++ screen.c 2018-08-22 14:53:19.778162637 -0400
#include "logfile.h" /* islogfile, logfflush, logfopen/logfclose */
+#include <TargetConditionals.h>
Panic(0, "No $SCREENDIR with multi screens, please.");
+ else if (!multi && real_uid == eff_uid) {
+ static char DarwinSockDir[PATH_MAX];
+ if (confstr(_CS_DARWIN_USER_TEMP_DIR, DarwinSockDir, sizeof(DarwinSockDir))) {
+ strlcat(DarwinSockDir, ".screen", sizeof(DarwinSockDir));
+ SockDir = DarwinSockDir;
freopen("/dev/null", "w", stderr);
debug("-- screen.back debug started\n");
+#if defined(__APPLE__) && !TARGET_OS_EMBEDDED
+ if (_vprocmgr_detach_from_console(0) != NULL)
+ errx(1, "can't detach from console");
/* This guarantees that the session owner is listed, even when we
* start detached. From now on we should not refer to 'LoginName'
* any more, use users->u_name instead.
diff -rU 3 screen-4.6.2-orig/socket.c screen-4.6.2/socket.c
--- socket.c 2018-08-22 14:34:15.476989022 -0400
+++ socket.c 2018-08-22 14:39:24.526567573 -0400