Index: Makefile.in =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/Makefile.in,v retrieving revision 1.1.1.7 retrieving revision 1.5 diff -u -r1.1.1.7 -r1.5 Index: ansi.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/ansi.c,v retrieving revision 1.1.1.4 retrieving revision 1.9 diff -u -r1.1.1.4 -r1.9 --- ansi.c 14 Jun 2003 00:52:59 -0000 1.1.1.4 +++ ansi.c 14 Jun 2003 01:31:25 -0000 1.9 @@ -1059,6 +1059,9 @@ case 'g': /* VBELL, private screen sequence */ WBell(curr, 1); break; + case 'K': + curr->w_autoaka = curr->w_y + 1; + break; } break; case '#': @@ -2184,7 +2187,7 @@ { int i, c; - for (i = 0; i < 20 && l > 0; l--) + for (i = 0; i < (MAXSTR - 10) && l > 0; l--) { c = (unsigned char)*s++; if (c == 0) @@ -2193,6 +2196,9 @@ continue; p->w_akachange[i++] = c; } + /* stripe white space */ + while (i > 0 && p->w_akachange[i - 1] == ' ') + i--; p->w_akachange[i] = 0; p->w_title = p->w_akachange; if (p->w_akachange != p->w_akabuf) @@ -2240,10 +2246,18 @@ else wp->w_autoaka = 0; line = cp; +#if 0 while (len && *cp != ' ') +#else + while (len) +#endif { +#if 0 if (*cp++ == '/') line = cp; +#else + cp++; +#endif len--; } ChangeAKA(wp, (char *)line, cp - line); Index: comm.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/comm.c,v retrieving revision 1.1.1.4 retrieving revision 1.8 diff -u -r1.1.1.4 -r1.8 --- comm.c 14 Jun 2003 00:52:59 -0000 1.1.1.4 +++ comm.c 14 Jun 2003 01:31:25 -0000 1.8 @@ -160,6 +160,7 @@ #endif { "defwrap", ARGS_1 }, { "defwritelock", ARGS_1 }, + { "defzombie", ARGS_01 }, #ifdef DETACH { "detach", NEED_DISPLAY|ARGS_01 }, #endif @@ -268,6 +269,9 @@ { "scrollback", NEED_FORE|ARGS_1 }, #endif { "select", ARGS_01 }, + { "selectnext", NEED_DISPLAY|NEED_FORE|ARGS_0 }, + { "selectprev", NEED_DISPLAY|NEED_FORE|ARGS_0 }, + { "selectquit", NEED_DISPLAY|NEED_FORE|ARGS_0 }, { "sessionname", ARGS_01 }, { "setenv", ARGS_012 }, { "setsid", ARGS_1 }, Index: config.h.in =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/config.h.in,v retrieving revision 1.1.1.4 retrieving revision 1.6 diff -u -r1.1.1.4 -r1.6 --- config.h.in 14 Jun 2003 00:53:00 -0000 1.1.1.4 +++ config.h.in 14 Jun 2003 01:31:25 -0000 1.6 @@ -34,7 +34,7 @@ /* * Maximum of simultaneously allowed windows per screen session. */ -#define MAXWIN 40 +#define MAXWIN 100 /* * Define SOCKDIR to be the directory to contain the named sockets @@ -120,7 +120,7 @@ * If you'd rather see the status line on the first line of your * terminal rather than the last, define TOPSTAT. */ -#undef TOPSTAT +#define TOPSTAT /* * define DETACH can detach a session. An absolute 'must'. Index: configure =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/configure,v retrieving revision 1.1.1.7 retrieving revision 1.7 diff -u -r1.1.1.7 -r1.7 --- configure 14 Jun 2003 00:56:17 -0000 1.1.1.7 +++ configure 16 Jun 2003 05:26:14 -0000 1.7 @@ -1970,7 +1970,7 @@ CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then - CFLAGS="-g -O2" + CFLAGS="-Wall -g -O2" else CFLAGS="-g" fi Index: display.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/display.c,v retrieving revision 1.1.1.4 retrieving revision 1.13 diff -u -r1.1.1.4 -r1.13 --- display.c 14 Jun 2003 00:52:57 -0000 1.1.1.4 +++ display.c 14 Jun 2003 01:31:26 -0000 1.13 @@ -156,7 +156,11 @@ LCursorVisibility(flayer, 0); LMouseMode(flayer, 0); LSetRendition(flayer, &mchar_null); +#if 0 LSetFlow(flayer, nwin_default.flowflag & FLOW_NOW); +#else + LSetFlow(flayer, 0); +#endif } /* @@ -214,7 +218,7 @@ #endif display->d_next = displays; displays = display; - D_flow = 1; + D_flow = 0; D_nonblock = 0; D_userfd = fd; D_readev.fd = D_writeev.fd = fd; @@ -2140,7 +2144,7 @@ char *msg; { register char *s, *t; - register int max, ti; + register int max, ti, i; if (!display) return; @@ -2157,9 +2161,13 @@ } if (!use_hardstatus || !D_HS) { +#if 0 max = D_width; if (D_CLP == 0) max--; +#else + max = D_width * D_height; +#endif } else max = D_WS > 0 ? D_WS : (D_width - !D_CLP); @@ -2180,11 +2188,16 @@ } RemoveStatus(); } + D_status_len = 1; for (s = t = msg; *s && t - msg < max; ++s) if (*s == BELL) AddCStr(D_BL); else if ((unsigned char)*s >= ' ' && *s != 0177) *t++ = *s; + else if (*s == '\n') { + *t++ = *s; + D_status_len ++; + } *t = '\0'; if (t == msg) return; @@ -2203,7 +2216,9 @@ } if (t - msg < D_status_buflen) strcpy(D_status_lastmsg, msg); +#if 0 D_status_len = t - msg; +#endif D_status_lastx = D_x; D_status_lasty = D_y; if (!use_hardstatus || D_has_hstatus == HSTATUS_IGNORE || D_has_hstatus == HSTATUS_MESSAGE) @@ -2228,7 +2243,11 @@ } AddChar('\b'); } +#if 0 D_x = -1; +#else + D_x = D_y = -1; +#endif } else { @@ -2246,8 +2265,13 @@ ASSERT(D_obuffree == D_obuflen); /* this is copied over from RemoveStatus() */ D_status = 0; +#if 0 GotoPos(0, STATLINE); RefreshLine(STATLINE, 0, D_status_len - 1, 0); +#else + for (i=0; ic_layer : 0; if (flayer) @@ -2272,7 +2296,7 @@ { struct display *olddisplay; struct layer *oldflayer; - int where; + int where, i; if (!display) return; @@ -2297,8 +2321,13 @@ oldflayer = flayer; if (where == STATUS_ON_WIN) { +#if 0 GotoPos(0, STATLINE); - RefreshLine(STATLINE, 0, D_status_len - 1, 0); + RefreshLine(STATLINE, 0, D_status_len, 0); +#else + for (i=0; ic_next ? D_forecv->c_next : D_cvlist; + SetForeWindow(FindNiceWindow(windows, 0)); + D_fore = Layer2Window(D_forecv->c_layer); + fore = D_fore; + RefreshHStatus(); + /* XXX: only on canvas? */ + flayer = D_forecv->c_layer; + LayRestore(); + LaySetCursor(); +#endif Activate(-1); break; case RC_REMOVE: @@ -3862,14 +3901,33 @@ WindowByName(s) char *s; { - struct win *p; + struct win *p, *p0; - for (p = windows; p; p = p->w_next) + if ((p = D_fore) == NULL) + p = windows; + p0 = p; + do { + p = p->w_next; + if (p == NULL) + p = windows; if (!strcmp(p->w_title, s)) return p; - for (p = windows; p; p = p->w_next) + } while (p != p0); + do { + p = p->w_next; + if (p == NULL) + p = windows; if (!strncmp(p->w_title, s, strlen(s))) return p; + } while (p != p0); + do { + p = p->w_next; + if (p == NULL) + p = windows; + if (strstr(p->w_title, s) != NULL) + return p; + } while (p != p0); + return 0; } @@ -4071,8 +4129,77 @@ #endif SetForeWindow(p); Activate(fore->w_norefresh); +} + +static void +SelectNext() +{ + struct win *p; + + p = D_fore->w_next; + if (p == NULL) + p = windows; + SetForeWindow(p); + Activate(fore->w_norefresh); + Msg(0, "switched to %d (%s)", p->w_number, p->w_title); + /* emulate Meta-key */ + D_ESCseen = ktab; } +static void +SelectPrev() +{ + struct win *p; + + p = D_fore->w_prev; + SetForeWindow(p); + Activate(fore->w_norefresh); + Msg(0, "switched to %d (%s)", p->w_number, p->w_title); + /* emulate Meta-key */ + D_ESCseen = ktab; +} + +static void +SelectQuit() +{ + MoveToFront(D_fore); +} + + + +static void +RemoveWin(p) +struct win *p; +{ + + /* tail?? */ + if (p->w_next == NULL) + windows->w_prev = p->w_prev; + else + p->w_next->w_prev = p->w_prev; + /* top? */ + if (p == windows) + windows = p->w_next; + else + p->w_prev->w_next = p->w_next; +} + +static void +MoveToFront(p) +struct win *p; +{ + /* already top? */ + if (p == windows) + return; + /* remove from the ring */ + RemoveWin(p); + /* put it on the top */ + p->w_prev = windows->w_prev; + p->w_next = windows; + /* p->w_prev->w_next = p; */ + windows->w_prev = p; + windows = p; +} void SetCanvasWindow(cv, wi) @@ -4151,6 +4278,7 @@ /* * Place the window at the head of the most-recently-used list */ +#if 0 for (pp = &windows; (p = *pp); pp = &p->w_next) if (p == wi) break; @@ -4158,6 +4286,7 @@ *pp = p->w_next; p->w_next = windows; windows = p; +#endif } } } @@ -4238,13 +4367,14 @@ register struct win **pp; int n = fore ? fore->w_number : -1; - for (pp = wtab + n + 1; pp != wtab + n; pp++) - { + pp = wtab + n; + do { + pp++; if (pp == wtab + MAXWIN) pp = wtab; if (*pp) break; - } + } while (pp != wtab + n); return pp - wtab; } @@ -4254,13 +4384,14 @@ register struct win **pp; int n = fore ? fore->w_number : MAXWIN - 1; - for (pp = wtab + n - 1; pp != wtab + n; pp--) - { + pp = wtab + n; + do { + pp--; if (pp < wtab) pp = wtab + MAXWIN - 1; if (*pp) break; - } + } while (pp != wtab + n); return pp - wtab; } @@ -4290,11 +4421,15 @@ /* * Remove window from linked list. */ +#if 0 for (pp = &windows; (p = *pp); pp = &p->w_next) if (p == wi) break; ASSERT(p); *pp = p->w_next; +#else + RemoveWin(wi); +#endif wi->w_inlen = 0; wtab[wi->w_number] = 0; @@ -4359,6 +4494,16 @@ WindowChanged(fore, 'f'); } +int +CompWindows(const void *a, const void *b) +{ + struct win *wa, *wb; + wa = *(struct win **) a; + wb = *(struct win **) b; + + return strcmp(wa->w_title, wb->w_title); +} + char * AddWindows(buf, len, flags, where) char *buf; @@ -4674,7 +4819,7 @@ { ASSERT(display); if (len && fore) - ChangeAKA(fore, buf, 20); + ChangeAKA(fore, buf, len); } static void @@ -4725,6 +4870,7 @@ if ((n = WindowByNoN(buf)) < 0) return; SwitchWindow(n); + MoveToFront(D_fore); } static void Index: screen.h =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/screen.h,v retrieving revision 1.1.1.4 retrieving revision 1.5 diff -u -r1.1.1.4 -r1.5 --- screen.h 14 Jun 2003 00:52:59 -0000 1.1.1.4 +++ screen.h 14 Jun 2003 01:31:26 -0000 1.5 @@ -86,7 +86,7 @@ #define Ctrl(c) ((c)&037) -#define MAXSTR 256 +#define MAXSTR 1024 #define MAXARGS 64 #define MSGWAIT 5 #define MSGMINWAIT 1 Index: socket.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/socket.c,v retrieving revision 1.1.1.4 retrieving revision 1.5 diff -u -r1.1.1.4 -r1.5 Index: termcap.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/termcap.c,v retrieving revision 1.1.1.5 retrieving revision 1.7 diff -u -r1.1.1.5 -r1.7 --- termcap.c 14 Jun 2003 00:56:18 -0000 1.1.1.5 +++ termcap.c 14 Jun 2003 01:31:27 -0000 1.7 @@ -225,7 +225,8 @@ if (D_CXT) D_BE = 1; } - if (nwin_options.flowflag == nwin_undef.flowflag) + if (nwin_default.flowflag == nwin_undef.flowflag && + nwin_options.flowflag == nwin_undef.flowflag) nwin_default.flowflag = D_CNF ? FLOW_NOW * 0 : D_NX ? FLOW_NOW * 1 : FLOW_AUTOFLAG; Index: utmp.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/utmp.c,v retrieving revision 1.1.1.4 retrieving revision 1.5 diff -u -r1.1.1.4 -r1.5 --- utmp.c 14 Jun 2003 00:53:01 -0000 1.1.1.4 +++ utmp.c 14 Jun 2003 01:31:27 -0000 1.5 @@ -468,9 +468,9 @@ } } else - strncpy(host, "local", sizeof(host) - 15); + strncpy(host, "local", sizeof(host) - 5); - sprintf(host + strlen(host), ":S.%d", wi->w_number); + sprintf(host + strlen(host), ":S.%02d", wi->w_number); debug1("rlogin hostname: '%s'\n", host); # if !defined(_SEQUENT_) && !defined(sequent) Index: window.c =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/window.c,v retrieving revision 1.1.1.4 retrieving revision 1.6 diff -u -r1.1.1.4 -r1.6 --- window.c 14 Jun 2003 00:53:00 -0000 1.1.1.4 +++ window.c 14 Jun 2003 01:31:27 -0000 1.6 @@ -130,7 +130,7 @@ 0, /* dir */ screenterm, /* term */ 0, /* aflag */ - 1*FLOW_NOW, /* flowflag */ + -1, /* flowflag */ LOGINDEFAULT, /* lflag */ DEFAULTHISTHEIGHT, /* histheight */ MON_OFF, /* monitor */ @@ -752,6 +752,14 @@ D_other = D_fore; *pp = p; p->w_next = windows; + if (windows) { + p->w_prev = windows->w_prev; + /* p->w_prev->w_next = p; */ + windows->w_prev = p; + } else + /* no windows */ + /* p->w_prev = p->w_next = p; */ + p->w_prev = p; windows = p; p->w_lflag = nwin.lflag; #ifdef UTMPOK Index: window.h =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/window.h,v retrieving revision 1.1.1.4 retrieving revision 1.8 diff -u -r1.1.1.4 -r1.8 --- window.h 14 Jun 2003 00:53:00 -0000 1.1.1.4 +++ window.h 14 Jun 2003 01:31:27 -0000 1.8 @@ -126,6 +126,7 @@ struct win { struct win *w_next; /* next window */ + struct win *w_prev; /* previsou window in the ring */ int w_type; /* type of window */ void *w_data; struct layer w_layer; /* our layer */ Index: doc/Makefile.in =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/doc/Makefile.in,v retrieving revision 1.1.1.7 retrieving revision 1.4 diff -u -r1.1.1.7 -r1.4 Index: doc/screen.texinfo =================================================================== RCS file: /home/sat/simokawa/ccd/CVSROOT/src/screen/doc/screen.texinfo,v retrieving revision 1.1.1.6 retrieving revision 1.5 diff -u -r1.1.1.6 -r1.5