diff -u screen-config/src/ansi.h screen-work/src/ansi.h
--- screen-config/src/ansi.h	2014-03-24 15:38:38.757829579 +0100
+++ screen-work/src/ansi.h	2014-03-24 15:42:39.851136979 +0100
@@ -113,11 +113,8 @@
 
 #define ASCII		 0
 
-#ifdef TOPSTAT
-#define STATLINE	 (0)
-#else
-#define STATLINE	 (D_height-1)
-#endif
+#define STATLINE()	 	(statuspos.row == STATUS_BOTTOM ? D_height-1 : 0)
+#define	STATCOL(width, len)	(statuspos.col == STATUS_LEFT ? 0 : D_width - D_status_len - 2)
 
 #ifdef ENCODINGS
 
Tylko w screen-work/src: ansi.h.orig
Wspólne podkatalogi: screen-config/src/autom4te.cache i screen-work/src/autom4te.cache
diff -u screen-config/src/comm.c screen-work/src/comm.c
--- screen-config/src/comm.c	2014-03-24 15:38:38.758829584 +0100
+++ screen-work/src/comm.c	2014-03-24 15:44:13.113640681 +0100
@@ -296,10 +296,12 @@
   { "silencewait",	ARGS_1 },
   { "sleep",		ARGS_1 },
   { "slowpaste",	NEED_FORE|ARGS_01 },
+  { "sockdir",		ARGS_1 },
   { "sorendition",      ARGS_012 },
   { "source",		ARGS_1 },
   { "split",		NEED_DISPLAY|ARGS_01 },
   { "startup_message",	ARGS_1 },
+  { "status",		ARGS_12 },
   { "stuff",		NEED_LAYER|ARGS_012 },
 #ifdef MULTIUSER
   { "su",		NEED_DISPLAY|ARGS_012 },
diff -u screen-config/src/config.h.in screen-work/src/config.h.in
--- screen-config/src/config.h.in	2014-03-24 15:38:59.000000000 +0100
+++ screen-work/src/config.h.in	2014-03-24 15:58:35.131238353 +0100
@@ -55,11 +55,6 @@
 #undef SOCKDIR
 
 /*
- * Define this if the SOCKDIR is not shared between hosts.
- */
-#define SOCKDIR_IS_LOCAL_TO_HOST
-
-/*
  * Screen can look for the environment variable $SYSSCREENRC and -if it
  * exists- load the file specified in that variable as global screenrc.
  * If you want to enable this feature, define ALLOW_SYSSCREENRC to one (1).
@@ -103,12 +98,6 @@
 #undef LOCKPTY
 
 /*
- * If you'd rather see the status line on the first line of your
- * terminal rather than the last, define TOPSTAT.
- */
-#undef TOPSTAT
-
-/*
  * define DETACH can detach a session. An absolute 'must'.
  */
 #define DETACH
diff -u screen-config/src/display.c screen-work/src/display.c
--- screen-config/src/display.c	2014-03-24 15:38:38.759829590 +0100
+++ screen-work/src/display.c	2014-03-24 15:57:45.933975312 +0100
@@ -126,6 +126,7 @@
 #endif
 int captionalways;
 int hardstatusemu = HSTATUS_IGNORE;
+struct statusposstr statuspos = { STATUS_BOTTOM, STATUS_LEFT };
 
 int focusminwidth, focusminheight;
 
@@ -2016,8 +2017,8 @@
   if (!use_hardstatus || D_has_hstatus == HSTATUS_IGNORE || D_has_hstatus == HSTATUS_MESSAGE)
     {
       D_status = STATUS_ON_WIN;
-      debug1("using STATLINE %d\n", STATLINE);
-      GotoPos(0, STATLINE);
+      debug2("using STATLINE/COL %d,%d\n", STATLINE(), STATCOL(D_width, D_status_len) );
+      GotoPos(STATCOL(D_width, D_status_len), STATLINE());
       SetRendition(&mchar_so);
       InsertMode(0);
       AddStr(msg);
@@ -2053,8 +2054,8 @@
 
       /* this is copied over from RemoveStatus() */
       D_status = 0;
-      GotoPos(0, STATLINE);
-      RefreshLine(STATLINE, 0, D_status_len - 1, 0);
+      GotoPos(STATCOL(D_width, D_status_len), STATLINE());
+      RefreshLine(STATLINE(), STATCOL(D_width, D_status_len), STATCOL(D_width, D_status_len) + D_status_len - 1, 0);
       GotoPos(D_status_lastx, D_status_lasty);
       flayer = D_forecv ? D_forecv->c_layer : 0;
       if (flayer)
@@ -2094,8 +2095,8 @@
     {
       if (captionalways || (D_canvas.c_slperp && D_canvas.c_slperp->c_slnext))
 	{
-	  GotoPos(0, STATLINE);
-	  RefreshLine(STATLINE, 0, D_status_len - 1, 0);
+	  GotoPos(STATCOL(D_width, D_status_len), STATLINE());
+	  RefreshLine(STATLINE(), STATCOL(D_width, D_status_len), STATCOL(D_width, D_status_len) + D_status_len - 1, 0);
 	  GotoPos(D_status_lastx, D_status_lasty);
 	}
     }
@@ -2194,7 +2195,7 @@
 {
   int l, ox, oy, max;
 
-  if (D_status == STATUS_ON_WIN && D_has_hstatus == HSTATUS_LASTLINE && STATLINE == D_height-1)
+  if (D_status == STATUS_ON_WIN && D_has_hstatus == HSTATUS_LASTLINE && STATLINE() == D_height-1)
     return;	/* sorry, in use */
   if (D_blocked)
     return;
@@ -2326,7 +2327,7 @@
   debug2("RefreshLine %d %d", y, from);
   debug2(" %d %d\n", to, isblank);
 
-  if (D_status == STATUS_ON_WIN && y == STATLINE)
+  if (D_status == STATUS_ON_WIN && y == STATLINE())
     {
       if (to >= D_status_len)
 	D_status_len = to + 1;
diff -u screen-config/src/display.h screen-work/src/display.h
--- screen-config/src/display.h	2014-03-24 15:38:38.759829590 +0100
+++ screen-work/src/display.h	2014-03-24 15:59:40.992590603 +0100
@@ -322,5 +322,10 @@
 #define HSTATUS_HS		3
 #define HSTATUS_ALWAYS		(1<<2)
 
+struct statusposstr
+{
+	int	row, col;
+};
+
 #endif /* SCREEN_DISPLAY_H */
 
Wspólne podkatalogi: screen-config/src/doc i screen-work/src/doc
Wspólne podkatalogi: screen-config/src/etc i screen-work/src/etc
diff -u screen-config/src/extern.h screen-work/src/extern.h
--- screen-config/src/extern.h	2014-03-24 15:38:38.766829628 +0100
+++ screen-work/src/extern.h	2014-03-24 16:00:21.803808938 +0100
@@ -345,6 +345,7 @@
 extern int   SendErrorMsg __P((char *, char *));
 extern int   SendAttachMsg __P((int, struct msg *, int));
 extern void  ReceiveRaw __P((int));
+extern int   sockdir;
 
 /* misc.c */
 extern char *SaveStr __P((const char *));
diff -u screen-config/src/process.c screen-work/src/process.c
--- screen-config/src/process.c	2014-03-24 15:38:38.773829666 +0100
+++ screen-work/src/process.c	2014-03-24 15:42:40.247139129 +0100
@@ -73,6 +73,7 @@
 extern int iflag, maxwin;
 extern int focusminwidth, focusminheight;
 extern int use_hardstatus, visual_bell;
+extern struct statusposstr statuspos;
 #ifdef COLOR
 extern int attr2color[][4];
 extern int nattr2color;
@@ -2904,6 +2905,67 @@
       if (msgok)
         OutputMsg(0, "messages displayed on %s", use_hardstatus ? "hardstatus line" : "window");
       break;
+    case RC_STATUS:
+      if (display)
+	{
+	  Msg(0, "%s", "");	/* wait till mintime (keep gcc quiet) */
+          RemoveStatus();
+	}
+      {
+	int	i = 0;
+	while ( (i <= 1) && args[i]) {
+          if ( (strcmp(args[i], "top") == 0) || (strcmp(args[i], "up") == 0) )
+	  {
+	    statuspos.row = STATUS_TOP;
+	  }
+	  else
+	  {
+            if ( (strcmp(args[i], "bottom") == 0) || (strcmp(args[i], "down") == 0) )
+	    {
+	      statuspos.row = STATUS_BOTTOM;
+	    }
+	    else
+	    {
+              if (strcmp(args[i], "left") == 0)
+	      {
+	        statuspos.col = STATUS_LEFT;
+	      }
+              else
+              {
+                if (strcmp(args[i], "right") == 0)
+	        {
+	          statuspos.col = STATUS_RIGHT;
+	        }
+		else
+		{
+	          Msg(0, "%s: usage: status [top|up|down|bottom] [left|right]", rc_name);
+	          break;
+		}
+              }
+	    }
+	  }
+	  i++;
+	}
+      }
+      break;
+    case RC_SOCKDIR:
+      if ( args[0] && (strcmp(args[0], "local") == 0) )
+      {
+        sockdir = SOCKDIR_LOCAL;
+      }
+      else
+      {
+        if ( args[0] && (strcmp(args[0], "shared") == 0) )
+	{
+	  sockdir = SOCKDIR_SHARED;
+	}
+	else
+	{
+	  Msg(0, "%s: usage: sockdir local|shared", rc_name);
+	  break;
+        }
+      }
+      break;
     case RC_CAPTION:
       if (strcmp(args[0], "always") == 0 || strcmp(args[0], "splitonly") == 0)
 	{
Tylko w screen-work/src: process.c.orig
diff -u screen-config/src/screen.h screen-work/src/screen.h
--- screen-config/src/screen.h	2014-03-24 15:38:38.774829672 +0100
+++ screen-work/src/screen.h	2014-03-24 16:01:21.349127588 +0100
@@ -311,3 +311,7 @@
 #define WLIST_NUM 0
 #define WLIST_MRU 1
 #define WLIST_NESTED 2
+
+/* sockdir values */
+#define	SOCKDIR_LOCAL	0	/* single host, default */
+#define	SOCKDIR_SHARED	1	/* many hosts use the socket directory, e.g. via NFS */
diff -u screen-config/src/socket.c screen-work/src/socket.c
--- screen-config/src/socket.c	2014-03-24 15:38:38.775829678 +0100
+++ screen-work/src/socket.c	2014-03-24 15:42:40.331139583 +0100
@@ -61,6 +61,7 @@
 static void  FinishAttach __P((struct msg *));
 static void  FinishDetach __P((struct msg *));
 static void  AskPassword __P((struct msg *));
+int sockdir = SOCKDIR_LOCAL;
 
 
 extern char *RcFileName, *extra_incap, *extra_outcap;
Tylko w screen-work/src: socket.c.orig
Wspólne podkatalogi: screen-config/src/terminfo i screen-work/src/terminfo
Wspólne podkatalogi: screen-config/src/utf8encodings i screen-work/src/utf8encodings
