* Tom Scogland on Thursday, June 26, 2008 at 07:21:55 -0500
> I've been a screen user for a few years on linux, but when switching
> to osx as my primary os not too long ago (long story...) I found the
> current development versions wont build.  The issue was just a #ifdef
> that was checking the wrong item, patch attached. (sorry if this isn't
> the right place, given recent activity it seemed like the best idea)

I always apply attached patch that apple apparently uses for its
shipped screen w/o probs.

<http://www.opensource.apple.com/darwinsource/tarballs/other/screen-11.tar.gz>

> There is one other issue however that I'm having much worse trouble
> tracking down.  On osx if I specify that screen should use
> screen-256color-bce as its TERM, it fails back to vt100 and all
> features disappear, once this happens I can't change screen's internal
> term through ^a:term it just sticks there.  As a temporary measure I'm
> having it use xterm-256color, but I would like to find/fix the issue,
> if anyone knows where I might look for that it would be very helpful.
> Oh, and that term value works fine on linux and the terminfo file is
> in the path in 3 seperate places... so it shouldn't be a path issue.

FWIW, I can't reproduce this. Is this within Terminal.app?
Because there nsterm family is recommended -- only works up to
nsterm-16color though with recent ncurses.

Within X11 xterm both xterm-256color and xterm-256color-bce work
for me -- personally I prefer w/o bce as in some apps (mutt) the
drawing of menu bars do not span the whole width.

This is on MacOS 10.4.11. For Leopard I don't know.

c
-- 
  Was heißt hier Dogma, ich bin Underdogma!
[ What the hell do you mean dogma, I am underdogma. ]

_F R E E_  _V I D E O S_  -->>  http://www.blacktrash.org/underdogma/
diff --git a/src/Makefile.in b/src/Makefile.in
index 3035e51..6de77b1 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -79,7 +79,7 @@ install_bin: .version screen
 	-if [ -f $(DESTDIR)$(bindir)/screen ] && [ ! -f $(DESTDIR)$(bindir)/screen.old ]; then mv $(DESTDIR)$(bindir)/screen $(DESTDIR)$(bindir)/screen.old; fi
 	rm -f $(DESTDIR)$(bindir)/screen
 	(cd $(DESTDIR)$(bindir) && ln -f -s $(SCREEN) screen)
-	cp $(srcdir)/utf8encodings/?? $(DESTDIR)$(SCREENENCODINGS)
+	cp $(srcdir)/utf8encodings/?? $(DSTROOT)$(SCREENENCODINGS)
 
 ###############################################################################
 install: installdirs install_bin
@@ -95,7 +95,7 @@ install: installdirs install_bin
 
 installdirs:
 # Path leading to ETCSCREENRC and Socketdirectory not checked.
-	$(srcdir)/etc/mkinstalldirs $(DESTDIR)$(bindir) $(DESTDIR)$(SCREENENCODINGS)
+	$(srcdir)/etc/mkinstalldirs $(DESTDIR)$(bindir) $(DSTROOT)$(SCREENENCODINGS)
 	cd doc ; $(MAKE) installdirs
 
 uninstall: .version
@@ -122,7 +122,7 @@ tty.c:	tty.sh
 	sh $(srcdir)/tty.sh tty.c
 
 comm.h: comm.c comm.sh config.h
-	AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh
+	AWK=$(AWK) srcdir=${srcdir} sh $(srcdir)/comm.sh
 
 osdef.h: osdef.sh config.h osdef.h.in
 	CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh
diff --git a/src/config.h.in b/src/config.h.in
index ebac18a..a0d9308 100644
--- a/src/config.h.in
+++ b/src/config.h.in
@@ -208,14 +208,14 @@
  * If screen is installed with permissions to update /etc/utmp (such
  * as if it is installed set-uid root), define UTMPOK.
  */
-#define UTMPOK
+#undef UTMPOK
 
 /* Set LOGINDEFAULT to one (1)
  * if you want entries added to /etc/utmp by default, else set it to
  * zero (0).
  * LOGINDEFAULT will be one (1) whenever LOGOUTOK is undefined!
  */
-#define LOGINDEFAULT	1
+#undef LOGINDEFAULT
 
 /* Set LOGOUTOK to one (1)
  * if you want the user to be able to log her/his windows out.
@@ -231,7 +231,7 @@
  * Set CAREFULUTMP to one (1) if you want that users have at least one
  * window per screen session logged in.
  */
-#define LOGOUTOK 1
+#undef LOGOUTOK
 #undef CAREFULUTMP
 
 
diff --git a/src/configure b/src/configure
index 3a6b754..b9726aa 100755
--- a/src/configure
+++ b/src/configure
@@ -5572,7 +5572,7 @@ cat >>conftest.$ac_ext <<_ACEOF
 
 #include <time.h> /* to get time_t on SCO */
 #include <sys/types.h>
-#if defined(__SVR4) && !defined(DGUX)
+#if (defined(__SVR4) || defined(__APPLE__)) && !defined(DGUX)
 #include <utmpx.h>
 #define utmp utmpx
 #else
@@ -5581,6 +5581,10 @@ cat >>conftest.$ac_ext <<_ACEOF
 #ifdef __hpux
 #define pututline _pututline
 #endif
+#ifdef __APPLE__
+#define pututline pututxline
+#define getutent getutxent
+#endif
 
 int
 main ()
diff --git a/src/etc/etcscreenrc b/src/etc/etcscreenrc
index 3fc9c37..d2caeae 100644
--- a/src/etc/etcscreenrc
+++ b/src/etc/etcscreenrc
@@ -10,7 +10,7 @@
 
 #defflow on # will force screen to process ^S/^Q
 
-deflogin on
+#deflogin on
 #autodetach off
 
 vbell on
@@ -88,7 +88,7 @@ bind ^\
 #make them better
 bind \\ quit
 bind K kill
-bind I login on
-bind O login off
+#bind I login on
+#bind O login off
 bind } history
 
diff --git a/src/pty.c b/src/pty.c
index f89d44c..38e9709 100644
--- a/src/pty.c
+++ b/src/pty.c
@@ -34,7 +34,7 @@
 #endif
 
 /* for solaris 2.1, Unixware (SVR4.2) and possibly others */
-#ifdef HAVE_SVR4_PTYS
+#if defined(HAVE_SVR4_PTYS) && !defined(__APPLE__)
 # include <sys/stropts.h>
 #endif
 
diff --git a/src/window.c b/src/window.c
index a244bd4..21bce82 100644
--- a/src/window.c
+++ b/src/window.c
@@ -25,6 +25,7 @@
 #include <sys/stat.h>
 #include <signal.h>
 #include <fcntl.h>
+#include <unistd.h>
 #ifndef sun
 # include <sys/ioctl.h>
 #endif
@@ -1419,6 +1420,38 @@ char **args, *ttyn;
   return pid;
 }
 
+#ifdef RUN_LOGIN
+/*
+ * All of the logic to maintain utmpx is now built into /usr/bin/login, so
+ * all we need to do is call it, and pass the shell command to it.
+ */
+extern char *LoginName;
+
+static int
+run_login(const char *path, char *const argv[], char *const envp[])
+{
+  const char *shargs[MAXARGS + 1 + 3];
+  const char **fp, **tp;
+
+  if (access(path, X_OK) < 0)
+    return -1;
+  shargs[0] = "login";
+  shargs[1] = (*argv[0] == '-') ? "-pfq" : "-pflq";
+  shargs[2] = LoginName;
+  shargs[3] = path;
+  fp = (const char **)argv + 1;
+  tp = shargs + 4;
+  /* argv has already been check for length */
+  while ((*tp++ = *fp++) != NULL) {}
+  /* shouldn't return unless there was an error */
+  return (execve("/usr/bin/login", (char *const*)shargs, envp));
+}
+
+/* replace the following occurrences of execve() with run_login() */
+#define execve run_login
+
+#endif /* RUN_LOGIN */
+
 void
 execvpe(prog, args, env)
 char *prog, **args, **env;

Reply via email to