diff -ru screen-4.0.2/ansi.h screen-4.0.2-rzm/ansi.h --- screen-4.0.2/ansi.h 2003-02-24 17:55:08.000000000 +0100 +++ screen-4.0.2-rzm/ansi.h 2003-12-16 13:23:15.000000000 +0100 @@ -108,11 +108,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 diff -ru screen-4.0.2/comm.c screen-4.0.2-rzm/comm.c --- screen-4.0.2/comm.c 2003-09-08 16:25:08.000000000 +0200 +++ screen-4.0.2-rzm/comm.c 2003-12-16 13:23:15.000000000 +0100 @@ -282,10 +282,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_0 }, { "startup_message", ARGS_1 }, + { "status", ARGS_12 }, { "stuff", NEED_LAYER|ARGS_12 }, #ifdef MULTIUSER { "su", NEED_DISPLAY|ARGS_012 }, Tylko w screen-4.0.2-rzm: config.h diff -ru screen-4.0.2/config.h.in screen-4.0.2-rzm/config.h.in --- screen-4.0.2/config.h.in 2003-12-05 14:59:39.000000000 +0100 +++ screen-4.0.2-rzm/config.h.in 2003-12-16 13:23:15.000000000 +0100 @@ -54,11 +54,6 @@ #undef SOCKDIR /* - * Define this if the SOCKDIR is not shared between hosts. - */ -#define SOCKDIR_IS_LOCAL_TO_HOST - -/* * Screen sources two startup files. First a global file with a path * specified here, second your local $HOME/.screenrc * Don't define this, if you don't want it. @@ -119,12 +114,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 Tylko w screen-4.0.2-rzm: config.log Tylko w screen-4.0.2-rzm: config.status diff -ru screen-4.0.2/display.c screen-4.0.2-rzm/display.c --- screen-4.0.2/display.c 2003-12-05 14:45:41.000000000 +0100 +++ screen-4.0.2-rzm/display.c 2003-12-16 13:23:15.000000000 +0100 @@ -120,6 +120,7 @@ #endif int captionalways; int hardstatusemu = HSTATUS_IGNORE; +struct statusposstr statuspos = { STATUS_BOTTOM, STATUS_LEFT }; /* * Default layer management @@ -2277,8 +2278,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); @@ -2314,8 +2315,8 @@ ASSERT(D_obuffree == D_obuflen); /* 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) @@ -2365,8 +2366,8 @@ oldflayer = flayer; if (where == STATUS_ON_WIN) { - 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); } else @@ -2385,7 +2386,7 @@ { int l, i, 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; @@ -2519,7 +2520,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()) return; /* can't refresh status */ if (isblank == 0 && D_CE && to == D_width - 1 && from < to) diff -ru screen-4.0.2/display.h screen-4.0.2-rzm/display.h --- screen-4.0.2/display.h 2003-07-01 16:01:42.000000000 +0200 +++ screen-4.0.2-rzm/display.h 2003-12-16 13:23:15.000000000 +0100 @@ -343,3 +343,13 @@ #define HSTATUS_MESSAGE 2 #define HSTATUS_HS 3 #define HSTATUS_ALWAYS (1<<2) + +struct statusposstr +{ + int row, col; +}; + +#define STATUS_TOP 1 +#define STATUS_BOTTOM 0 +#define STATUS_LEFT 0 +#define STATUS_RIGHT 1 Tylko w screen-4.0.2-rzm/doc: Makefile diff -ru screen-4.0.2/doc/screen.1 screen-4.0.2-rzm/doc/screen.1 --- screen-4.0.2/doc/screen.1 2003-12-05 14:51:57.000000000 +0100 +++ screen-4.0.2-rzm/doc/screen.1 2004-06-18 03:54:02.000000000 +0200 @@ -2673,6 +2673,14 @@ text. .sp .ne 3 +.B sockdir local\fR|\fBshared +.PP +.B shared +means that the sockets directory may be shared between various hosts and +.I screen -wipe +command will NOT wipe non-local sockets. +.sp +.ne 3 .BI "source " file .PP Read and execute commands from file \fIfile\fP. Source commands may @@ -2710,6 +2718,14 @@ Default is `on', as you probably noticed. .sp .ne 3 +.BR "status " [ top | up | down | bottom ] +.RB [ left | right ] +.PP +The status window by default is in bottom-left corner. This command can move +status messages to any corner of the screen. \fBtop\fR is the same as \fBup\fR, +\fBdown\fR is the same as \fBbottom\fR. +.sp +.ne 3 .B stuff .I string .PP diff -ru screen-4.0.2/etc/screenrc screen-4.0.2-rzm/etc/screenrc --- screen-4.0.2/etc/screenrc 2003-12-05 14:59:39.000000000 +0100 +++ screen-4.0.2-rzm/etc/screenrc 2003-12-16 13:23:15.000000000 +0100 @@ -32,6 +32,12 @@ defscrollback 1000 +# more convenient status messages location +# status top right + +# in shared mode screen will not wipe out sockets of another hosts sharing the same socket directory +# sockdir shared + # don't kill window after the process died # zombie "^[" diff -ru screen-4.0.2/extern.h screen-4.0.2-rzm/extern.h --- screen-4.0.2/extern.h 2003-08-22 14:27:57.000000000 +0200 +++ screen-4.0.2-rzm/extern.h 2003-12-16 13:23:15.000000000 +0100 @@ -335,6 +335,7 @@ extern void ReceiveMsg __P((void)); extern void SendCreateMsg __P((char *, struct NewWindow *)); extern int SendErrorMsg __P((char *, char *)); +extern int sockdir; /* misc.c */ extern char *SaveStr __P((const char *)); diff -ru screen-4.0.2/process.c screen-4.0.2-rzm/process.c --- screen-4.0.2/process.c 2003-09-18 14:53:54.000000000 +0200 +++ screen-4.0.2-rzm/process.c 2003-12-16 13:23:15.000000000 +0100 @@ -60,6 +60,7 @@ extern int TtyMode, auto_detach, use_altscreen; extern int iflag, maxwin; extern int use_hardstatus, visual_bell; +extern struct statusposstr statuspos; #ifdef COLOR extern int attr2color[][4]; extern int nattr2color; @@ -2663,6 +2664,67 @@ if (msgok) Msg(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) { diff -ru screen-4.0.2/screen.h screen-4.0.2-rzm/screen.h --- screen-4.0.2/screen.h 2003-08-22 14:28:43.000000000 +0200 +++ screen-4.0.2-rzm/screen.h 2003-12-16 13:26:32.000000000 +0100 @@ -293,3 +293,7 @@ */ #define WLIST_NUM 0 #define WLIST_MRU 1 + +/* sockdir values */ +#define SOCKDIR_LOCAL 0 /* single host, default */ +#define SOCKDIR_SHARED 1 /* many hosts use the socket directory, e.g. via NFS */ diff -ru screen-4.0.2/socket.c screen-4.0.2-rzm/socket.c --- screen-4.0.2/socket.c 2003-09-08 16:26:50.000000000 +0200 +++ screen-4.0.2-rzm/socket.c 2003-12-16 13:23:15.000000000 +0100 @@ -54,6 +54,7 @@ #endif static void FinishAttach __P((struct msg *)); static void AskPassword __P((struct msg *)); +int sockdir = SOCKDIR_LOCAL; extern char *RcFileName, *extra_incap, *extra_outcap; .