diff options
author | jnweiger <jnweiger> | 2005-12-16 18:23:18 +0000 |
---|---|---|
committer | jnweiger <jnweiger> | 2005-12-16 18:23:18 +0000 |
commit | 0e71ff2ef21998e8b999bf725b46b16e5995bf90 (patch) | |
tree | 23b8a698d7ec7b055100231132162a60612b2a02 | |
parent | 2b1bdf96728a13bdfca4826de6469a068014c43e (diff) | |
download | screen-0e71ff2ef21998e8b999bf725b46b16e5995bf90.tar.gz |
old version screen-3.9.8 Sep 1 2000
65 files changed, 2678 insertions, 1471 deletions
diff --git a/src/Makefile.in b/src/Makefile.in index add343d..90a3370 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -22,9 +22,11 @@ ETCSCREENRC = `sed < config.h -n -e '/define ETCSCREENRC/s/^.*"\([^"]*\)"/\1/p'` CC = @CC@ CFLAGS = -O +CPPFLAGS = @CPPFLAGS@ LDFLAGS = LIBS = @LIBS@ +CPP=@CPP@ CPP_DEPEND=$(CC) -MM INSTALL = @INSTALL@ @@ -41,11 +43,6 @@ AWK = @AWK@ # -DDUMPSHADOW # With shadow-pw screen would never dump core. Use this option if # you still want to have a core. Use only for debugging. -# -DFORKDEBUG -# Swap roles of father and son when forking the SCREEN process. -# Note: "detach" will be less powerfull, but "pow_detach" may be -# more forcefull than usual. -# Useful only for debugging. OPTIONS= #OPTIONS= -DDEBUG @@ -84,7 +81,7 @@ install_bin: .version screen install: installdirs install_bin cd doc ; $(MAKE) install -if [ -d /usr/lib/terminfo ]; then \ - PATH="$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \ + PATH="$$PATH:/usr/5bin" tic ${srcdir}/terminfo/screeninfo.src; \ chmod 644 /usr/lib/terminfo/s/screen*; \ fi # Better do this by hand. E.g. under RCS... @@ -124,7 +121,7 @@ comm.h: comm.c comm.sh config.h AWK=$(AWK) CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/comm.sh osdef.h: osdef.sh config.h osdef.h.in - CC="$(CC) $(CFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh + CPP="$(CPP) $(CPPFLAGS)" srcdir=${srcdir} sh $(srcdir)/osdef.sh docs: cd doc; $(MAKE) dvi screen.info @@ -1,4 +1,26 @@ + ------------------------------ + What's new in screen-3.9.8 ? + ------------------------------ + +* new command 'resize' to resize regions (aka split windows), try: + bind = resize = + bind + resize +1 + bind - resize -1 + bind _ resize max + +* new argument for 'focus': up, down, top, bottom + +* X11 mouse tracking support + +* Support for the "new color model", aka "background color erase": + the bce/defbce commands change the color model of the current + window/new windows. + +* experimental rxvt OSC sequence support (used to set a background + picture or to change the default colors), disabled by default. + + ---------------------------- What's new in screen-3.9 ? ---------------------------- @@ -1,3 +1,4 @@ +- 16 color support - display size adaption (Activate) - better kanji - message protocol (send screen command) @@ -6,3 +7,6 @@ - writelocks? - partial? - nonblock? +- source command +- type into several windows at once (for cluster admins) +- configurable digraph table @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -117,7 +117,6 @@ static void BackSpace __P((void)); static void Return __P((void)); static void LineFeed __P((int)); static void ReverseLineFeed __P((void)); -static void InsertAChar __P((int)); static void InsertChar __P((int)); static void DeleteChar __P((int)); static void DeleteLine __P((int)); @@ -140,18 +139,29 @@ static void FillWithEs __P((void)); static void FindAKA __P((void)); static void Report __P((char *, int, int)); static void ScrollRegion __P((int)); -static void AddLineToHist __P((struct win *, struct mline *)); -static void LogString __P((struct win *, char *, int)); +#ifdef COPY_PASTE +static void WAddLineToHist __P((struct win *, struct mline *)); +#endif +static void WLogString __P((struct win *, char *, int)); static void WReverseVideo __P((struct win *, int)); +static int WindowChangedCheck __P((char *, int, int *)); static void MFixLine __P((struct win *, int, struct mchar *)); -static void MScrollH __P((struct win *, int, int, int, int)); -static void MScrollV __P((struct win *, int, int, int)); -static void MClear __P((struct win *, int, int, int, int)); +static void MScrollH __P((struct win *, int, int, int, int, int)); +static void MScrollV __P((struct win *, int, int, int, int)); +static void MClearArea __P((struct win *, int, int, int, int, int)); static void MInsChar __P((struct win *, struct mchar *, int, int)); static void MPutChar __P((struct win *, struct mchar *, int, int)); +static void MPutStr __P((struct win *, char *, int, struct mchar *, int, int)); static void MWrapChar __P((struct win *, struct mchar *, int, int, int, int)); -static int WindowChangedCheck __P((char *, int, int *)); +#ifdef COLOR +static void MBceLine __P((struct win *, int, int, int, int)); +#endif +#ifdef COLOR +# define CURR_BCE (curr->w_bce ? (curr->w_rend.color >> 4 & 0xf) : 0) +#else +# define CURR_BCE 0 +#endif void ResetAnsiState(p) @@ -171,6 +181,7 @@ register struct win *p; p->w_origin = 0; p->w_insert = 0; p->w_revvid = 0; + p->w_mouse = 0; p->w_curinv = 0; p->w_curvvis = 0; p->w_autolf = 0; @@ -189,6 +200,9 @@ register struct win *p; #ifdef FONT ResetCharsets(p); #endif +#ifdef COLOR + p->w_bce = nwin_default.bce; +#endif } /* adds max 22 bytes */ @@ -210,6 +224,7 @@ char *buf; if (w->w_intermediate > 0xff) p += AddXChar(p, w->w_intermediate >> 8); p += AddXChar(p, w->w_intermediate & 0xff); + *p = 0; } if (w->w_state == ASTR || w->w_state == STRESC) sprintf(p, "-%s", string_t_string[w->w_StringType]); @@ -230,14 +245,14 @@ static char *kanjicharsets[3] = { void ResetCharsets(p) -register struct win *p; +struct win *p; { p->w_gr = nwin_default.gr; p->w_c1 = nwin_default.c1; SetCharsets(p, "BBBB02"); if (nwin_default.charset) SetCharsets(p, nwin_default.charset); -#ifdef KANJI +# ifdef KANJI if (p->w_kanji) { p->w_gr = 1; @@ -245,7 +260,7 @@ register struct win *p; p->w_c1 = 0; SetCharsets(p, kanjicharsets[p->w_kanji]); } -#endif +# endif } void @@ -266,7 +281,7 @@ char *s; p->w_FontL = p->w_charsets[p->w_Charset]; p->w_FontR = p->w_charsets[p->w_CharsetR]; } -#endif +#endif /* FONT */ /*****************************************************************/ @@ -298,7 +313,7 @@ register int len; if (!len) return; if (wp->w_log) - LogString(wp, buf, len); + WLogString(wp, buf, len); /* set global variables (yuck!) */ curr = wp; @@ -336,63 +351,32 @@ register int len; curr->w_rend.font = curr->w_FontL; /* Default: GL */ #endif - /* The next part is only for speedup - * (therefore no mchars are used) */ + /* The next part is only for speedup */ if (curr->w_state == LIT && #ifdef KANJI curr->w_FontL != KANJI && curr->w_FontL != KANA && !curr->w_mbcs && #endif - c >= ' ' && + c >= ' ' && c != 0x7f && ((c & 0x80) == 0 || ((c >= 0xa0 || !curr->w_c1) && !curr->w_gr)) && !curr->w_ss && !curr->w_insert && curr->w_x < cols - 1) { - register int currx; - register char *imp, *atp, at; -#ifdef FONT - register char *fop, fo; -#endif -#ifdef COLOR - register char *cop, co; -#endif + register int currx = curr->w_x; + char *imp = buf - 1; - if (c == '\177') - continue; - MFixLine(curr, curr->w_y, &curr->w_rend); - currx = curr->w_x; - imp = curr->w_mlines[curr->w_y].image + currx; - atp = curr->w_mlines[curr->w_y].attr + currx; - at = curr->w_rend.attr; -#ifdef FONT - fop = curr->w_mlines[curr->w_y].font + currx; - fo = curr->w_rend.font; -#endif -#ifdef COLOR - cop = curr->w_mlines[curr->w_y].color + currx; - co = curr->w_rend.color; -#endif while (currx < cols - 1) { - *imp++ = c; - *atp++ = at; -#ifdef FONT - *fop++ = fo; -#endif -#ifdef COLOR - *cop++ = co; -#endif currx++; -skip: if (--len == 0) + if (--len == 0) break; c = (unsigned char)*buf++; - if (c == '\177') - goto skip; - if (c < ' ' || ((c & 0x80) && ((c < 0xa0 && curr->w_c1) || curr->w_gr))) + if (c < ' ' || c == 0x7f || ((c & 0x80) && ((c < 0xa0 && curr->w_c1) || curr->w_gr))) break; } currx -= curr->w_x; if (currx > 0) { - LPutStr(&curr->w_layer, imp - currx, currx, &curr->w_rend, curr->w_x, curr->w_y); + MPutStr(curr, imp, currx, &curr->w_rend, curr->w_x, curr->w_y); + LPutStr(&curr->w_layer, imp, currx, &curr->w_rend, curr->w_x, curr->w_y); curr->w_x += currx; } if (len == 0) @@ -576,8 +560,9 @@ skip: if (--len == 0) case '5': case '6': case '7': case '8': case '9': if (curr->w_NumArgs < MAXARGS) { - curr->w_args[curr->w_NumArgs] = - 10 * curr->w_args[curr->w_NumArgs] + (c - '0'); + if (curr->w_args[curr->w_NumArgs] < 100000000) + curr->w_args[curr->w_NumArgs] = + 10 * curr->w_args[curr->w_NumArgs] + (c - '0'); } break; case ';': @@ -711,9 +696,16 @@ skip: if (--len == 0) } debug2("SJIS after %x %x\n", c, t); } + if (t && curr->w_gr) + { + t &= 0x7f; + if (t < ' ') + goto tryagain; + } + if (t == '\177') + break; curr->w_mbcs = t; } - kanjiloop: # endif if (curr->w_gr) { @@ -725,10 +717,18 @@ skip: if (--len == 0) if (c == '\177') break; curr->w_rend.image = c; +#ifdef KANJI + curr->w_rend.mbcs = curr->w_mbcs; +#endif if (curr->w_x < cols - 1) { if (curr->w_insert) - InsertAChar(c); + { + save_mline(&curr->w_mlines[curr->w_y], cols); + MInsChar(curr, &curr->w_rend, curr->w_x, curr->w_y); + LInsChar(&curr->w_layer, &curr->w_rend, curr->w_x, curr->w_y, &mline_old); + curr->w_x++; + } else { MPutChar(curr, &curr->w_rend, curr->w_x, curr->w_y); @@ -755,9 +755,8 @@ skip: if (--len == 0) # ifdef KANJI if (curr->w_mbcs) { - c = curr->w_mbcs; - curr->w_mbcs = 0; - goto kanjiloop; /* what a hack! */ + curr->w_rend.mbcs = curr->w_mbcs = 0; + curr->w_x++; } # endif if (curr->w_ss) @@ -778,7 +777,7 @@ skip: if (--len == 0) } static void -LogString(p, buf, len) +WLogString(p, buf, len) struct win *p; char *buf; int len; @@ -816,7 +815,7 @@ register int c; case '\n': if (curr->w_autoaka) FindAKA(); - LineFeed(1); + LineFeed(0); return 1; case '\007': WBell(curr, visual_bell); @@ -847,10 +846,10 @@ int c, intermediate; switch (c) { case 'E': - LineFeed(2); + LineFeed(1); break; case 'D': - LineFeed(1); + LineFeed(0); break; case 'M': ReverseLineFeed(); @@ -873,24 +872,25 @@ int c, intermediate; LKeypadMode(&curr->w_layer, 0); LCursorkeysMode(&curr->w_layer, 0); #ifndef TIOCPKT - NewAutoFlow(curr, 1); + WNewAutoFlow(curr, 1); #endif /* XXX SetRendition(&mchar_null); InsertMode(0); ChangeScrollRegion(0, rows - 1); */ + LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); break; case '=': LKeypadMode(&curr->w_layer, curr->w_keypad = 1); #ifndef TIOCPKT - NewAutoFlow(curr, 0); + WNewAutoFlow(curr, 0); #endif /* !TIOCPKT */ break; case '>': LKeypadMode(&curr->w_layer, curr->w_keypad = 0); #ifndef TIOCPKT - NewAutoFlow(curr, 1); + WNewAutoFlow(curr, 1); #endif /* !TIOCPKT */ break; #ifdef FONT @@ -1201,7 +1201,7 @@ int c, intermediate; case 1: /* CKM: cursor key mode */ LCursorkeysMode(&curr->w_layer, curr->w_cursorkeys = i); #ifndef TIOCPKT - NewAutoFlow(curr, !i); + WNewAutoFlow(curr, !i); #endif /* !TIOCPKT */ break; case 2: /* ANM: ansi/vt52 mode */ @@ -1248,6 +1248,10 @@ int c, intermediate; break; /* case 8: ARM: auto repeat mode */ /* case 9: INLM: interlace mode */ + case 9: /* X10 mouse tracking */ + curr->w_mouse = i ? 9 : 0; + LMouseMode(&curr->w_layer, curr->w_mouse); + break; /* case 10: EDM: edit mode */ /* case 11: LTM: line transmit mode */ /* case 13: SCFDM: space compression / field delimiting */ @@ -1268,6 +1272,10 @@ int c, intermediate; /* case 44: margin bell enable */ /* case 66: NKM: Numeric keypad appl mode */ /* case 68: KBUM: Keyboard usage mode (data process) */ + case 1000: /* VT200 mouse tracking */ + curr->w_mouse = i ? 1000 : 0; + LMouseMode(&curr->w_layer, curr->w_mouse); + break; } } break; @@ -1311,20 +1319,51 @@ static int StringEnd() { struct canvas *cv; + char *p; + int typ; curr->w_state = LIT; *curr->w_stringp = '\0'; switch (curr->w_StringType) { case OSC: /* special xterm compatibility hack */ - if (curr->w_stringp - curr->w_string < 2 || - curr->w_string[0] < '0' || - curr->w_string[0] > '2' || - curr->w_string[1] != ';') + if (curr->w_string[0] == ';' || (p = index(curr->w_string, ';')) == 0) + break; + typ = atoi(curr->w_string); + p++; +#ifdef RXVT_OSC + if (typ == 0 || typ == 1 || typ == 20 || typ == 39 || typ == 49) + { + int typ2; + typ2 = typ / 10; + if (--typ2 < 0) + typ2 = 0; + if (strcmp(curr->w_xtermosc[typ2], p)) + { + strncpy(curr->w_xtermosc[typ2], p, sizeof(curr->w_xtermosc[typ2]) - 1); + curr->w_xtermosc[typ2][sizeof(curr->w_xtermosc[typ2]) - 1] = 0; + + for (display = displays; display; display = display->d_next) + { + if (!D_CXT) + continue; + if (D_forecv->c_layer->l_bottom == &curr->w_layer) + SetXtermOSC(typ2, curr->w_xtermosc[typ2]); + if ((typ2 == 2 || typ2 == 3) && D_xtermosc[typ2]) + Redisplay(0); + } + } + } + if (typ != 0 && typ != 2) + break; +#else + if (typ < 0 || typ > 2) break; - curr->w_stringp -= 2; +#endif + + curr->w_stringp -= p - curr->w_string; if (curr->w_stringp > curr->w_string) - bcopy(curr->w_string + 2, curr->w_string, curr->w_stringp - curr->w_string); + bcopy(p, curr->w_string, curr->w_stringp - curr->w_string); *curr->w_stringp = '\0'; /* FALLTHROUGH */ case APC: @@ -1442,11 +1481,11 @@ PrintFlush() void -NewAutoFlow(win, on) +WNewAutoFlow(win, on) struct win *win; int on; { - debug1("NewAutoFlow: %d\n", on); + debug1("WNewAutoFlow: %d\n", on); if (win->w_flow & FLOW_AUTOFLAG) win->w_flow = FLOW_AUTOFLAG | (FLOW_AUTO|FLOW_NOW) * on; else @@ -1575,25 +1614,21 @@ static void LineFeed(out_mode) int out_mode; { - /* out_mode: 0=cr+lf no-output, 1=lf, 2=cr+lf */ - if (out_mode != 1) + /* out_mode: 0=lf, 1=cr+lf */ + if (out_mode) curr->w_x = 0; if (curr->w_y != curr->w_bot) /* Don't scroll */ { if (curr->w_y < rows-1) curr->w_y++; - if (out_mode) - LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); + LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); return; } - MScrollV(curr, 1, curr->w_top, curr->w_bot); if (curr->w_autoaka > 1) curr->w_autoaka--; - if (out_mode) - { - LScrollV(&curr->w_layer, 1, curr->w_top, curr->w_bot); - LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); - } + MScrollV(curr, 1, curr->w_top, curr->w_bot, CURR_BCE); + LScrollV(&curr->w_layer, 1, curr->w_top, curr->w_bot, CURR_BCE); + LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); } static void @@ -1601,8 +1636,8 @@ ReverseLineFeed() { if (curr->w_y == curr->w_top) { - MScrollV(curr, -1, curr->w_top, curr->w_bot); - LScrollV(&curr->w_layer, -1, curr->w_top, curr->w_bot); + MScrollV(curr, -1, curr->w_top, curr->w_bot, CURR_BCE); + LScrollV(&curr->w_layer, -1, curr->w_top, curr->w_bot, CURR_BCE); LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); } else if (curr->w_y > 0) @@ -1610,19 +1645,6 @@ ReverseLineFeed() } static void -InsertAChar(c) -int c; -{ - register int y = curr->w_y, x = curr->w_x; - - save_mline(&curr->w_mlines[y], cols); - curr->w_rend.image = c; - MInsChar(curr, &curr->w_rend, x, y); - curr->w_x = x + 1; - LInsChar(&curr->w_layer, &curr->w_rend, x, y, &mline_old); -} - -static void InsertChar(n) int n; { @@ -1633,8 +1655,8 @@ int n; if (x == cols) x--; save_mline(&curr->w_mlines[y], cols); - MScrollH(curr, -n, y, x, curr->w_width - 1); - LScrollH(&curr->w_layer, -n, y, x, curr->w_width - 1, &mline_old); + MScrollH(curr, -n, y, x, curr->w_width - 1, CURR_BCE); + LScrollH(&curr->w_layer, -n, y, x, curr->w_width - 1, CURR_BCE, &mline_old); LGotoPos(&curr->w_layer, x, y); } @@ -1647,8 +1669,8 @@ int n; if (x == cols) x--; save_mline(&curr->w_mlines[y], cols); - MScrollH(curr, n, y, x, curr->w_width - 1); - LScrollH(&curr->w_layer, n, y, x, curr->w_width - 1, &mline_old); + MScrollH(curr, n, y, x, curr->w_width - 1, CURR_BCE); + LScrollH(&curr->w_layer, n, y, x, curr->w_width - 1, CURR_BCE, &mline_old); LGotoPos(&curr->w_layer, x, y); } @@ -1660,8 +1682,8 @@ int n; return; if (n > curr->w_bot - curr->w_y + 1) n = curr->w_bot - curr->w_y + 1; - MScrollV(curr, n, curr->w_y, curr->w_bot); - LScrollV(&curr->w_layer, n, curr->w_y, curr->w_bot); + MScrollV(curr, n, curr->w_y, curr->w_bot, CURR_BCE); + LScrollV(&curr->w_layer, n, curr->w_y, curr->w_bot, CURR_BCE); LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); } @@ -1673,8 +1695,8 @@ int n; return; if (n > curr->w_bot - curr->w_y + 1) n = curr->w_bot - curr->w_y + 1; - MScrollV(curr, -n, curr->w_y, curr->w_bot); - LScrollV(&curr->w_layer, -n, curr->w_y, curr->w_bot); + MScrollV(curr, -n, curr->w_y, curr->w_bot, CURR_BCE); + LScrollV(&curr->w_layer, -n, curr->w_y, curr->w_bot, CURR_BCE); LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); } @@ -1682,8 +1704,8 @@ static void ScrollRegion(n) int n; { - MScrollV(curr, n, curr->w_top, curr->w_bot); - LScrollV(&curr->w_layer, n, curr->w_top, curr->w_bot); + MScrollV(curr, n, curr->w_top, curr->w_bot, CURR_BCE); + LScrollV(&curr->w_layer, n, curr->w_top, curr->w_bot, CURR_BCE); LGotoPos(&curr->w_layer, curr->w_x, curr->w_y); } @@ -1695,7 +1717,7 @@ ForwardTab() if (x == cols) { - LineFeed(2); + LineFeed(1); x = 0; } if (curr->w_tabs[x] && x < cols - 1) @@ -1722,11 +1744,11 @@ BackwardTab() static void ClearScreen() { - LClear(&curr->w_layer, 0, 0, curr->w_width - 1, curr->w_height - 1, 1); + LClearArea(&curr->w_layer, 0, 0, curr->w_width - 1, curr->w_height - 1, CURR_BCE, 1); #ifdef COPY_PASTE - MScrollV(curr, curr->w_height, 0, curr->w_height - 1); + MScrollV(curr, curr->w_height, 0, curr->w_height - 1, CURR_BCE); #else - MClear(curr, 0, 0, curr->w_width - 1, curr->w_height - 1); + MClearArea(curr, 0, 0, curr->w_width - 1, curr->w_height - 1, CURR_BCE); #endif } @@ -1735,8 +1757,8 @@ ClearFromBOS() { register int y = curr->w_y, x = curr->w_x; - LClear(&curr->w_layer, 0, 0, x, y, 1); - MClear(curr, 0, 0, x, y); + LClearArea(&curr->w_layer, 0, 0, x, y, CURR_BCE, 1); + MClearArea(curr, 0, 0, x, y, CURR_BCE); RestorePosRendition(); } @@ -1748,10 +1770,11 @@ ClearToEOS() if (x == 0 && y == 0) { ClearScreen(); + RestorePosRendition(); return; } - LClear(&curr->w_layer, x, y, cols - 1, rows - 1, 1); - MClear(curr, x, y, cols - 1, rows - 1); + LClearArea(&curr->w_layer, x, y, cols - 1, rows - 1, CURR_BCE, 1); + MClearArea(curr, x, y, cols - 1, rows - 1, CURR_BCE); RestorePosRendition(); } @@ -1760,8 +1783,8 @@ ClearLineRegion(from, to) int from, to; { register int y = curr->w_y; - LClear(&curr->w_layer, from, y, to, y, 1); - MClear(curr, from, y, to, y); + LClearArea(&curr->w_layer, from, y, to, y, CURR_BCE, 1); + MClearArea(curr, from, y, to, y, CURR_BCE); RestorePosRendition(); } @@ -1773,7 +1796,7 @@ register int n; if (x == cols) { - LineFeed(2); + LineFeed(1); x = 0; } if ((curr->w_x += n) >= cols) @@ -1868,6 +1891,10 @@ SelectRendition() { j = curr->w_args[i]; #ifdef COLOR + if (j >= 90 && j <= 97) + j -= 60; + if (j >= 100 && j <= 107) + j -= 60; if (j >= 30 && j <= 39) c = (c & 0xf0) | (39 - j); else if (j >= 40 && j <= 49) @@ -1897,7 +1924,7 @@ FillWithEs() register int i; register char *p, *ep; - ClearLayer(&curr->w_layer, 1); + LClearAll(&curr->w_layer, 1); curr->w_y = curr->w_x = 0; for (i = 0; i < rows; ++i) { @@ -1907,7 +1934,7 @@ FillWithEs() while (p < ep) *p++ = 'E'; } - RedisplayLayer(&curr->w_layer, 1); + LRefreshAll(&curr->w_layer, 1); } @@ -2072,9 +2099,9 @@ struct mchar *mc; /*****************************************************************/ static void -MScrollH(p, n, y, xs, xe) +MScrollH(p, n, y, xs, xe, bce) struct win *p; -int n, y, xs, xe; +int n, y, xs, xe, bce; { struct mline *ml; @@ -2088,6 +2115,10 @@ int n, y, xs, xe; else n = xe - xs + 1; clear_mline(ml, xe + 1 - n, n); +#ifdef COLOR + if (bce) + MBceLine(p, y, xe + 1 - n, n, bce); +#endif } else { @@ -2097,14 +2128,17 @@ int n, y, xs, xe; else n = xe - xs + 1; clear_mline(ml, xs, n); +#ifdef COLOR + if (bce) + MBceLine(p, y, xs, n, bce); +#endif } } static void -MScrollV(p, n, ys, ye) +MScrollV(p, n, ys, ye, bce) struct win *p; -int n; -int ys, ye; +int n, ys, ye, bce; { int i, cnt1, cnt2; struct mline *tmp[256]; @@ -2116,7 +2150,7 @@ int ys, ye; { if (n > 256) { - MScrollV(p, n - 256, ys, ye); + MScrollV(p, n - 256, ys, ye, bce); n = 256; } if (ye - ys + 1 < n) @@ -2137,7 +2171,7 @@ int ys, ye; { #ifdef COPY_PASTE if (ys == p->w_top) - AddLineToHist(p, ml); + WAddLineToHist(p, ml); #endif if (ml->attr != null) free(ml->attr); @@ -2153,6 +2187,10 @@ int ys, ye; ml->color = null; #endif bclear(ml->image, p->w_width + 1); +#ifdef COLOR + if (bce) + MBceLine(p, i, 0, p->w_width, bce); +#endif } /* switch 'em over */ cnt1 = n * sizeof(struct mline); @@ -2164,7 +2202,7 @@ int ys, ye; { if (n < -256) { - MScrollV(p, n + 256, ys, ye); + MScrollV(p, n + 256, ys, ye, bce); n = -256; } n = -n; @@ -2189,6 +2227,10 @@ int ys, ye; ml->color = null; #endif bclear(ml->image, p->w_width + 1); +#ifdef COLOR + if (bce) + MBceLine(p, i, 0, p->w_width, bce); +#endif } cnt1 = n * sizeof(struct mline); cnt2 = (ye - ys + 1 - n) * sizeof(struct mline); @@ -2219,9 +2261,9 @@ int cnt1, cnt2; } static void -MClear(p, xs, ys, xe, ye) +MClearArea(p, xs, ys, xe, ye, bce) struct win *p; -int xs, ys, xe, ye; +int xs, ys, xe, ye, bce; { int n, y; int xxe; @@ -2240,6 +2282,10 @@ int xs, ys, xe, ye; n = xxe - xs + 1; if (n > 0) clear_mline(ml, xs, n); +#ifdef COLOR + if (n > 0 && bce) + MBceLine(p, y, xs, xs + n - 1, bce); +#endif xs = 0; } } @@ -2260,6 +2306,15 @@ int x, y; if (n > 0) bcopy_mline(ml, x, x + 1, n); copy_mchar2mline(c, ml, x); +#ifdef KANJI + if (c->mbcs) + { + if (--n > 0) + bcopy_mline(ml, x + 1, x + 2, n); + copy_mchar2mline(c, ml, x + 1); + ml->image[x + 1] = c->mbcs; + } +#endif } static void @@ -2273,6 +2328,13 @@ int x, y; MFixLine(p, y, c); ml = &p->w_mlines[y]; copy_mchar2mline(c, ml, x); +#ifdef KANJI + if (c->mbcs) + { + copy_mchar2mline(c, ml, x + 1); + ml->image[x + 1] = c->mbcs; + } +#endif } @@ -2284,24 +2346,83 @@ int y, top, bot; int ins; { struct mline *ml; + int bce; +#ifdef COLOR + bce = c->color >> 4 & 0xf; +#else + bce = 0; +#endif MFixLine(p, y, c); ml = &p->w_mlines[y]; copy_mchar2mline(&mchar_null, ml, p->w_width); if (y == bot) - MScrollV(p, 1, top, bot); + MScrollV(p, 1, top, bot, bce); else if (y < p->w_height - 1) y++; - MFixLine(p, y, c); + if (ins) + MInsChar(p, c, 0, y); + else + MPutChar(p, c, 0, y); +} + +static void +MPutStr(p, s, n, r, x, y) +struct win *p; +char *s; +int n; +struct mchar *r; +int x, y; +{ + struct mline *ml; + int i; + char *b; + + if (n <= 0) + return; + MFixLine(p, y, r); ml = &p->w_mlines[y]; - if (ins && p->w_width > 1) - bcopy_mline(ml, 0, 1, p->w_width - 1); - copy_mchar2mline(c, ml, 0); + bcopy(s, ml->image + x, n); + b = ml->attr + x; + for (i = n; i-- > 0;) + *b++ = r->attr; +#ifdef FONT + b = ml->font + x; + for (i = n; i-- > 0;) + *b++ = r->font; +#endif +#ifdef COLOR + b = ml->color + x; + for (i = n; i-- > 0;) + *b++ = r->color; +#endif +} + +#ifdef COLOR +static void +MBceLine(p, y, xs, xe, bce) +struct win *p; +int y, xs, xe, bce; +{ + struct mchar mc; + struct mline *ml; + int x; + + mc = mchar_null; + mc.color = bce; + MFixLine(p, y, &mc); + ml = p->w_mlines + y; + if (!mc.color) + return; + for (x = xs; x <= xe; x++) + ml->color[x] = bce << 4; } +#endif + #ifdef COPY_PASTE static void -AddLineToHist(wp, ml) +WAddLineToHist(wp, ml) struct win *wp; struct mline *ml; { @@ -2366,7 +2487,7 @@ int ys, ye; /* * Tricky: send only one bell even if the window is displayed - * more than one times. + * more than once. */ void WBell(p, visual) @@ -2487,7 +2608,7 @@ int *hp; int h = 0; while(*s) { - if (*s++ != '%') + if (*s++ != (hp ? '%' : '\005')) continue; while (*s >= '0' && *s <= '9') s++; @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann diff --git a/src/attacher.c b/src/attacher.c index 639cf8b..21cf30d 100644 --- a/src/attacher.c +++ b/src/attacher.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -387,7 +387,7 @@ AttacherSigInt SIGDEFARG /* * Unfortunatelly this is also the SIGHUP handler, so we have to - * check, if the backend is already detached. + * check if the backend is already detached. */ sigret_t @@ -557,14 +557,10 @@ Attacher() #if defined(DEBUG) || !defined(DO_NOT_POLL_MASTER) if (AttacherPanic) { -# ifdef FORKDEBUG - exit(0); -# else fcntl(0, F_SETFL, 0); SetTTY(0, &attach_Mode); printf("\nSuddenly the Dungeon collapses!! - You die...\n"); eexit(1); -# endif } #endif #ifdef BSDJOBS diff --git a/src/braille.c b/src/braille.c index 93c1783..9d986b4 100644 --- a/src/braille.c +++ b/src/braille.c @@ -341,8 +341,8 @@ RefreshBraille() } else if (xs <= xe) { - RedisplayLine(-1, xs, xe, 1); - RedisplayLine(y, xs, xe, 1); + LayRedisplayLine(-1, xs, xe, 1); + LayRedisplayLine(y, xs, xe, 1); } debug1("Braille: got >%s<\n", bd.bd_line); @@ -411,8 +411,8 @@ int y, xs, xe; bd.bd_refreshing = bd.bd_searching = 1; bd.bd_searchstart = xs; bd.bd_searchend = xe; - RedisplayLine(-1, xs, xe, 1); - RedisplayLine(y, xs, xe, 1); + LayRedisplayLine(-1, xs, xe, 1); + LayRedisplayLine(y, xs, xe, 1); bd.bd_refreshing = bd.bd_searching = 0; BD_FORE->w_bd_y = oy; } diff --git a/src/braille.h b/src/braille.h index 51fa2ea..d72d2f6 100644 --- a/src/braille.h +++ b/src/braille.h @@ -25,6 +25,8 @@ * $Id$ FAU */ +#ifdef HAVE_BRAILLE + extern void StartBraille __P((void)); struct braille_display @@ -78,3 +80,4 @@ extern struct braille_display bd; #define BD_FORE bd.bd_dpy->d_fore +#endif @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -60,6 +60,9 @@ struct comm comms[RC_LAST + 1] = #ifdef AUTO_NUKE { "autonuke", NEED_DISPLAY|ARGS_1 }, #endif +#ifdef COLOR + { "bce", NEED_FORE|ARGS_01 }, +#endif #ifdef HAVE_BRAILLE /* keywords for braille display (bd) */ @@ -104,7 +107,7 @@ struct comm comms[RC_LAST + 1] = { "charset", NEED_FORE|ARGS_1 }, { "chdir", ARGS_01 }, { "clear", NEED_FORE|ARGS_0 }, - { "colon", NEED_DISPLAY|ARGS_01 }, + { "colon", NEED_LAYER|ARGS_01 }, { "command", NEED_DISPLAY|ARGS_0 }, #ifdef COPY_PASTE { "compacthist", ARGS_01 }, @@ -118,6 +121,9 @@ struct comm comms[RC_LAST + 1] = #ifdef AUTO_NUKE { "defautonuke", ARGS_1 }, #endif +#ifdef COLOR + { "defbce", ARGS_1 }, +#endif { "defbreaktype", ARGS_01 }, { "defc1", ARGS_1 }, { "defcharset", ARGS_01 }, @@ -145,35 +151,35 @@ struct comm comms[RC_LAST + 1] = #ifdef DETACH { "detach", NEED_DISPLAY|ARGS_0 }, #endif - { "digraph", NEED_DISPLAY|ARGS_01 }, - { "displays", NEED_DISPLAY|ARGS_0 }, + { "digraph", NEED_LAYER|ARGS_01 }, + { "displays", NEED_LAYER|ARGS_0 }, { "dumptermcap", NEED_FORE|ARGS_0 }, { "echo", ARGS_12 }, - { "escape", NEED_DISPLAY|ARGS_1 }, + { "escape", ARGS_1 }, #ifdef PSEUDOS { "exec", NEED_FORE|ARGS_0|ARGS_ORMORE }, #endif { "fit", NEED_DISPLAY|ARGS_0 }, { "flow", NEED_FORE|ARGS_01 }, - { "focus", NEED_DISPLAY|ARGS_0 }, + { "focus", NEED_DISPLAY|ARGS_01 }, { "gr", NEED_FORE|ARGS_01 }, { "hardcopy", NEED_FORE|ARGS_0 }, { "hardcopy_append", ARGS_1 }, - { "hardcopydir", ARGS_1 }, + { "hardcopydir", ARGS_01 }, { "hardstatus", ARGS_012 }, { "height", NEED_DISPLAY|ARGS_01 }, - { "help", NEED_DISPLAY|ARGS_0 }, + { "help", NEED_LAYER|ARGS_0 }, #ifdef COPY_PASTE - { "history", NEED_FORE|ARGS_0 }, + { "history", NEED_DISPLAY|NEED_FORE|ARGS_0 }, #endif { "hstatus", NEED_FORE|ARGS_1 }, - { "info", NEED_DISPLAY|ARGS_0 }, + { "info", NEED_LAYER|ARGS_0 }, #ifdef KANJI { "kanji", NEED_FORE|ARGS_12 }, #endif { "kill", NEED_FORE|ARGS_0 }, { "lastmsg", NEED_DISPLAY|ARGS_0 }, - { "license", NEED_DISPLAY|ARGS_0 }, + { "license", NEED_LAYER|ARGS_0 }, #ifdef LOCK { "lockscreen", NEED_DISPLAY|ARGS_0 }, #endif @@ -191,7 +197,7 @@ struct comm comms[RC_LAST + 1] = #ifdef COPY_PASTE { "markkeys", ARGS_1 }, #endif - { "meta", NEED_DISPLAY|ARGS_0 }, + { "meta", NEED_LAYER|ARGS_0 }, { "monitor", NEED_FORE|ARGS_01 }, { "msgminwait", ARGS_1 }, { "msgwait", ARGS_1 }, @@ -201,20 +207,20 @@ struct comm comms[RC_LAST + 1] = #ifdef NETHACK { "nethack", ARGS_1 }, #endif - { "next", NEED_DISPLAY|ARGS_0 }, + { "next", ARGS_0 }, #ifdef MULTI { "nonblock", NEED_DISPLAY|ARGS_01 }, #endif { "number", NEED_FORE|ARGS_01 }, { "obuflimit", NEED_DISPLAY|ARGS_01 }, { "only", NEED_DISPLAY|ARGS_0 }, - { "other", NEED_DISPLAY|ARGS_0 }, + { "other", ARGS_0 }, { "partial", NEED_FORE|ARGS_01 }, #ifdef PASSWORD { "password", ARGS_01 }, #endif #ifdef COPY_PASTE - { "paste", NEED_DISPLAY|ARGS_012 }, + { "paste", NEED_LAYER|ARGS_012 }, { "pastefont", ARGS_01 }, #endif { "pow_break", NEED_FORE|ARGS_01 }, @@ -222,12 +228,12 @@ struct comm comms[RC_LAST + 1] = { "pow_detach", NEED_DISPLAY|ARGS_0 }, { "pow_detach_msg", ARGS_01 }, #endif - { "prev", NEED_DISPLAY|ARGS_0 }, + { "prev", ARGS_0 }, { "printcmd", ARGS_01 }, { "process", NEED_DISPLAY|ARGS_01 }, { "quit", ARGS_0 }, #ifdef COPY_PASTE - { "readbuf", NEED_DISPLAY|ARGS_0 }, + { "readbuf", ARGS_0 }, #endif { "readreg", ARGS_012 }, { "redisplay", NEED_DISPLAY|ARGS_0 }, @@ -237,6 +243,7 @@ struct comm comms[RC_LAST + 1] = { "removebuf", ARGS_0 }, #endif { "reset", NEED_FORE|ARGS_0 }, + { "resize", NEED_DISPLAY|ARGS_01 }, { "screen", ARGS_0|ARGS_ORMORE }, #ifdef COPY_PASTE { "scrollback", NEED_FORE|ARGS_1 }, @@ -253,7 +260,7 @@ struct comm comms[RC_LAST + 1] = { "sorendition", ARGS_012 }, { "split", NEED_DISPLAY|ARGS_0 }, { "startup_message", ARGS_1 }, - { "stuff", NEED_DISPLAY|ARGS_12 }, + { "stuff", NEED_LAYER|ARGS_12 }, #ifdef MULTIUSER { "su", NEED_DISPLAY|ARGS_012 }, #endif @@ -278,10 +285,10 @@ struct comm comms[RC_LAST + 1] = { "windows", NEED_DISPLAY|ARGS_0 }, { "wrap", NEED_FORE|ARGS_01 }, #ifdef COPY_PASTE - { "writebuf", NEED_DISPLAY|ARGS_0 }, + { "writebuf", ARGS_0 }, #endif { "writelock", NEED_FORE|ARGS_01 }, - { "xoff", NEED_DISPLAY|ARGS_0 }, - { "xon", NEED_DISPLAY|ARGS_0 }, + { "xoff", NEED_LAYER|ARGS_0 }, + { "xon", NEED_LAYER|ARGS_0 }, { "zombie", ARGS_01 } }; diff --git a/src/comm.h.dist b/src/comm.h.dist index d004f71..9b3f69c 100644 --- a/src/comm.h.dist +++ b/src/comm.h.dist @@ -25,6 +25,7 @@ struct comm #define NEED_FORE (1<<6) /* this command needs a fore window */ #define NEED_DISPLAY (1<<7) /* this command needs a display */ +#define NEED_LAYER (1<<8) /* this command needs a layer */ #define ARGS_01 (ARGS_0 | ARGS_PLUS1) #define ARGS_02 (ARGS_0 | ARGS_PLUS2) @@ -55,146 +56,149 @@ struct action #define RC_AT 8 #define RC_AUTODETACH 9 #define RC_AUTONUKE 10 -#define RC_BELL 11 -#define RC_BELL_MSG 12 -#define RC_BIND 13 -#define RC_BINDKEY 14 -#define RC_BREAK 15 -#define RC_BREAKTYPE 16 -#define RC_BUFFERFILE 17 -#define RC_C1 18 -#define RC_CAPTION 19 -#define RC_CHACL 20 -#define RC_CHARSET 21 -#define RC_CHDIR 22 -#define RC_CLEAR 23 -#define RC_COLON 24 -#define RC_COMMAND 25 -#define RC_COMPACTHIST 26 -#define RC_CONSOLE 27 -#define RC_COPY 28 -#define RC_CRLF 29 -#define RC_DEBUG 30 -#define RC_DEFAUTONUKE 31 -#define RC_DEFBREAKTYPE 32 -#define RC_DEFC1 33 -#define RC_DEFCHARSET 34 -#define RC_DEFESCAPE 35 -#define RC_DEFFLOW 36 -#define RC_DEFGR 37 -#define RC_DEFHSTATUS 38 -#define RC_DEFKANJI 39 -#define RC_DEFLOGIN 40 -#define RC_DEFMODE 41 -#define RC_DEFMONITOR 42 -#define RC_DEFOBUFLIMIT 43 -#define RC_DEFSCROLLBACK 44 -#define RC_DEFSHELL 45 -#define RC_DEFSILENCE 46 -#define RC_DEFSLOWPASTE 47 -#define RC_DEFWRAP 48 -#define RC_DEFWRITELOCK 49 -#define RC_DETACH 50 -#define RC_DIGRAPH 51 -#define RC_DISPLAYS 52 -#define RC_DUMPTERMCAP 53 -#define RC_ECHO 54 -#define RC_ESCAPE 55 -#define RC_EXEC 56 -#define RC_FIT 57 -#define RC_FLOW 58 -#define RC_FOCUS 59 -#define RC_GR 60 -#define RC_HARDCOPY 61 -#define RC_HARDCOPY_APPEND 62 -#define RC_HARDCOPYDIR 63 -#define RC_HARDSTATUS 64 -#define RC_HEIGHT 65 -#define RC_HELP 66 -#define RC_HISTORY 67 -#define RC_HSTATUS 68 -#define RC_INFO 69 -#define RC_KANJI 70 -#define RC_KILL 71 -#define RC_LASTMSG 72 -#define RC_LICENSE 73 -#define RC_LOCKSCREEN 74 -#define RC_LOG 75 -#define RC_LOGFILE 76 -#define RC_LOGIN 77 -#define RC_LOGTSTAMP 78 -#define RC_MAPDEFAULT 79 -#define RC_MAPNOTNEXT 80 -#define RC_MAPTIMEOUT 81 -#define RC_MARKKEYS 82 -#define RC_META 83 -#define RC_MONITOR 84 -#define RC_MSGMINWAIT 85 -#define RC_MSGWAIT 86 -#define RC_MULTIUSER 87 -#define RC_NETHACK 88 -#define RC_NEXT 89 -#define RC_NONBLOCK 90 -#define RC_NUMBER 91 -#define RC_OBUFLIMIT 92 -#define RC_ONLY 93 -#define RC_OTHER 94 -#define RC_PARTIAL 95 -#define RC_PASSWORD 96 -#define RC_PASTE 97 -#define RC_PASTEFONT 98 -#define RC_POW_BREAK 99 -#define RC_POW_DETACH 100 -#define RC_POW_DETACH_MSG 101 -#define RC_PREV 102 -#define RC_PRINTCMD 103 -#define RC_PROCESS 104 -#define RC_QUIT 105 -#define RC_READBUF 106 -#define RC_READREG 107 -#define RC_REDISPLAY 108 -#define RC_REGISTER 109 -#define RC_REMOVE 110 -#define RC_REMOVEBUF 111 -#define RC_RESET 112 -#define RC_SCREEN 113 -#define RC_SCROLLBACK 114 -#define RC_SELECT 115 -#define RC_SESSIONNAME 116 -#define RC_SETENV 117 -#define RC_SHELL 118 -#define RC_SHELLTITLE 119 -#define RC_SILENCE 120 -#define RC_SILENCEWAIT 121 -#define RC_SLEEP 122 -#define RC_SLOWPASTE 123 -#define RC_SORENDITION 124 -#define RC_SPLIT 125 -#define RC_STARTUP_MESSAGE 126 -#define RC_STUFF 127 -#define RC_SU 128 -#define RC_SUSPEND 129 -#define RC_TERM 130 -#define RC_TERMCAP 131 -#define RC_TERMCAPINFO 132 -#define RC_TERMINFO 133 -#define RC_TIME 134 -#define RC_TITLE 135 -#define RC_UMASK 136 -#define RC_UNSETENV 137 -#define RC_VBELL 138 -#define RC_VBELL_MSG 139 -#define RC_VBELLWAIT 140 -#define RC_VERBOSE 141 -#define RC_VERSION 142 -#define RC_WALL 143 -#define RC_WIDTH 144 -#define RC_WINDOWS 145 -#define RC_WRAP 146 -#define RC_WRITEBUF 147 -#define RC_WRITELOCK 148 -#define RC_XOFF 149 -#define RC_XON 150 -#define RC_ZOMBIE 151 +#define RC_BCE 11 +#define RC_BELL 12 +#define RC_BELL_MSG 13 +#define RC_BIND 14 +#define RC_BINDKEY 15 +#define RC_BREAK 16 +#define RC_BREAKTYPE 17 +#define RC_BUFFERFILE 18 +#define RC_C1 19 +#define RC_CAPTION 20 +#define RC_CHACL 21 +#define RC_CHARSET 22 +#define RC_CHDIR 23 +#define RC_CLEAR 24 +#define RC_COLON 25 +#define RC_COMMAND 26 +#define RC_COMPACTHIST 27 +#define RC_CONSOLE 28 +#define RC_COPY 29 +#define RC_CRLF 30 +#define RC_DEBUG 31 +#define RC_DEFAUTONUKE 32 +#define RC_DEFBCE 33 +#define RC_DEFBREAKTYPE 34 +#define RC_DEFC1 35 +#define RC_DEFCHARSET 36 +#define RC_DEFESCAPE 37 +#define RC_DEFFLOW 38 +#define RC_DEFGR 39 +#define RC_DEFHSTATUS 40 +#define RC_DEFKANJI 41 +#define RC_DEFLOGIN 42 +#define RC_DEFMODE 43 +#define RC_DEFMONITOR 44 +#define RC_DEFOBUFLIMIT 45 +#define RC_DEFSCROLLBACK 46 +#define RC_DEFSHELL 47 +#define RC_DEFSILENCE 48 +#define RC_DEFSLOWPASTE 49 +#define RC_DEFWRAP 50 +#define RC_DEFWRITELOCK 51 +#define RC_DETACH 52 +#define RC_DIGRAPH 53 +#define RC_DISPLAYS 54 +#define RC_DUMPTERMCAP 55 +#define RC_ECHO 56 +#define RC_ESCAPE 57 +#define RC_EXEC 58 +#define RC_FIT 59 +#define RC_FLOW 60 +#define RC_FOCUS 61 +#define RC_GR 62 +#define RC_HARDCOPY 63 +#define RC_HARDCOPY_APPEND 64 +#define RC_HARDCOPYDIR 65 +#define RC_HARDSTATUS 66 +#define RC_HEIGHT 67 +#define RC_HELP 68 +#define RC_HISTORY 69 +#define RC_HSTATUS 70 +#define RC_INFO 71 +#define RC_KANJI 72 +#define RC_KILL 73 +#define RC_LASTMSG 74 +#define RC_LICENSE 75 +#define RC_LOCKSCREEN 76 +#define RC_LOG 77 +#define RC_LOGFILE 78 +#define RC_LOGIN 79 +#define RC_LOGTSTAMP 80 +#define RC_MAPDEFAULT 81 +#define RC_MAPNOTNEXT 82 +#define RC_MAPTIMEOUT 83 +#define RC_MARKKEYS 84 +#define RC_META 85 +#define RC_MONITOR 86 +#define RC_MSGMINWAIT 87 +#define RC_MSGWAIT 88 +#define RC_MULTIUSER 89 +#define RC_NETHACK 90 +#define RC_NEXT 91 +#define RC_NONBLOCK 92 +#define RC_NUMBER 93 +#define RC_OBUFLIMIT 94 +#define RC_ONLY 95 +#define RC_OTHER 96 +#define RC_PARTIAL 97 +#define RC_PASSWORD 98 +#define RC_PASTE 99 +#define RC_PASTEFONT 100 +#define RC_POW_BREAK 101 +#define RC_POW_DETACH 102 +#define RC_POW_DETACH_MSG 103 +#define RC_PREV 104 +#define RC_PRINTCMD 105 +#define RC_PROCESS 106 +#define RC_QUIT 107 +#define RC_READBUF 108 +#define RC_READREG 109 +#define RC_REDISPLAY 110 +#define RC_REGISTER 111 +#define RC_REMOVE 112 +#define RC_REMOVEBUF 113 +#define RC_RESET 114 +#define RC_RESIZE 115 +#define RC_SCREEN 116 +#define RC_SCROLLBACK 117 +#define RC_SELECT 118 +#define RC_SESSIONNAME 119 +#define RC_SETENV 120 +#define RC_SHELL 121 +#define RC_SHELLTITLE 122 +#define RC_SILENCE 123 +#define RC_SILENCEWAIT 124 +#define RC_SLEEP 125 +#define RC_SLOWPASTE 126 +#define RC_SORENDITION 127 +#define RC_SPLIT 128 +#define RC_STARTUP_MESSAGE 129 +#define RC_STUFF 130 +#define RC_SU 131 +#define RC_SUSPEND 132 +#define RC_TERM 133 +#define RC_TERMCAP 134 +#define RC_TERMCAPINFO 135 +#define RC_TERMINFO 136 +#define RC_TIME 137 +#define RC_TITLE 138 +#define RC_UMASK 139 +#define RC_UNSETENV 140 +#define RC_VBELL 141 +#define RC_VBELL_MSG 142 +#define RC_VBELLWAIT 143 +#define RC_VERBOSE 144 +#define RC_VERSION 145 +#define RC_WALL 146 +#define RC_WIDTH 147 +#define RC_WINDOWS 148 +#define RC_WRAP 149 +#define RC_WRITEBUF 150 +#define RC_WRITELOCK 151 +#define RC_XOFF 152 +#define RC_XON 153 +#define RC_ZOMBIE 154 -#define RC_LAST 151 +#define RC_LAST 154 diff --git a/src/comm.sh b/src/comm.sh index d5fd8b0..a7c1447 100644 --- a/src/comm.sh +++ b/src/comm.sh @@ -39,6 +39,7 @@ struct comm #define NEED_FORE (1<<6) /* this command needs a fore window */ #define NEED_DISPLAY (1<<7) /* this command needs a display */ +#define NEED_LAYER (1<<8) /* this command needs a layer */ #define ARGS_01 (ARGS_0 | ARGS_PLUS1) #define ARGS_02 (ARGS_0 | ARGS_PLUS2) diff --git a/src/config.h.in b/src/config.h.in index 4a5ecb3..983956d 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -50,7 +50,7 @@ * Screen will name the subdirectories "S-$USER" (e.g /tmp/S-davison). */ -#define SOCKDIR (eff_uid ? "/tmp/uscreens" : "/tmp/screens") +#undef SOCKDIR /* * Screen sources two startup files. First a global file with a path @@ -131,6 +131,8 @@ * Needs FONT to work. * define BUILTIN_TELNET to add telnet support to screen. * Syntax: screen //telnet host [port] + * define RXVT_OSC if you want support for rxvts special + * change fgcolor/bgcolor/bgpicture sequences */ #undef SIMPLESCREEN #ifndef SIMPLESCREEN @@ -150,6 +152,7 @@ #endif /* SIMPLESCREEN */ #undef BUILTIN_TELNET +#undef RXVT_OSC /* diff --git a/src/configure b/src/configure index be6c524..02e89fe 100755 --- a/src/configure +++ b/src/configure @@ -11,6 +11,12 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: +ac_help="$ac_help + --disable-socket-dir disable system wide socket-dir and use ~/.screen instead" +ac_help="$ac_help + --with-socket-dir=path where to put the per-user sockets" +ac_help="$ac_help + --with-sys-screenrc=path where to put the global screenrc file" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -533,7 +539,7 @@ echo $ac_n "checking for prefix by $ac_c" 1>&6 # Extract the first word of "screen", so it can be a program name with args. set dummy screen; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:537: checking for $ac_word" >&5 +echo "configure:543: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_SCREEN'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -571,7 +577,7 @@ echo $ac_n "checking for prefix by $ac_c" 1>&6 # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:575: checking for $ac_word" >&5 +echo "configure:581: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -608,7 +614,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:612: checking for $ac_word" >&5 +echo "configure:618: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -637,7 +643,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:641: checking for $ac_word" >&5 +echo "configure:647: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -685,7 +691,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:689: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -695,11 +701,11 @@ ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext <<EOF -#line 699 "configure" +#line 705 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:703: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -719,12 +725,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:723: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:729: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:728: checking whether we are using GNU C" >&5 +echo "configure:734: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -733,7 +739,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:737: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:743: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -748,7 +754,7 @@ if test $ac_cv_prog_gcc = yes; then ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:752: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:758: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -776,7 +782,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:780: checking how to run the C preprocessor" >&5 +echo "configure:786: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -791,13 +797,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext <<EOF -#line 795 "configure" +#line 801 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:801: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:807: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -808,13 +814,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext <<EOF -#line 812 "configure" +#line 818 "configure" #include "confdefs.h" #include <assert.h> Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:818: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:824: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then : @@ -838,13 +844,13 @@ echo "$ac_t""$CPP" 1>&6 if test $ac_cv_prog_gcc = yes; then echo $ac_n "checking whether ${CC-cc} needs -traditional""... $ac_c" 1>&6 -echo "configure:842: checking whether ${CC-cc} needs -traditional" >&5 +echo "configure:848: checking whether ${CC-cc} needs -traditional" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc_traditional'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_pattern="Autoconf.*'x'" cat > conftest.$ac_ext <<EOF -#line 848 "configure" +#line 854 "configure" #include "confdefs.h" #include <sgtty.h> Autoconf TIOCGETP @@ -862,7 +868,7 @@ rm -f conftest* if test $ac_cv_prog_gcc_traditional = no; then cat > conftest.$ac_ext <<EOF -#line 866 "configure" +#line 872 "configure" #include "confdefs.h" #include <termio.h> Autoconf TCGETA @@ -884,7 +890,7 @@ echo "$ac_t""$ac_cv_prog_gcc_traditional" 1>&6 fi echo $ac_n "checking for POSIXized ISC""... $ac_c" 1>&6 -echo "configure:888: checking for POSIXized ISC" >&5 +echo "configure:894: checking for POSIXized ISC" >&5 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then @@ -909,11 +915,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 913 "configure" +#line 919 "configure" #include "confdefs.h" main(){exit(0);} EOF -if { (eval echo configure:917: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -940,11 +946,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 944 "configure" +#line 950 "configure" #include "confdefs.h" main(){exit(0);} EOF -if { (eval echo configure:948: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:954: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -967,7 +973,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 971 "configure" +#line 977 "configure" #include "confdefs.h" main() @@ -977,7 +983,7 @@ main() } EOF -if { (eval echo configure:981: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then { echo "configure: error: Your compiler does not set the exit status - sorry" 1>&2; exit 1; } else @@ -993,7 +999,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:997: checking for $ac_word" >&5 +echo "configure:1003: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_AWK'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1052,7 +1058,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1056: checking for a BSD compatible install" >&5 +echo "configure:1062: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1104,10 +1110,43 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' if test -f etc/toolcheck; then echo "checking for buggy tools" 1>&6 -echo "configure:1108: checking for buggy tools" >&5 +echo "configure:1114: checking for buggy tools" >&5 sh etc/toolcheck 1>&6 fi + + +echo $ac_n "checking if a system-wide socket dir should be used""... $ac_c" 1>&6 +echo "configure:1121: checking if a system-wide socket dir should be used" >&5 +# Check whether --enable-socket-dir or --disable-socket-dir was given. +if test "${enable_socket_dir+set}" = set; then + enableval="$enable_socket_dir" + + echo "$ac_t""no. ~/.screen will be used instead." 1>&6 + +else + + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for the socket dir""... $ac_c" 1>&6 +echo "configure:1132: checking for the socket dir" >&5 + SOCKDIR="(eff_uid ? \"/tmp/uscreens\" : \"/tmp/screens\")" + # Check whether --with-socket-dir or --without-socket-dir was given. +if test "${with_socket_dir+set}" = set; then + withval="$with_socket_dir" + SOCKDIR="\"${withval}\"" +fi + + echo "$ac_t""${SOCKDIR}" 1>&6 + cat >> confdefs.h <<EOF +#define SOCKDIR $SOCKDIR +EOF + + + +fi + + + if test -n "$ISC"; then cat >> confdefs.h <<\EOF #define ISC 1 @@ -1124,21 +1163,21 @@ EOF fi echo "checking for MIPS" 1>&6 -echo "configure:1128: checking for MIPS" >&5 +echo "configure:1167: checking for MIPS" >&5 if test -f /lib/libmld.a || test -f /usr/lib/libmld.a || test -f /usr/lib/cmplrs/cc/libmld.a; then oldlibs="$LIBS" test -f /bin/mx || LIBS="$LIBS -lmld" # for nlist. But not on alpha. echo "checking mld library" 1>&6 -echo "configure:1133: checking mld library" >&5 +echo "configure:1172: checking mld library" >&5 cat > conftest.$ac_ext <<EOF -#line 1135 "configure" +#line 1174 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:1142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1181: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -1153,32 +1192,32 @@ cat >> confdefs.h <<\EOF EOF echo "checking wait3" 1>&6 -echo "configure:1157: checking wait3" >&5 +echo "configure:1196: checking wait3" >&5 cat > conftest.$ac_ext <<EOF -#line 1159 "configure" +#line 1198 "configure" #include "confdefs.h" int main() { wait3(); ; return 0; } EOF -if { (eval echo configure:1166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* echo "checking wait2" 1>&6 -echo "configure:1173: checking wait2" >&5 +echo "configure:1212: checking wait2" >&5 cat > conftest.$ac_ext <<EOF -#line 1175 "configure" +#line 1214 "configure" #include "confdefs.h" int main() { wait2(); ; return 0; } EOF -if { (eval echo configure:1182: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1221: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define USE_WAIT2 1 @@ -1197,9 +1236,9 @@ fi echo "checking for Ultrix" 1>&6 -echo "configure:1201: checking for Ultrix" >&5 +echo "configure:1240: checking for Ultrix" >&5 cat > conftest.$ac_ext <<EOF -#line 1203 "configure" +#line 1242 "configure" #include "confdefs.h" #if defined(ultrix) || defined(__ultrix) yes; @@ -1218,16 +1257,16 @@ if test -f /usr/lib/libpyr.a ; then oldlibs="$LIBS" LIBS="$LIBS -lpyr" echo "checking Pyramid OSX" 1>&6 -echo "configure:1222: checking Pyramid OSX" >&5 +echo "configure:1261: checking Pyramid OSX" >&5 cat > conftest.$ac_ext <<EOF -#line 1224 "configure" +#line 1263 "configure" #include "confdefs.h" int main() { open_controlling_pty("") ; return 0; } EOF -if { (eval echo configure:1231: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1270: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define OSX 1 @@ -1243,9 +1282,9 @@ rm -f conftest* fi echo "checking for butterfly" 1>&6 -echo "configure:1247: checking for butterfly" >&5 +echo "configure:1286: checking for butterfly" >&5 cat > conftest.$ac_ext <<EOF -#line 1249 "configure" +#line 1288 "configure" #include "confdefs.h" #if defined(butterfly) yes; @@ -1265,9 +1304,9 @@ if test -n "$ULTRIX"; then test -z "$GCC" && CC="$CC -YBSD" fi echo "checking for POSIX.1" 1>&6 -echo "configure:1269: checking for POSIX.1" >&5 +echo "configure:1308: checking for POSIX.1" >&5 cat > conftest.$ac_ext <<EOF -#line 1271 "configure" +#line 1310 "configure" #include "confdefs.h" #include <sys/types.h> #include <unistd.h> @@ -1291,9 +1330,9 @@ rm -f conftest* fi echo "checking for System V" 1>&6 -echo "configure:1295: checking for System V" >&5 +echo "configure:1334: checking for System V" >&5 cat > conftest.$ac_ext <<EOF -#line 1297 "configure" +#line 1336 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -1302,7 +1341,7 @@ int main() { int x = SIGCHLD | FNDELAY; ; return 0; } EOF -if { (eval echo configure:1306: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:1345: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then : else echo "configure: failed program was:" >&5 @@ -1316,9 +1355,9 @@ fi rm -f conftest* echo "checking for sequent/ptx" 1>&6 -echo "configure:1320: checking for sequent/ptx" >&5 +echo "configure:1359: checking for sequent/ptx" >&5 cat > conftest.$ac_ext <<EOF -#line 1322 "configure" +#line 1361 "configure" #include "confdefs.h" #ifdef _SEQUENT_ yes; @@ -1336,9 +1375,9 @@ rm -f conftest* oldlibs="$LIBS" LIBS="$LIBS -lelf" echo "checking SVR4" 1>&6 -echo "configure:1340: checking SVR4" >&5 +echo "configure:1379: checking SVR4" >&5 cat > conftest.$ac_ext <<EOF -#line 1342 "configure" +#line 1381 "configure" #include "confdefs.h" #include <utmpx.h> @@ -1346,21 +1385,21 @@ int main() { ; return 0; } EOF -if { (eval echo configure:1350: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1389: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* ac_safe=`echo "dwarf.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for dwarf.h""... $ac_c" 1>&6 -echo "configure:1354: checking for dwarf.h" >&5 +echo "configure:1393: checking for dwarf.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1359 "configure" +#line 1398 "configure" #include "confdefs.h" #include <dwarf.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1364: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1403: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1387,17 +1426,17 @@ else echo "$ac_t""no" 1>&6 ac_safe=`echo "elf.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for elf.h""... $ac_c" 1>&6 -echo "configure:1391: checking for elf.h" >&5 +echo "configure:1430: checking for elf.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 1396 "configure" +#line 1435 "configure" #include "confdefs.h" #include <elf.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1401: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1440: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -1436,9 +1475,9 @@ fi rm -f conftest* echo "checking for Solaris 2.x" 1>&6 -echo "configure:1440: checking for Solaris 2.x" >&5 +echo "configure:1479: checking for Solaris 2.x" >&5 cat > conftest.$ac_ext <<EOF -#line 1442 "configure" +#line 1481 "configure" #include "confdefs.h" #if defined(SVR4) && defined(sun) yes @@ -1456,9 +1495,9 @@ rm -f conftest* echo "checking BSD job jontrol" 1>&6 -echo "configure:1460: checking BSD job jontrol" >&5 +echo "configure:1499: checking BSD job jontrol" >&5 cat > conftest.$ac_ext <<EOF -#line 1462 "configure" +#line 1501 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/ioctl.h> @@ -1478,7 +1517,7 @@ int y = TIOCNOTTY; ; return 0; } EOF -if { (eval echo configure:1482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1521: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "- you have jobcontrol" 1>&6 cat >> confdefs.h <<\EOF @@ -1495,9 +1534,9 @@ fi rm -f conftest* echo "checking setreuid" 1>&6 -echo "configure:1499: checking setreuid" >&5 +echo "configure:1538: checking setreuid" >&5 cat > conftest.$ac_ext <<EOF -#line 1501 "configure" +#line 1540 "configure" #include "confdefs.h" int main() { @@ -1510,7 +1549,7 @@ setreuid(0, 0); ; return 0; } EOF -if { (eval echo configure:1514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SETREUID 1 @@ -1522,9 +1561,9 @@ else fi rm -f conftest* echo "checking seteuid" 1>&6 -echo "configure:1526: checking seteuid" >&5 +echo "configure:1565: checking seteuid" >&5 cat > conftest.$ac_ext <<EOF -#line 1528 "configure" +#line 1567 "configure" #include "confdefs.h" int main() { @@ -1537,7 +1576,7 @@ seteuid(0); ; return 0; } EOF -if { (eval echo configure:1541: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SETEUID 1 @@ -1551,16 +1590,16 @@ rm -f conftest* echo "checking select" 1>&6 -echo "configure:1555: checking select" >&5 +echo "configure:1594: checking select" >&5 cat > conftest.$ac_ext <<EOF -#line 1557 "configure" +#line 1596 "configure" #include "confdefs.h" int main() { select(0, 0, 0, 0, 0); ; return 0; } EOF -if { (eval echo configure:1564: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1603: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -1568,16 +1607,16 @@ else rm -rf conftest* LIBS="$LIBS -lnet -lnsl" echo "checking select with $LIBS" 1>&6 -echo "configure:1572: checking select with $LIBS" >&5 +echo "configure:1611: checking select with $LIBS" >&5 cat > conftest.$ac_ext <<EOF -#line 1574 "configure" +#line 1613 "configure" #include "confdefs.h" int main() { select(0, 0, 0, 0, 0); ; return 0; } EOF -if { (eval echo configure:1581: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:1620: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -1591,12 +1630,12 @@ fi rm -f conftest* echo "checking fifos" 1>&6 -echo "configure:1595: checking fifos" >&5 +echo "configure:1634: checking fifos" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1600 "configure" +#line 1639 "configure" #include "confdefs.h" #include <sys/types.h> @@ -1656,7 +1695,7 @@ main() } EOF -if { (eval echo configure:1660: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1699: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- your fifos are usable" 1>&6 fifo=1 @@ -1674,12 +1713,12 @@ rm -f /tmp/conftest* if test -n "$fifo"; then echo "checking for broken fifo implementation" 1>&6 -echo "configure:1678: checking for broken fifo implementation" >&5 +echo "configure:1717: checking for broken fifo implementation" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1683 "configure" +#line 1722 "configure" #include "confdefs.h" #include <sys/types.h> @@ -1719,7 +1758,7 @@ main() } EOF -if { (eval echo configure:1723: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1762: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- your implementation is ok" 1>&6 @@ -1741,12 +1780,12 @@ fi echo "checking sockets" 1>&6 -echo "configure:1745: checking sockets" >&5 +echo "configure:1784: checking sockets" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1750 "configure" +#line 1789 "configure" #include "confdefs.h" #include <sys/types.h> @@ -1791,7 +1830,7 @@ main() } EOF -if { (eval echo configure:1795: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1834: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- your sockets are usable" 1>&6 sock=1 @@ -1809,12 +1848,12 @@ rm -f /tmp/conftest* if test -n "$sock"; then echo "checking socket implementation" 1>&6 -echo "configure:1813: checking socket implementation" >&5 +echo "configure:1852: checking socket implementation" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1818 "configure" +#line 1857 "configure" #include "confdefs.h" #include <sys/types.h> @@ -1843,7 +1882,7 @@ main() } EOF -if { (eval echo configure:1847: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:1886: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- you are normal" 1>&6 @@ -1902,12 +1941,12 @@ fi echo "checking select return value" 1>&6 -echo "configure:1906: checking select return value" >&5 +echo "configure:1945: checking select return value" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 1911 "configure" +#line 1950 "configure" #include "confdefs.h" #include <sys/types.h> @@ -1996,7 +2035,7 @@ main() } EOF -if { (eval echo configure:2000: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2039: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- select is ok" 1>&6 @@ -2015,13 +2054,27 @@ fi echo "checking for tgetent" 1>&6 -echo "configure:2019: checking for tgetent" >&5 -olibs="$LIBS" +echo "configure:2058: checking for tgetent" >&5 +cat > conftest.$ac_ext <<EOF +#line 2060 "configure" +#include "confdefs.h" + +int main() { +tgetent((char *)0, (char *)0); +; return 0; } +EOF +if { (eval echo configure:2067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + olibs="$LIBS" LIBS="-lcurses $olibs" echo "checking libcurses" 1>&6 -echo "configure:2023: checking libcurses" >&5 +echo "configure:2076: checking libcurses" >&5 cat > conftest.$ac_ext <<EOF -#line 2025 "configure" +#line 2078 "configure" #include "confdefs.h" int main() { @@ -2034,7 +2087,7 @@ tgetent((char *)0, (char *)0); ; return 0; } EOF -if { (eval echo configure:2038: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2091: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2042,16 +2095,16 @@ else rm -rf conftest* LIBS="-ltermcap $olibs" echo "checking libtermcap" 1>&6 -echo "configure:2046: checking libtermcap" >&5 +echo "configure:2099: checking libtermcap" >&5 cat > conftest.$ac_ext <<EOF -#line 2048 "configure" +#line 2101 "configure" #include "confdefs.h" int main() { tgetent((char *)0, (char *)0); ; return 0; } EOF -if { (eval echo configure:2055: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2108: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2059,16 +2112,16 @@ else rm -rf conftest* LIBS="-ltermlib $olibs" echo "checking libtermlib" 1>&6 -echo "configure:2063: checking libtermlib" >&5 +echo "configure:2116: checking libtermlib" >&5 cat > conftest.$ac_ext <<EOF -#line 2065 "configure" +#line 2118 "configure" #include "confdefs.h" int main() { tgetent((char *)0, (char *)0); ; return 0; } EOF -if { (eval echo configure:2072: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2125: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2076,16 +2129,16 @@ else rm -rf conftest* LIBS="-lncurses $olibs" echo "checking libncurses" 1>&6 -echo "configure:2080: checking libncurses" >&5 +echo "configure:2133: checking libncurses" >&5 cat > conftest.$ac_ext <<EOF -#line 2082 "configure" +#line 2135 "configure" #include "confdefs.h" int main() { tgetent((char *)0, (char *)0); ; return 0; } EOF -if { (eval echo configure:2089: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2100,12 +2153,14 @@ fi rm -f conftest* fi rm -f conftest* +fi +rm -f conftest* if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2109 "configure" +#line 2164 "configure" #include "confdefs.h" main() @@ -2113,7 +2168,7 @@ main() exit(strcmp(tgoto("%p1%d", 0, 1), "1") ? 0 : 1); } EOF -if { (eval echo configure:2117: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2172: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then echo "- you use the termcap database" 1>&6 @@ -2131,16 +2186,16 @@ rm -fr conftest* fi echo "checking ospeed" 1>&6 -echo "configure:2135: checking ospeed" >&5 +echo "configure:2190: checking ospeed" >&5 cat > conftest.$ac_ext <<EOF -#line 2137 "configure" +#line 2192 "configure" #include "confdefs.h" extern short ospeed; int main() { ospeed=5; ; return 0; } EOF -if { (eval echo configure:2144: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2199: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2154,7 +2209,7 @@ fi rm -f conftest* echo "checking for /dev/ptc" 1>&6 -echo "configure:2158: checking for /dev/ptc" >&5 +echo "configure:2213: checking for /dev/ptc" >&5 if test -r /dev/ptc; then cat >> confdefs.h <<\EOF #define HAVE_DEV_PTC 1 @@ -2163,17 +2218,17 @@ EOF fi echo "checking for SVR4 ptys" 1>&6 -echo "configure:2167: checking for SVR4 ptys" >&5 +echo "configure:2222: checking for SVR4 ptys" >&5 if test -c /dev/ptmx ; then cat > conftest.$ac_ext <<EOF -#line 2170 "configure" +#line 2225 "configure" #include "confdefs.h" int main() { ptsname(0);grantpt(0);unlockpt(0); ; return 0; } EOF -if { (eval echo configure:2177: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define HAVE_SVR4_PTYS 1 @@ -2187,14 +2242,14 @@ rm -f conftest* fi echo "checking for ptyranges" 1>&6 -echo "configure:2191: checking for ptyranges" >&5 +echo "configure:2246: checking for ptyranges" >&5 if test -d /dev/ptym ; then pdir='/dev/ptym' else pdir='/dev' fi cat > conftest.$ac_ext <<EOF -#line 2198 "configure" +#line 2253 "configure" #include "confdefs.h" #ifdef M_UNIX yes; @@ -2225,13 +2280,13 @@ EOF fi echo "checking default tty permissions/group" 1>&6 -echo "configure:2229: checking default tty permissions/group" >&5 +echo "configure:2284: checking default tty permissions/group" >&5 rm -f conftest_grp if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2235 "configure" +#line 2290 "configure" #include "confdefs.h" #include <sys/types.h> @@ -2263,7 +2318,7 @@ main() } EOF -if { (eval echo configure:2267: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then if test -f conftest_grp; then @@ -2297,9 +2352,9 @@ fi rm -f conftest_grp echo "checking getutent" 1>&6 -echo "configure:2301: checking getutent" >&5 +echo "configure:2356: checking getutent" >&5 cat > conftest.$ac_ext <<EOF -#line 2303 "configure" +#line 2358 "configure" #include "confdefs.h" #include <time.h> /* to get time_t on SCO */ @@ -2318,7 +2373,7 @@ int main() { int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent(); ; return 0; } EOF -if { (eval echo configure:2322: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define GETUTENT 1 @@ -2331,9 +2386,9 @@ else olibs="$LIBS" LIBS="$LIBS -lgen" echo "checking getutent with -lgen" 1>&6 -echo "configure:2335: checking getutent with -lgen" >&5 +echo "configure:2390: checking getutent with -lgen" >&5 cat > conftest.$ac_ext <<EOF -#line 2337 "configure" +#line 2392 "configure" #include "confdefs.h" #include <time.h> @@ -2352,7 +2407,7 @@ int main() { int x = DEAD_PROCESS; pututline((struct utmp *)0); getutent(); ; return 0; } EOF -if { (eval echo configure:2356: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2411: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define GETUTENT 1 @@ -2369,9 +2424,9 @@ rm -f conftest* fi rm -f conftest* echo "checking ut_host" 1>&6 -echo "configure:2373: checking ut_host" >&5 +echo "configure:2428: checking ut_host" >&5 cat > conftest.$ac_ext <<EOF -#line 2375 "configure" +#line 2430 "configure" #include "confdefs.h" #include <time.h> @@ -2387,7 +2442,7 @@ int main() { struct utmp u; u.ut_host[0] = 0; ; return 0; } EOF -if { (eval echo configure:2391: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2446: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define UTHOST 1 @@ -2400,17 +2455,17 @@ fi rm -f conftest* ac_safe=`echo "utempter.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for utempter.h""... $ac_c" 1>&6 -echo "configure:2404: checking for utempter.h" >&5 +echo "configure:2459: checking for utempter.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2409 "configure" +#line 2464 "configure" #include "confdefs.h" #include <utempter.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2414: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2469: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2441,21 +2496,21 @@ EOF fi echo "checking for libutil(s)" 1>&6 -echo "configure:2445: checking for libutil(s)" >&5 +echo "configure:2500: checking for libutil(s)" >&5 test -f /usr/lib/libutils.a && LIBS="$LIBS -lutils" test -f /usr/lib/libutil.a && LIBS="$LIBS -lutil" echo "checking getloadavg" 1>&6 -echo "configure:2450: checking getloadavg" >&5 +echo "configure:2505: checking getloadavg" >&5 cat > conftest.$ac_ext <<EOF -#line 2452 "configure" +#line 2507 "configure" #include "confdefs.h" int main() { getloadavg((double *)0, 0); ; return 0; } EOF -if { (eval echo configure:2459: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define LOADAV_GETLOADAVG 1 @@ -2469,16 +2524,16 @@ else olibs="$LIBS" LIBS="$LIBS -lkvm" echo "checking getloadavg with -lkvm" 1>&6 -echo "configure:2473: checking getloadavg with -lkvm" >&5 +echo "configure:2528: checking getloadavg with -lkvm" >&5 cat > conftest.$ac_ext <<EOF -#line 2475 "configure" +#line 2530 "configure" #include "confdefs.h" int main() { getloadavg((double *)0, 0); ; return 0; } EOF -if { (eval echo configure:2482: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2537: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define LOADAV_GETLOADAVG 1 @@ -2498,7 +2553,7 @@ rm -f conftest* if test -z "$load" ; then cat > conftest.$ac_ext <<EOF -#line 2502 "configure" +#line 2557 "configure" #include "confdefs.h" #if defined(NeXT) || defined(apollo) || defined(linux) yes; @@ -2515,7 +2570,7 @@ rm -f conftest* fi if test -z "$load" ; then echo "checking for kernelfile" 1>&6 -echo "configure:2519: checking for kernelfile" >&5 +echo "configure:2574: checking for kernelfile" >&5 for core in /unix /vmunix /dynix /hp-ux /xelos /dev/ksyms /kernel/unix /kernel/genunix /unicos /mach /netbsd /386bsd /dgux /bsd /stand/vmunix; do if test -f $core || test -c $core; then break @@ -2534,17 +2589,17 @@ EOF ac_safe=`echo "nlist.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for nlist.h""... $ac_c" 1>&6 -echo "configure:2538: checking for nlist.h" >&5 +echo "configure:2593: checking for nlist.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 2543 "configure" +#line 2598 "configure" #include "confdefs.h" #include <nlist.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2548: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2603: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -2565,16 +2620,16 @@ if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then EOF echo "checking n_un in struct nlist" 1>&6 -echo "configure:2569: checking n_un in struct nlist" >&5 +echo "configure:2624: checking n_un in struct nlist" >&5 cat > conftest.$ac_ext <<EOF -#line 2571 "configure" +#line 2626 "configure" #include "confdefs.h" #include <nlist.h> int main() { struct nlist n; n.n_un.n_name = 0; ; return 0; } EOF -if { (eval echo configure:2578: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2633: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define NLIST_NAME_UNION 1 @@ -2591,9 +2646,9 @@ fi echo "checking for nlist declaration" 1>&6 -echo "configure:2595: checking for nlist declaration" >&5 +echo "configure:2650: checking for nlist declaration" >&5 cat > conftest.$ac_ext <<EOF -#line 2597 "configure" +#line 2652 "configure" #include "confdefs.h" #ifdef NLIST_STRUCT @@ -2615,13 +2670,13 @@ rm -f conftest* echo "checking for avenrun symbol" 1>&6 -echo "configure:2619: checking for avenrun symbol" >&5 +echo "configure:2674: checking for avenrun symbol" >&5 for av in avenrun _avenrun _Loadavg ; do if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2625 "configure" +#line 2680 "configure" #include "confdefs.h" #include <sys/types.h> @@ -2657,7 +2712,7 @@ main() } EOF -if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2716: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then avensym=$av;break else @@ -2700,13 +2755,14 @@ fi fi cat > conftest.c <<EOF +#include "confdefs.h" #include <sys/types.h> #include <sys/param.h> _CUT_HERE_ -#if ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || !(defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) +#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || !(defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) loadtype=long # if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) loadscale=65536 @@ -2772,9 +2828,9 @@ EOF else echo "checking return type of signal handlers" 1>&6 -echo "configure:2776: checking return type of signal handlers" >&5 +echo "configure:2832: checking return type of signal handlers" >&5 cat > conftest.$ac_ext <<EOF -#line 2778 "configure" +#line 2834 "configure" #include "confdefs.h" #include <sys/types.h> #include <signal.h> @@ -2786,7 +2842,7 @@ int main() { int i; ; return 0; } EOF -if { (eval echo configure:2790: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2846: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SIGVOID 1 @@ -2798,9 +2854,9 @@ else fi rm -f conftest* echo "checking sigset" 1>&6 -echo "configure:2802: checking sigset" >&5 +echo "configure:2858: checking sigset" >&5 cat > conftest.$ac_ext <<EOF -#line 2804 "configure" +#line 2860 "configure" #include "confdefs.h" #include <sys/types.h> @@ -2816,7 +2872,7 @@ sigset(0, (int (*)())0); ; return 0; } EOF -if { (eval echo configure:2820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2876: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define USESIGSET 1 @@ -2828,12 +2884,12 @@ else fi rm -f conftest* echo "checking signal implementation" 1>&6 -echo "configure:2832: checking signal implementation" >&5 +echo "configure:2888: checking signal implementation" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 2837 "configure" +#line 2893 "configure" #include "confdefs.h" #include <sys/types.h> @@ -2870,7 +2926,7 @@ main() } EOF -if { (eval echo configure:2874: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2930: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -2890,21 +2946,21 @@ fi echo "checking for crypt and sec libraries" 1>&6 -echo "configure:2894: checking for crypt and sec libraries" >&5 +echo "configure:2950: checking for crypt and sec libraries" >&5 test -f /lib/libcrypt_d.a || test -f /usr/lib/libcrypt_d.a && LIBS="$LIBS -lcrypt_d" oldlibs="$LIBS" LIBS="$LIBS -lcrypt" echo "checking crypt" 1>&6 -echo "configure:2899: checking crypt" >&5 +echo "configure:2955: checking crypt" >&5 cat > conftest.$ac_ext <<EOF -#line 2901 "configure" +#line 2957 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2918,16 +2974,16 @@ test -f /lib/libshadow.a || test -f /usr/lib/libshadow.a && LIBS="$LIBS -lshadow oldlibs="$LIBS" LIBS="$LIBS -lsun" echo "checking IRIX sun library" 1>&6 -echo "configure:2922: checking IRIX sun library" >&5 +echo "configure:2978: checking IRIX sun library" >&5 cat > conftest.$ac_ext <<EOF -#line 2924 "configure" +#line 2980 "configure" #include "confdefs.h" int main() { ; return 0; } EOF -if { (eval echo configure:2931: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:2987: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2938,16 +2994,16 @@ fi rm -f conftest* echo "checking syslog" 1>&6 -echo "configure:2942: checking syslog" >&5 +echo "configure:2998: checking syslog" >&5 cat > conftest.$ac_ext <<EOF -#line 2944 "configure" +#line 3000 "configure" #include "confdefs.h" int main() { closelog(); ; return 0; } EOF -if { (eval echo configure:2951: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3007: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then : else echo "configure: failed program was:" >&5 @@ -2956,16 +3012,16 @@ else oldlibs="$LIBS" LIBS="$LIBS -lbsd" echo "checking syslog in libbsd.a" 1>&6 -echo "configure:2960: checking syslog in libbsd.a" >&5 +echo "configure:3016: checking syslog in libbsd.a" >&5 cat > conftest.$ac_ext <<EOF -#line 2962 "configure" +#line 3018 "configure" #include "confdefs.h" int main() { closelog(); ; return 0; } EOF -if { (eval echo configure:2969: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3025: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "- found." 1>&6 @@ -2973,7 +3029,7 @@ else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* - LIBS="oldlibs" + LIBS="$oldlibs" echo "- bad news: syslog missing." 1>&6 cat >> confdefs.h <<\EOF #define NOSYSLOG 1 @@ -2985,7 +3041,7 @@ fi rm -f conftest* cat > conftest.$ac_ext <<EOF -#line 2989 "configure" +#line 3045 "configure" #include "confdefs.h" #ifdef M_UNIX yes; @@ -3001,9 +3057,9 @@ rm -f conftest* echo "checking wait union" 1>&6 -echo "configure:3005: checking wait union" >&5 +echo "configure:3061: checking wait union" >&5 cat > conftest.$ac_ext <<EOF -#line 3007 "configure" +#line 3063 "configure" #include "confdefs.h" #include <sys/types.h> #include <sys/wait.h> @@ -3018,7 +3074,7 @@ int main() { ; return 0; } EOF -if { (eval echo configure:3022: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3078: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* cat >> confdefs.h <<\EOF #define BSDWAIT 1 @@ -3032,14 +3088,14 @@ rm -f conftest* if test -z "$butterfly"; then echo "checking for termio or termios" 1>&6 -echo "configure:3036: checking for termio or termios" >&5 +echo "configure:3092: checking for termio or termios" >&5 cat > conftest.$ac_ext <<EOF -#line 3038 "configure" +#line 3094 "configure" #include "confdefs.h" #include <termio.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3043: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3099: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3054,12 +3110,12 @@ else rm -rf conftest* if test -n "$posix"; then cat > conftest.$ac_ext <<EOF -#line 3058 "configure" +#line 3114 "configure" #include "confdefs.h" #include <termios.h> EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3063: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3119: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out` if test -z "$ac_err"; then rm -rf conftest* @@ -3080,16 +3136,16 @@ rm -f conftest* fi echo "checking getspnam" 1>&6 -echo "configure:3084: checking getspnam" >&5 +echo "configure:3140: checking getspnam" >&5 cat > conftest.$ac_ext <<EOF -#line 3086 "configure" +#line 3142 "configure" #include "confdefs.h" #include <shadow.h> int main() { getspnam("x"); ; return 0; } EOF -if { (eval echo configure:3093: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define SHADOWPW 1 @@ -3102,16 +3158,16 @@ fi rm -f conftest* echo "checking getttyent" 1>&6 -echo "configure:3106: checking getttyent" >&5 +echo "configure:3162: checking getttyent" >&5 cat > conftest.$ac_ext <<EOF -#line 3108 "configure" +#line 3164 "configure" #include "confdefs.h" int main() { getttyent(); ; return 0; } EOF -if { (eval echo configure:3115: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3171: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* cat >> confdefs.h <<\EOF #define GETTTYENT 1 @@ -3124,12 +3180,12 @@ fi rm -f conftest* echo "checking whether memcpy/memmove/bcopy handles overlapping arguments" 1>&6 -echo "configure:3128: checking whether memcpy/memmove/bcopy handles overlapping arguments" >&5 +echo "configure:3184: checking whether memcpy/memmove/bcopy handles overlapping arguments" >&5 if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3133 "configure" +#line 3189 "configure" #include "confdefs.h" main() { @@ -3145,7 +3201,7 @@ main() { exit(0); /* libc version works properly. */ } EOF -if { (eval echo configure:3149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define USEBCOPY 1 @@ -3163,7 +3219,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3167 "configure" +#line 3223 "configure" #include "confdefs.h" #define bcopy(s,d,l) memmove(d,s,l) @@ -3180,7 +3236,7 @@ main() { exit(0); /* libc version works properly. */ } EOF -if { (eval echo configure:3184: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3240: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define USEMEMMOVE 1 @@ -3199,7 +3255,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3203 "configure" +#line 3259 "configure" #include "confdefs.h" #define bcopy(s,d,l) memcpy(d,s,l) @@ -3216,7 +3272,7 @@ main() { exit(0); /* libc version works properly. */ } EOF -if { (eval echo configure:3220: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then cat >> confdefs.h <<\EOF #define USEMEMCPY 1 @@ -3231,7 +3287,7 @@ fi echo $ac_n "checking long file names""... $ac_c" 1>&6 -echo "configure:3235: checking long file names" >&5 +echo "configure:3291: checking long file names" >&5 (echo 1 > /tmp/conftest9012345) 2>/dev/null (echo 2 > /tmp/conftest9012346) 2>/dev/null val=`cat /tmp/conftest9012345 2>/dev/null` @@ -3247,16 +3303,16 @@ fi rm -f /tmp/conftest* echo $ac_n "checking for vsprintf""... $ac_c" 1>&6 -echo "configure:3251: checking for vsprintf" >&5 +echo "configure:3307: checking for vsprintf" >&5 cat > conftest.$ac_ext <<EOF -#line 3253 "configure" +#line 3309 "configure" #include "confdefs.h" int main() { vsprintf(0,0,0); ; return 0; } EOF -if { (eval echo configure:3260: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3316: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define USEVARARGS 1 @@ -3275,12 +3331,12 @@ for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr that defines DIR""... $ac_c" 1>&6 -echo "configure:3279: checking for $ac_hdr that defines DIR" >&5 +echo "configure:3335: checking for $ac_hdr that defines DIR" >&5 if eval "test \"`echo '$''{'ac_cv_header_dirent_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3284 "configure" +#line 3340 "configure" #include "confdefs.h" #include <sys/types.h> #include <$ac_hdr> @@ -3288,7 +3344,7 @@ int main() { DIR *dirp = 0; ; return 0; } EOF -if { (eval echo configure:3292: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3348: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* eval "ac_cv_header_dirent_$ac_safe=yes" else @@ -3313,7 +3369,7 @@ done # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix. if test $ac_header_dirent = dirent.h; then echo $ac_n "checking for opendir in -ldir""... $ac_c" 1>&6 -echo "configure:3317: checking for opendir in -ldir" >&5 +echo "configure:3373: checking for opendir in -ldir" >&5 ac_lib_var=`echo dir'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3321,7 +3377,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldir $LIBS" cat > conftest.$ac_ext <<EOF -#line 3325 "configure" +#line 3381 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3332,7 +3388,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:3336: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3392: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3354,7 +3410,7 @@ fi else echo $ac_n "checking for opendir in -lx""... $ac_c" 1>&6 -echo "configure:3358: checking for opendir in -lx" >&5 +echo "configure:3414: checking for opendir in -lx" >&5 ac_lib_var=`echo x'_'opendir | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3362,7 +3418,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lx $LIBS" cat > conftest.$ac_ext <<EOF -#line 3366 "configure" +#line 3422 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ /* We use char because int might match the return type of a gcc2 @@ -3373,7 +3429,7 @@ int main() { opendir() ; return 0; } EOF -if { (eval echo configure:3377: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3433: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3397,16 +3453,16 @@ fi echo $ac_n "checking for setenv""... $ac_c" 1>&6 -echo "configure:3401: checking for setenv" >&5 +echo "configure:3457: checking for setenv" >&5 cat > conftest.$ac_ext <<EOF -#line 3403 "configure" +#line 3459 "configure" #include "confdefs.h" int main() { setenv((char *)0,(char *)0);unsetenv((char *)0); ; return 0; } EOF -if { (eval echo configure:3410: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3466: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6;cat >> confdefs.h <<\EOF #define USESETENV 1 @@ -3418,16 +3474,16 @@ else rm -rf conftest* echo "$ac_t""no" 1>&6 echo $ac_n "checking for putenv""... $ac_c" 1>&6 -echo "configure:3422: checking for putenv" >&5 +echo "configure:3478: checking for putenv" >&5 cat > conftest.$ac_ext <<EOF -#line 3424 "configure" +#line 3480 "configure" #include "confdefs.h" int main() { putenv((char *)0);unsetenv((char *)0); ; return 0; } EOF -if { (eval echo configure:3431: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3487: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -3447,12 +3503,12 @@ rm -f conftest* for ac_func in rename fchmod fchown strerror lstat _exit utimes vsnprintf getcwd do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3451: checking for $ac_func" >&5 +echo "configure:3507: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <<EOF -#line 3456 "configure" +#line 3512 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func(); below. */ @@ -3475,7 +3531,7 @@ $ac_func(); ; return 0; } EOF -if { (eval echo configure:3479: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3535: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3506,11 +3562,11 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <<EOF -#line 3510 "configure" +#line 3566 "configure" #include "confdefs.h" main(){exit(0);} EOF -if { (eval echo configure:3514: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3570: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null then : else @@ -3522,12 +3578,24 @@ fi rm -fr conftest* fi + +ETCSCREENRC="\"/usr/local/etc/screenrc\"" if test -n "$prefix"; then +ETCSCREENRC="\"$prefix/etc/screenrc\"" +fi +echo $ac_n "checking for the global screenrc file""... $ac_c" 1>&6 +echo "configure:3588: checking for the global screenrc file" >&5 +# Check whether --with-sys-screenrc or --without-sys-screenrc was given. +if test "${with_sys_screenrc+set}" = set; then + withval="$with_sys_screenrc" + ETCSCREENRC="\"${withval}\"" +fi + cat >> confdefs.h <<EOF -#define ETCSCREENRC "$prefix/etc/screenrc" +#define ETCSCREENRC $ETCSCREENRC EOF -fi +echo "$ac_t""$ETCSCREENRC" 1>&6 trap '' 1 2 15 cat > confcache <<\EOF diff --git a/src/configure.in b/src/configure.in index c02de6d..ef0be1f 100644 --- a/src/configure.in +++ b/src/configure.in @@ -14,6 +14,7 @@ dnl Define some useful macros dnl AC_DEFUN(AC_PROGRAM_SOURCE, [AC_REQUIRE([AC_PROG_CPP])AC_PROVIDE([$0])cat > conftest.c <<EOF +#include "confdefs.h" [$1] _CUT_HERE_ [$2] @@ -78,6 +79,26 @@ AC_CHECKING(for buggy tools) sh etc/toolcheck 1>&AC_FD_MSG fi + + +dnl SOCKDIR +AC_MSG_CHECKING(if a system-wide socket dir should be used) +AC_ARG_ENABLE(socket-dir, + [ --disable-socket-dir disable system wide socket-dir and use ~/.screen instead], + [ + AC_MSG_RESULT(no. ~/.screen will be used instead.) + ], + [ + AC_MSG_RESULT(yes) + AC_MSG_CHECKING(for the socket dir) + SOCKDIR="(eff_uid ? \"/tmp/uscreens\" : \"/tmp/screens\")" + AC_ARG_WITH(socket-dir, [ --with-socket-dir=path where to put the per-user sockets], [ SOCKDIR="\"${withval}\"" ]) + AC_MSG_RESULT(${SOCKDIR}) + AC_DEFINE_UNQUOTED(SOCKDIR, $SOCKDIR) + ] +) + + dnl dnl **** special unix variants **** dnl @@ -581,6 +602,7 @@ dnl dnl **** termcap or terminfo **** dnl AC_CHECKING(for tgetent) +AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, olibs="$LIBS" LIBS="-lcurses $olibs" AC_CHECKING(libcurses) @@ -600,7 +622,7 @@ AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, LIBS="-lncurses $olibs" AC_CHECKING(libncurses) AC_TRY_LINK(,tgetent((char *)0, (char *)0);,, -AC_MSG_ERROR(!!! no tgetent - no screen))))) +AC_MSG_ERROR(!!! no tgetent - no screen)))))) AC_TRY_RUN([ main() @@ -862,7 +884,7 @@ AC_PROGRAM_SOURCE([ #include <sys/types.h> #include <sys/param.h> ],[ -#if ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || !(defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) +#if !defined(LOADAV_GETLOADAVG) && ((defined(hp300) && !defined(__hpux)) || defined(sun) || (defined(ultrix) && defined(mips)) || defined(_SEQUENT_) || defined(sgi) || defined(SVR4) || defined(sony_news) || !(defined(__osf__) && defined(__alpha)) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) || defined(m88k)) loadtype=long # if defined(apollo) || defined(_IBMR2) || defined(_AUX_SOURCE) || defined(AUX) loadscale=65536 @@ -988,7 +1010,7 @@ AC_CHECKING(syslog) AC_TRY_LINK(,[closelog();], , [oldlibs="$LIBS" LIBS="$LIBS -lbsd" AC_CHECKING(syslog in libbsd.a) -AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="oldlibs" +AC_TRY_LINK(, [closelog();], AC_NOTE(- found.), [LIBS="$oldlibs" AC_NOTE(- bad news: syslog missing.) AC_DEFINE(NOSYSLOG)])]) AC_EGREP_CPP(yes, @@ -1106,9 +1128,15 @@ dnl Ptx bug workaround -- insert -lc after -ltermcap test -n "$seqptx" && LIBS="-ltermcap -lc -lsocket -linet -lnsl -lsec -lseq" AC_TRY_RUN(main(){exit(0);},,AC_MSG_ERROR(Can't run the compiler - internal error. Sorry.)) + +ETCSCREENRC="\"/usr/local/etc/screenrc\"" if test -n "$prefix"; then -AC_DEFINE_UNQUOTED(ETCSCREENRC,"$prefix/etc/screenrc") +ETCSCREENRC="\"$prefix/etc/screenrc\"" fi +AC_MSG_CHECKING(for the global screenrc file) +AC_ARG_WITH(sys-screenrc, [ --with-sys-screenrc=path where to put the global screenrc file], [ ETCSCREENRC="\"${withval}\"" ]) +AC_DEFINE_UNQUOTED(ETCSCREENRC,$ETCSCREENRC) +AC_MSG_RESULT($ETCSCREENRC) AC_OUTPUT(Makefile doc/Makefile, [[ # a hook for preserving undef directive in config.h diff --git a/src/display.c b/src/display.c index 0f502cd..7826759 100644 --- a/src/display.c +++ b/src/display.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -34,7 +34,7 @@ RCS_ID("$Id$ FAU") #include "braille.h" static int CountChars __P((int)); -static int PutChar __P((int)); +static int DoAddChar __P((int)); static int BlankResize __P((int, int)); static int CallRewrite __P((int, int, int, int)); static void FreeCanvas __P((struct canvas *)); @@ -47,8 +47,11 @@ static void cv_winid_fn __P((struct event *, char *)); static void disp_map_fn __P((struct event *, char *)); #endif static void WriteLP __P((int, int)); -static void INSERTCHAR __P((int)); -static void RAW_PUTCHAR __P((int)); +static void INSERTCHAR __P((int)); +static void RAW_PUTCHAR __P((int)); +#ifdef COLOR +static void SetBackColor __P((int)); +#endif extern struct layer *flayer; @@ -59,7 +62,7 @@ extern int use_hardstatus; extern int MsgWait, MsgMinWait; extern int Z0width, Z1width; extern char *blank, *null; -extern struct mline mline_blank, mline_null; +extern struct mline mline_blank, mline_null, mline_old; extern struct mchar mchar_null, mchar_blank, mchar_so; /* XXX shouldn't be here */ @@ -109,14 +112,14 @@ DefRedisplayLine(y, xs, xe, isblank) int y, xs, xe, isblank; { if (isblank == 0 && y >= 0) - DefClearLine(y, xs, xe); + DefClearLine(y, xs, xe, 0); } void -DefClearLine(y, xs, xe) -int y, xs, xe; +DefClearLine(y, xs, xe, bce) +int y, xs, xe, bce; { - LClearLine(flayer, y, xs, xe, (struct mline *)0); + LClearLine(flayer, y, xs, xe, bce, (struct mline *)0); } /*ARGSUSED*/ @@ -144,6 +147,7 @@ DefRestore() LKeypadMode(flayer, 0); LCursorkeysMode(flayer, 0); LCursorVisibility(flayer, 0); + LMouseMode(flayer, 0); LSetRendition(flayer, &mchar_null); LSetFlow(flayer, FLOW_NOW); } @@ -227,6 +231,7 @@ struct mode *Mode; D_mapev.handler = disp_map_fn; #endif D_OldMode = *Mode; + D_status_obuffree = -1; Resize_obuf(); /* Allocate memory for buffer */ D_obufmax = defobuflimit; D_obuflenmax = D_obuflen - D_obufmax; @@ -673,7 +678,7 @@ int adapt; ChangeScrollRegion(0, D_height - 1); D_x = D_y = 0; Flush(); - ClearDisplay(); + ClearAll(); debug1("we %swant to adapt all our windows to the display\n", (adapt) ? "" : "don't "); /* In case the size was changed by a init sequence */ @@ -692,6 +697,7 @@ FinitTerm() KeypadMode(0); CursorkeysMode(0); CursorVisibility(0); + MouseMode(0); SetRendition(&mchar_null); SetFlow(FLOW_NOW); #ifdef MAPKEYS @@ -700,6 +706,9 @@ FinitTerm() #endif if (D_hstatus) ShowHStatus((char *)0); +#ifdef RXVT_OSC + ClearAllXtermOSC(); +#endif D_x = D_y = -1; GotoPos(0, D_height - 1); AddChar('\r'); @@ -759,15 +768,25 @@ int c; } if (D_CLP || D_y != D_bot) { + int y = D_y; RAW_PUTCHAR(c); + if (D_AM && !D_CLP) + GotoPos(D_width - 1, y); return; } + debug("PUTCHARLP: lp_missing!\n"); D_lp_missing = 1; D_rend.image = c; D_lpchar = D_rend; #ifdef KANJI - D_lp_mbcs = D_mbcs; - D_mbcs = 0; + /* XXX -> PutChar ? */ + if (D_mbcs) + { + D_lpchar.mbcs = c; + D_lpchar.image = D_mbcs; + D_mbcs = 0; + D_x--; + } #endif } @@ -853,10 +872,10 @@ int c; } static int -PutChar(c) +DoAddChar(c) int c; { - /* this PutChar for ESC-sequences only (AddChar is a macro) */ + /* this is for ESC-sequences only (AddChar is a macro) */ AddChar(c); return c; } @@ -868,7 +887,7 @@ char *s; if (display && s) { ospeed = D_dospeed; - tputs(s, 1, PutChar); + tputs(s, 1, DoAddChar); } } @@ -880,7 +899,7 @@ int c; if (display && s) { ospeed = D_dospeed; - tputs(tgoto(s, 0, c), 1, PutChar); + tputs(tgoto(s, 0, c), 1, DoAddChar); } } @@ -974,6 +993,22 @@ int v; } } +void +MouseMode(mode) +int mode; +{ + if (display && D_mouse != mode) + { + if (!D_CXT) + return; + if (D_mouse) + AddStr(D_mouse == 9 ? "\033[?9l" : "\033[?1000l"); + if (mode) + AddStr(mode == 9 ? "\033[?9h" : "\033[?1000h"); + D_mouse = mode; + } +} + static int StrCost; /* ARGSUSED */ @@ -1033,7 +1068,7 @@ int y, xs, xe, doit; cvlnext = cv->c_lnext; flayer->l_cvlist = cv; cv->c_lnext = 0; - Rewrite(y - vp->v_yoff, xs - vp->v_xoff, xe - vp->v_xoff, &D_rend, 1); + LayRewrite(y - vp->v_yoff, xs - vp->v_xoff, xe - vp->v_xoff, &D_rend, 1); flayer->l_cvlist = cvlist; cv->c_lnext = cvlnext; flayer = oldflayer; @@ -1050,7 +1085,7 @@ int y, xs, xe, doit; oldflayer = flayer; flayer = cv->c_layer; debug3("Calling Rewrite %d %d %d\n", y - vp->v_yoff, xs - vp->v_xoff, xe - vp->v_xoff); - cost = Rewrite(y - vp->v_yoff, xs - vp->v_xoff, xe - vp->v_xoff, &D_rend, 0); + cost = LayRewrite(y - vp->v_yoff, xs - vp->v_xoff, xe - vp->v_xoff, &D_rend, 0); flayer = oldflayer; if (D_insert) cost += D_EIcost + D_IMcost; @@ -1105,6 +1140,13 @@ int x2, y2; D_y = y2; return; } + + /* some scrollregion implementations don't allow movements + * away from the region. sigh. + */ + if ((y1 > D_bot && y2 > y1) || (y1 < D_top && y2 < y1)) + goto DoCM; + /* Calculate CMcost */ if (D_HO && !x2 && !y2) s = D_HO; @@ -1128,7 +1170,7 @@ int x2, y2; costx = m; xm = M_RI; } - /* Speedup: dx <= Rewrite() */ + /* Speedup: dx <= LayRewrite() */ if (dx < costx && (m = CallRewrite(y1, x1, x2 - 1, 0)) < costx) { costx = m; @@ -1151,7 +1193,7 @@ int x2, y2; else costx = 0; } - /* Speedup: Rewrite() >= x2 */ + /* Speedup: LayRewrite() >= x2 */ if (x2 + D_CRcost < costx && (m = (x2 ? CallRewrite(y1, 0, x2 - 1, 0) : 0) + D_CRcost) < costx) { costx = m; @@ -1251,15 +1293,15 @@ int x2, y2; } void -ClearDisplay() +ClearAll() { ASSERT(display); - Clear(0, 0, 0, D_width - 1, D_width - 1, D_height - 1, 0); + ClearArea(0, 0, 0, D_width - 1, D_width - 1, D_height - 1, 0, 0); } void -Clear(x1, y1, xs, xe, x2, y2, uselayfn) -int x1, y1, xs, xe, x2, y2, uselayfn; +ClearArea(x1, y1, xs, xe, x2, y2, bce, uselayfn) +int x1, y1, xs, xe, x2, y2, bce, uselayfn; { int y, xxe; struct canvas *cv; @@ -1267,20 +1309,29 @@ int x1, y1, xs, xe, x2, y2, uselayfn; debug2("Clear %d,%d", x1, y1); debug2(" %d-%d", xs, xe); - debug3(" %d,%d uselayfn=%d\n", x2, y2, uselayfn); + debug2(" %d,%d", x2, y2); + debug2(" uselayfn=%d bce=%d\n", uselayfn, bce); ASSERT(display); if (x1 == D_width) x1--; if (x2 == D_width) x2--; + if (xs == -1) + xs = x1; + if (xe == -1) + xe = x2; if (D_UT) /* Safe to erase ? */ SetRendition(&mchar_null); +#ifdef COLOR + if (D_BE) + SetBackColor(bce); +#endif if (D_lp_missing && y1 <= D_bot && xe >= D_width - 1) { if (y2 > D_bot || (y2 == D_bot && x2 >= D_width - 1)) D_lp_missing = 0; } - if (x2 == D_width - 1 && (xs == 0 || y1 == y2) && xe == D_width - 1 && y2 == D_height - 1) + if (x2 == D_width - 1 && (xs == 0 || y1 == y2) && xe == D_width - 1 && y2 == D_height - 1 && (!bce || D_BE)) { #ifdef AUTO_NUKE if (x1 == 0 && y1 == 0 && D_auto_nuke) @@ -1303,7 +1354,7 @@ int x1, y1, xs, xe, x2, y2, uselayfn; return; } } - if (x1 == 0 && xs == 0 && (xe == D_width - 1 || y1 == y2) && y1 == 0 && D_CCD) + if (x1 == 0 && xs == 0 && (xe == D_width - 1 || y1 == y2) && y1 == 0 && D_CCD && (!bce || D_BE)) { GotoPos(x1, y1); PutStr(D_CCD); @@ -1314,13 +1365,13 @@ int x1, y1, xs, xe, x2, y2, uselayfn; { if (y == y2) xxe = x2; - if (x1 == 0 && D_CB && (xxe != D_width - 1 || (D_x == xxe && D_y == y))) + if (x1 == 0 && D_CB && (xxe != D_width - 1 || (D_x == xxe && D_y == y)) && (!bce || D_BE)) { GotoPos(xxe, y); PutStr(D_CB); continue; } - if (xxe == D_width - 1 && D_CE) + if (xxe == D_width - 1 && D_CE && (!bce || D_BE)) { GotoPos(x1, y); PutStr(D_CE); @@ -1350,14 +1401,14 @@ int x1, y1, xs, xe, x2, y2, uselayfn; cvlnext = cv->c_lnext; flayer->l_cvlist = cv; cv->c_lnext = 0; - ClearLine(y - vp->v_yoff, x1 - vp->v_xoff, xxe - vp->v_xoff); + LayClearLine(y - vp->v_yoff, x1 - vp->v_xoff, xxe - vp->v_xoff, bce); flayer->l_cvlist = cvlist; cv->c_lnext = cvlnext; flayer = oldflayer; continue; } } - DisplayLine(&mline_null, &mline_blank, y, x1, xxe); + ClearLine((struct mline *)0, y, x1, xxe, bce); } } @@ -1370,9 +1421,6 @@ void Redisplay(cur_only) int cur_only; { - register int i, stop; - struct canvas *cv; - ASSERT(display); /* XXX do em all? */ @@ -1381,30 +1429,20 @@ int cur_only; KeypadMode(0); CursorkeysMode(0); CursorVisibility(0); + MouseMode(0); SetRendition(&mchar_null); SetFlow(FLOW_NOW); - ClearDisplay(); - stop = D_height; - i = 0; + ClearAll(); +#ifdef RXVT_OSC + RefreshXtermOSC(); +#endif if (cur_only > 0 && D_fore) - { - i = stop = D_fore->w_y; - stop++; - } + RefreshArea(0, D_fore->w_y, D_width - 1, D_fore->w_y, 1); else - { - debug("Signalling full refresh!\n"); - for (cv = D_cvlist; cv; cv = cv->c_next) - { - CV_CALL(cv, RedisplayLine(-1, -1, -1, 1)); - display = cv->c_display; /* just in case! */ - } - } - RefreshArea(0, i, D_width - 1, stop - 1, 1); + RefreshAll(1); RefreshHStatus(); - - CV_CALL(D_forecv, Restore();SetCursor()); + CV_CALL(D_forecv, LayRestore();LaySetCursor()); } void @@ -1420,8 +1458,8 @@ int cur_only; /* XXX: use oml! */ void -ScrollH(y, xs, xe, n, oml) -int y, xs, xe, n; +ScrollH(y, xs, xe, n, bce, oml) +int y, xs, xe, n, bce; struct mline *oml; { int i; @@ -1437,8 +1475,14 @@ struct mline *oml; GotoPos(xs, y); if (D_UT) SetRendition(&mchar_null); +#ifdef COLOR + if (D_BE) + SetBackColor(bce); +#endif if (n > 0) { + if (n >= xe - xs + 1) + n = xe - xs + 1; if (D_CDC && !(n == 1 && D_DC)) CPutStr(D_CDC, n); else if (D_DC) @@ -1455,6 +1499,8 @@ struct mline *oml; } else { + if (-n >= xe - xs + 1) + n = -(xe - xs + 1); if (!D_insert) { if (D_CIC && !(n == -1 && D_IC)) @@ -1467,8 +1513,13 @@ struct mline *oml; else if (D_IM) { InsertMode(1); + SetRendition(&mchar_null); +#ifdef COLOR + SetBackColor(bce); +#endif for (i = -n; i--; ) INSERTCHAR(' '); + bce = 0; /* all done */ } else { @@ -1479,10 +1530,22 @@ struct mline *oml; } else { + SetRendition(&mchar_null); +#ifdef COLOR + SetBackColor(bce); +#endif for (i = -n; i--; ) INSERTCHAR(' '); + bce = 0; /* all done */ } } + if (bce && !D_BE) + { + if (n > 0) + ClearLine((struct mline *)0, y, xe - n + 1, xe, bce); + else + ClearLine((struct mline *)0, y, xs, xs - n - 1, bce); + } if (D_lp_missing && y == D_bot) { if (n > 0) @@ -1492,8 +1555,8 @@ struct mline *oml; } void -ScrollV(xs, ys, xe, ye, n) -int xs, ys, xe, ye, n; +ScrollV(xs, ys, xe, ye, n, bce) +int xs, ys, xe, ye, n, bce; { int i; int up; @@ -1506,7 +1569,7 @@ int xs, ys, xe, ye, n; return; if (n >= ye - ys + 1 || -n >= ye - ys + 1) { - Clear(xs, ys, xs, xe, xe, ye, 0); + ClearArea(xs, ys, xs, xe, xe, ye, bce, 0); return; } if (xs > D_vpxmin || xe < D_vpxmax) @@ -1557,27 +1620,34 @@ int xs, ys, xe, ye, n; /* XXX ChangeScrollRegion(oldtop, oldbot); */ + if (bce && !D_BE) + ClearLine((struct mline *)0, ye, xs, xe, bce); return; } } } - aldlfaster = (n > 1 && ys >= D_top && ye == D_bot && ((up && D_CDL) || (!up && D_CAL))); - if (D_UT) SetRendition(&mchar_null); +#ifdef COLOR + if (D_BE) + SetBackColor(bce); +#endif + + aldlfaster = (n > 1 && ys >= D_top && ye == D_bot && ((up && D_CDL) || (!up && D_CAL))); + if ((up || D_SR) && D_top == ys && D_bot == ye && !aldlfaster) { if (up) { GotoPos(0, ye); - while (n-- > 0) + for(i = n; i-- > 0; ) PutStr(D_NL); /* was SF, I think NL is faster */ } else { GotoPos(0, ys); - while (n-- > 0) + for(i = n; i-- > 0; ) PutStr(D_SR); } } @@ -1607,6 +1677,13 @@ int xs, ys, xe, ye, n; RefreshArea(xs, ys, xe, ye, 0); return; } + if (bce && !D_BE) + { + if (up) + ClearArea(xs, ye - n + 1, xs, xe, xe, ye, bce, 0); + else + ClearArea(xs, ys, xs, xe, xe, ys + n - 1, bce, 0); + } if (D_lp_missing && missy != D_bot) WriteLP(D_width - 1, missy); /* XXX @@ -1632,7 +1709,7 @@ register int new; ospeed = D_dospeed; tputs(tparm(D_SA, new & A_SO, new & A_US, new & A_RV, new & A_BL, new & A_DI, new & A_BD, 0 , 0 , - 0), 1, PutChar); + 0), 1, DoAddChar); D_rend.attr = new; D_atyp = 0; # ifdef COLOR @@ -1726,6 +1803,8 @@ int new; ob = (D_rend.color >> 4) & 0xf; f = new & 0xf; b = (new >> 4) & 0xf; + ASSERT(f >= 0 && f <= 9); + ASSERT(b >= 0 && b <= 9); if (!D_CAX && (D_CAF || D_CAB) && ((f == 0 && f != of) || (b == 0 && b != ob))) { @@ -1747,7 +1826,17 @@ int new; } D_rend.color = new; } -#endif + +static void +SetBackColor(new) +int new; +{ + if (!display) + return; + ASSERT(new >=0 && new <= 9); + SetColor((D_rend.color & 0xf) | (new << 4)); +} +#endif /* COLOR */ void SetRendition(mc) @@ -1859,12 +1948,6 @@ char *msg; D_status_lasty = D_y; if (!use_hardstatus || D_has_hstatus == HSTATUS_IGNORE || D_has_hstatus == HSTATUS_MESSAGE) { - if (D_status_delayed != -1 && t - msg < D_status_buflen) - { - D_status_delayed = 1; /* not yet... */ - D_status = 0; - return; - } D_status = STATUS_ON_WIN; debug1("using STATLINE %d\n", STATLINE); GotoPos(0, STATLINE); @@ -1892,8 +1975,27 @@ char *msg; D_status = STATUS_ON_HS; ShowHStatus(msg); } - D_status_delayed = 0; Flush(); + if (D_status == STATUS_ON_WIN) + { + struct display *olddisplay = display; + struct layer *oldflayer = flayer; + + ASSERT(D_obuffree == D_obuflen); + D_status = 0; + GotoPos(0, STATLINE); + RefreshLine(STATLINE, 0, D_status_len - 1, 0); + GotoPos(D_status_lastx, D_status_lasty); + flayer = D_forecv->c_layer; + if (flayer) + LaySetCursor(); + display = olddisplay; + flayer = oldflayer; + D_status_obuflen = D_obuflen; + D_status_obuffree = D_obuffree; + D_obuffree = D_obuflen = 0; + D_status = STATUS_ON_WIN; + } (void) time(&D_status_time); SetTimeout(&D_statusev, MsgWait * 1000); evenq(&D_statusev); @@ -1914,6 +2016,17 @@ RemoveStatus() if (!(where = D_status)) return; + debug("RemoveStatus\n"); + if (D_status_obuffree >= 0) + { + D_obuflen = D_status_obuflen; + D_obuffree = D_status_obuffree; + D_status_obuffree = -1; + D_status = 0; + D_status_bell = 0; + evdeq(&D_statusev); + return; + } D_status = 0; D_status_bell = 0; evdeq(&D_statusev); @@ -1929,7 +2042,7 @@ RemoveStatus() RefreshHStatus(); flayer = D_forecv->c_layer; if (flayer) - SetCursor(); + LaySetCursor(); display = olddisplay; flayer = oldflayer; } @@ -1981,7 +2094,7 @@ char *str; while (l++ < D_width) PUTCHARLP(' '); if (l < D_width) - Clear(l, D_height - 1, l, D_width - 1, D_width - 1, D_height - 1, 0); + ClearArea(l, D_height - 1, l, D_width - 1, D_width - 1, D_height - 1, 0, 0); if (ox != -1 && oy != -1) GotoPos(ox, oy); D_hstatus = *str ? 1 : 0; @@ -2023,6 +2136,22 @@ RefreshHStatus() */ void +RefreshAll(isblank) +int isblank; +{ + struct canvas *cv; + + ASSERT(display); + debug("Signalling full refresh!\n"); + for (cv = D_cvlist; cv; cv = cv->c_next) + { + CV_CALL(cv, LayRedisplayLine(-1, -1, -1, isblank)); + display = cv->c_display; /* just in case! */ + } + RefreshArea(0, 0, D_width - 1, D_height - 1, isblank); +} + +void RefreshArea(xs, ys, xe, ye, isblank) int xs, ys, xe, ye, isblank; { @@ -2032,7 +2161,7 @@ int xs, ys, xe, ye, isblank; debug3(" - %d,%d (isblank=%d)\n", xe, ye, isblank); if (!isblank && xs == 0 && xe == D_width - 1 && ye == D_height - 1 && (ys == 0 || D_CD)) { - Clear(xs, ys, xs, xe, xe, ye, 0); + ClearArea(xs, ys, xs, xe, xe, ye, 0, 0); isblank = 1; } for (y = ys; y <= ye; y++) @@ -2061,7 +2190,7 @@ int y, from, to, isblank; if (isblank == 0 && D_CE && to == D_width - 1 && from < to) { GotoPos(from, y); - if (D_UT) + if (D_UT || D_BE) SetRendition(&mchar_null); PutStr(D_CE); isblank = 1; @@ -2097,7 +2226,7 @@ int y, from, to, isblank; from = lvp->v_xs; } - /* call RedisplayLine on canvas lcv viewport lvp */ + /* call LayRedisplayLine on canvas lcv viewport lvp */ yy = y - lvp->v_yoff; xx = to < lvp->v_xe ? to : lvp->v_xe; @@ -2129,7 +2258,7 @@ int y, from, to, isblank; cvlnext = lcv->c_lnext; flayer->l_cvlist = lcv; lcv->c_lnext = 0; - RedisplayLine(yy, from - lvp->v_xoff, xx - lvp->v_xoff, isblank); + LayRedisplayLine(yy, from - lvp->v_xoff, xx - lvp->v_xoff, isblank); flayer->l_cvlist = cvlist; lcv->c_lnext = cvlnext; flayer = oldflayer; @@ -2185,18 +2314,72 @@ int x2, y2; ASSERT(display); ASSERT(D_lp_missing); oldrend = D_rend; + debug2("WriteLP(%d,%d)\n", x2, y2); #ifdef KANJI - if (D_lpchar.font == KANJI && (D_mbcs = D_lp_mbcs) != 0 && x2 > 0) - x2--; + if (D_lpchar.mbcs) + { + if (x2 > 0) + x2--; + else + D_lpchar = mchar_blank; + } #endif + /* Can't use PutChar */ GotoPos(x2, y2); SetRendition(&D_lpchar); PUTCHAR(D_lpchar.image); +#ifdef KANJI + if (D_lpchar.mbcs) + PUTCHAR(D_lpchar.mbcs); +#endif D_lp_missing = 0; SetRendition(&oldrend); } void +ClearLine(oml, y, from, to, bce) +struct mline *oml; +int from, to, y, bce; +{ + int x; + + debug3("ClearLine %d,%d-%d\n", y, from, to); + if (D_UT) /* Safe to erase ? */ + SetRendition(&mchar_null); +#ifdef COLOR + if (D_BE) + SetBackColor(bce); +#endif + if (from == 0 && D_CB && (to != D_width - 1 || (D_x == to && D_y == y)) && (!bce || D_BE)) + { + GotoPos(to, y); + PutStr(D_CB); + return; + } + if (to == D_width - 1 && D_CE && (!bce || D_BE)) + { + GotoPos(from, y); + PutStr(D_CE); + return; + } + if (oml == 0) + oml = &mline_null; +#ifdef COLOR + if (!bce) + { + DisplayLine(oml, &mline_blank, y, from, to); + return; + } + save_mline(&mline_blank, to + 1); + for (x = from; x <= to; x++) + mline_old.color[x] = bce << 4; + DisplayLine(oml, &mline_old, y, from, to); +#else + DisplayLine(oml, &mline_blank, y, from, to); +#endif +} + +void DisplayLine(oml, ml, y, from, to) struct mline *oml, *ml; int from, to, y; @@ -2212,27 +2395,30 @@ int from, to, y; { if (D_lp_missing || !cmp_mline(oml, ml, to)) { +#ifdef KANJI + if ((D_IC || D_IM) && from < to && ml->font[to] != KANJI) +#else if ((D_IC || D_IM) && from < to) +#endif { - to -= 2; last2flag = 1; D_lp_missing = 0; + to--; } else { - to--; - delete_lp = (D_CE || D_DC || D_CDC); + delete_lp = !cmp_mchar_mline(&mchar_blank, oml, to) && (D_CE || D_DC || D_CDC); D_lp_missing = !cmp_mchar_mline(&mchar_blank, ml, to); copy_mline2mchar(&D_lpchar, ml, to); } } - else - to--; + to--; } #ifdef KANJI if (D_mbcs) { /* finish kanji (can happen after a wrap) */ + debug("DisplayLine finishing kanji\n"); SetRenditionMline(ml, from); PUTCHAR(ml->image[from]); from++; @@ -2294,6 +2480,20 @@ int from, to, y; } void +PutChar(c, x, y) +struct mchar *c; +int x, y; +{ + GotoPos(x, y); + SetRendition(c); + PUTCHARLP(c->image); +#ifdef KANJI + if (c->mbcs) + PUTCHARLP(c->mbcs); +#endif +} + +void InsChar(c, x, xe, y, oml) struct mchar *c; int x, xe, y; @@ -2304,6 +2504,7 @@ struct mline *oml; { if (x == D_width - 1) { + D_lp_missing = 1; D_lpchar = *c; return; } @@ -2312,10 +2513,8 @@ struct mline *oml; } if (x == xe) { - if (xe != D_width - 1) - InsertMode(0); SetRendition(c); - RAW_PUTCHAR(c->image); + PUTCHARLP(c->image); return; } if (!(D_IC || D_CIC || D_IM) || xe != D_width - 1) @@ -2328,13 +2527,31 @@ struct mline *oml; InsertMode(1); if (!D_insert) { +#ifdef KANJI + if (c->mbcs && D_IC) + PutStr(D_IC); + if (D_IC) + PutStr(D_IC); + else + CPutStr(D_CIC, c->mbcs ? 2 : 1); +#else if (D_IC) PutStr(D_IC); else CPutStr(D_CIC, 1); +#endif } SetRendition(c); RAW_PUTCHAR(c->image); +#ifdef KANJI + if (c->mbcs) + { + if (D_x == D_width - 1) + PUTCHARLP(c->mbcs); + else + RAW_PUTCHAR(c->mbcs); + } +#endif } void @@ -2344,6 +2561,13 @@ int x, y; int xs, ys, xe, ye; int ins; { + int bce; + +#ifdef COLOR + bce = c->color >> 4 & 0xf; +#else + bce = 0; +#endif debug("WrapChar:"); debug2(" x %d y %d", x, y); debug2(" Dx %d Dy %d", D_x, D_y); @@ -2352,27 +2576,23 @@ int ins; if (xs != 0 || x != D_width || !D_AM) { if (y == ye) - ScrollV(xs, ys, xe, ye, 1); + ScrollV(xs, ys, xe, ye, 1, bce); else if (y < D_height - 1) y++; - GotoPos(xs, y); if (ins) - { - InsChar(c, xs, xe, y, 0); - return; - } - SetRendition(c); - RAW_PUTCHAR(c->image); + InsChar(c, xs, xe, y, 0); + else + PutChar(c, xs, y); return; } if (y == ye) /* we have to scroll */ { debug("- scrolling\n"); ChangeScrollRegion(ys, ye); - if (D_bot != y) + if (D_bot != y || D_x != D_width || (!bce && !D_BE)) { debug("- have to call ScrollV\n"); - ScrollV(xs, ys, xe, ye, 1); + ScrollV(xs, ys, xe, ye, 1, bce); y--; } } @@ -2380,13 +2600,13 @@ int ins; ChangeScrollRegion(ys, ye); /* remove unusable region */ if (D_x != D_width || D_y != y) { - if (D_CLP && y >= 0) /* don't even try if !LP */ + if (D_CLP) /* don't even try if !LP */ RefreshLine(y, D_width - 1, D_width - 1, 0); debug2("- refresh last char -> x,y now %d,%d\n", D_x, D_y); if (D_x != D_width || D_y != y) /* sorry, no bonus */ { if (y == ye) - ScrollV(xs, ys, xe, ye, 1); + ScrollV(xs, ys, xe, ye, 1, bce); GotoPos(xs, y == ye || y == D_height - 1 ? y : y + 1); } } @@ -2401,10 +2621,14 @@ int ins; debug2(" -> done with insert (%d,%d)\n", D_x, D_y); return; } - SetRendition(c); D_y = y; D_x = 0; + SetRendition(c); RAW_PUTCHAR(c->image); +#ifdef KANJI + if (c->mbcs) + RAW_PUTCHAR(c->mbcs); +#endif debug2(" -> done (%d,%d)\n", D_x, D_y); } @@ -2461,6 +2685,44 @@ int newtop, newbot; D_y = D_x = -1; /* Just in case... */ } +#ifdef RXVT_OSC +void +SetXtermOSC(i, s) +int i; +char *s; +{ + static char oscs[] = "1;\000\00020;\00039;\00049;\000"; + + ASSERT(display); + if (!D_CXT) + return; + if (!s) + s = ""; + if (!D_xtermosc[i] && !*s) + return; + if (i == 0 && !*s) + s = "screen"; /* always set icon name */ + if (i == 1 && !*s) + s = ""; /* no background */ + if (i == 2 && !*s) + s = "black"; /* black text */ + if (i == 3 && !*s) + s = "white"; /* on white background */ + D_xtermosc[i] = 1; + AddStr("\033]"); + AddStr(oscs + i * 4); + AddStr(s); + AddChar(7); +} + +void +ClearAllXtermOSC() +{ + int i; + for (i = 3; i >= 0; i--) + SetXtermOSC(i, 0); +} +#endif /* * Output buffering routines @@ -2501,9 +2763,9 @@ Flush() ASSERT(display); l = D_obufp - D_obuf; debug1("Flush(): %d\n", l); - ASSERT(l + D_obuffree == D_obuflen); if (l == 0) return; + ASSERT(l + D_obuffree == D_obuflen); if (D_userfd < 0) { D_obuffree += l; @@ -2563,6 +2825,13 @@ Resize_obuf() register int ind; ASSERT(display); + if (D_status_obuffree >= 0) + { + ASSERT(D_obuffree == -1); + RemoveStatus(); + if (--D_obuffree > 0) /* redo AddChar decrement */ + return; + } if (D_obuflen && D_obuf) { ind = D_obufp - D_obuf; @@ -2593,6 +2862,7 @@ NukePending() struct mchar oldrend; int oldkeypad = D_keypad, oldcursorkeys = D_cursorkeys; int oldcurvis = D_curvis; + int oldmouse = D_mouse; oldrend = D_rend; len = D_obufp - D_obuf; @@ -2654,6 +2924,7 @@ NukePending() KeypadMode(oldkeypad); CursorkeysMode(oldcursorkeys); CursorVisibility(oldcurvis); + MouseMode(oldmouse); if (D_CWS) { debug("ResizeDisplay: using WS\n"); @@ -2777,6 +3048,49 @@ char *data; sleep(1); return; } + if (D_mouse && D_forecv) + { + unsigned char *bp = (unsigned char *)buf; + int x, y, i = size; + + /* XXX this assumes that the string is read in as a whole... */ + for (i = size; i > 0; i--, bp++) + { + if (i > 5 && bp[0] == 033 && bp[1] == '[' && bp[2] == 'M') + { + bp++; + i--; + } + else if (i < 5 || bp[0] != 0233 || bp[1] != 'M') + continue; + x = bp[3] - 33; + y = bp[4] - 33; + if (x >= D_forecv->c_xs && x <= D_forecv->c_xe && y >= D_forecv->c_ys && y <= D_forecv->c_ye) + { + x -= D_forecv->c_xoff; + y -= D_forecv->c_yoff; + if (x >= 0 && x < D_forecv->c_layer->l_width && y >= 0 && y < D_forecv->c_layer->l_height) + { + bp[3] = x + 33; + bp[4] = y + 33; + i -= 4; + bp += 4; + continue; + } + } + if (bp[0] == '[') + { + bcopy((char *)bp + 1, (char *)bp, i); + bp--; + size--; + } + if (i > 5) + bcopy((char *)bp + 5, (char *)bp, i - 5); + bp--; + i -= 4; + size -= 5; + } + } (*D_processinput)(buf, size); } @@ -2786,6 +3100,7 @@ struct event *ev; char *data; { display = (struct display *)data; + debug1("disp_status_fn for display %x\n", (int)display); if (D_status) RemoveStatus(); } diff --git a/src/display.h b/src/display.h index 2392776..6a8047a 100644 --- a/src/display.h +++ b/src/display.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -97,7 +97,6 @@ struct display #ifdef KANJI int d_mbcs; /* saved char for multibytes charset */ int d_kanji; /* what kanji type the display is */ - int d_lp_mbcs; /* mbcs part of lp_missing */ #endif int d_insert; /* insert mode flag */ int d_keypad; /* application keypad flag */ @@ -107,6 +106,10 @@ struct display int d_has_hstatus; /* display has hardstatus line */ int d_hstatus; /* hardstatus used */ int d_lp_missing; /* last character on bot line missing */ + int d_mouse; /* mouse mode */ +#ifdef RXVT_OSC + int d_xtermosc[4]; /* osc used */ +#endif struct mchar d_lpchar; /* missing char */ time_t d_status_time; /* time of status display */ int d_status; /* is status displayed? */ @@ -116,9 +119,11 @@ struct display int d_status_buflen; /* last message buffer len */ int d_status_lastx; /* position of the cursor */ int d_status_lasty; /* before status was displayed */ - int d_status_delayed; /* status not displayed yet */ + int d_status_obuflen; /* saved obuflen */ + int d_status_obuffree; /* saved obuffree */ struct event d_statusev; /* timeout event */ struct event d_hstatusev; /* hstatus changed event */ + int d_kaablamm; /* display kaablamm msg */ int d_ESCseen; /* Was the last char an ESC (^a) */ int d_userpid; /* pid of attacher */ char d_usertty[MAXPATHLEN]; /* tty we are attached to */ @@ -200,7 +205,6 @@ extern struct display TheDisplay; #define D_atyp DISPLAY(d_atyp) #define D_mbcs DISPLAY(d_mbcs) #define D_kanji DISPLAY(d_kanji) -#define D_lp_mbcs DISPLAY(d_lp_mbcs) #define D_insert DISPLAY(d_insert) #define D_keypad DISPLAY(d_keypad) #define D_cursorkeys DISPLAY(d_cursorkeys) @@ -209,6 +213,8 @@ extern struct display TheDisplay; #define D_has_hstatus DISPLAY(d_has_hstatus) #define D_hstatus DISPLAY(d_hstatus) #define D_lp_missing DISPLAY(d_lp_missing) +#define D_mouse DISPLAY(d_mouse) +#define D_xtermosc DISPLAY(d_xtermosc) #define D_lpchar DISPLAY(d_lpchar) #define D_status DISPLAY(d_status) #define D_status_time DISPLAY(d_status_time) @@ -218,9 +224,11 @@ extern struct display TheDisplay; #define D_status_buflen DISPLAY(d_status_buflen) #define D_status_lastx DISPLAY(d_status_lastx) #define D_status_lasty DISPLAY(d_status_lasty) -#define D_status_delayed DISPLAY(d_status_delayed) +#define D_status_obuflen DISPLAY(d_status_obuflen) +#define D_status_obuffree DISPLAY(d_status_obuffree) #define D_statusev DISPLAY(d_statusev) #define D_hstatusev DISPLAY(d_hstatusev) +#define D_kaablamm DISPLAY(d_kaablamm) #define D_ESCseen DISPLAY(d_ESCseen) #define D_userpid DISPLAY(d_userpid) #define D_usertty DISPLAY(d_usertty) @@ -273,7 +281,7 @@ extern struct display TheDisplay; #define AddChar(c) \ do \ { \ - if (--D_obuffree == 0) \ + if (--D_obuffree <= 0) \ Resize_obuf(); \ *D_obufp++ = (c); \ } \ diff --git a/src/doc/screen.1 b/src/doc/screen.1 index 74c35d4..8e8d483 100644 --- a/src/doc/screen.1 +++ b/src/doc/screen.1 @@ -801,6 +801,14 @@ that has not been written to the terminal. See also \*Qobuflimit\*U. .sp .ne 3 +.BR "bce " [ on | off ] +.PP +Change background-color-erase setting. If \*Qbce\*U is set to on, all +characters cleared by an erase/insert/scroll/clear operation +will be displayed in the current background color. Otherwise +the default background color is used. +.sp +.ne 3 .B bell_msg .RI [ message ] .PP @@ -1296,6 +1304,12 @@ Note that you can use the special `AN' terminal capability if you want to have a dependency on the terminal type. .sp .ne 3 +.BR "defbce on" | off +.PP +Same as the \fBbce\fP command except that the default setting for new +windows is changed. Initial setting is `off'. +.sp +.ne 3 .B defbreaktype .RI [ tcsendbreak | TIOCSBRK .RI | TCSBRK ] @@ -1627,10 +1641,19 @@ details and note, that this is subject to change in future releases. Default is set by `defflow'. .sp .ne 3 -.B focus +.BR "focus " [ up | down | top | bottom ] .PP Move the input focus to the next region. This is done in a cyclic -way so that the top region is selected after the bottom one. +way so that the top region is selected after the bottom one. If +no subcommand is given it defaults to `down'. `up' cycles in the +opposite order, `top' and `bottom' go to the top and bottom +region respectively. Useful bindings are (j and k as in vi) +.nf + bind j focus down + bind k focus up + bind t focus top + bind b focus bottom +.fi .sp .ne 3 .BR "gr " [ on | off ] @@ -2262,6 +2285,25 @@ settings (like scroll regions or graphics character set) are left over from an application. .sp .ne 3 +.B "resize" +.PP +Resize the current region. The space will be removed from or added to +the region below or if there's not enough space from the region above. +.IP +resize +N increase current region height by N +.IP +resize -N decrease current region height by N +.IP +resize N set current region height to N +.IP +resize = make all windows equally high +.IP +resize max maximize current region height +.IP +resize min minimize current region height +.PP +.sp +.ne 3 .B "screen \fP[\fI-opts\fP] [\fIn\fP] [\fIcmd\fP [\fIargs\fP]]" .PP Establish a new window. @@ -3410,6 +3452,9 @@ From Beginning of Line to Cursor \h'\w'ESC [ Pn = 'u'\fB2\fP Entire Line .TP 27 +.B "ESC [ \fPPn\fB X" +Erase character +.TP 27 .B "ESC [ \fPPn\fB A" Cursor Up .TP 27 @@ -3581,9 +3626,15 @@ Reverse Video \h'\w'ESC [ Ps = 'u'\fB?7\fP (V) \fIWrap\fP Mode .TP 27 +\h'\w'ESC [ Ps = 'u'\fB?9\fP +X10 mouse tracking +.TP 27 \h'\w'ESC [ Ps = 'u'\fB?25\fP (V) Visible Cursor .TP 27 +\h'\w'ESC [ Ps = 'u'\fB?1000\fP (V) +VT200 mouse tracking +.TP 27 .BR "ESC [ 5 i" " (A)" Start relay to printer (ANSI Media Copy) .TP 27 @@ -3779,6 +3830,9 @@ Does understand ANSI set default fg/bg color (\eE[39m / \eE[49m). Describe a translation of characters to strings depending on the current font. More details follow in the next section. .TP 13 +.BI XT " (bool)" +Terminal understands special xterm sequences (OSC, mouse tracking). +.TP 13 .BI TF " (bool)" Add missing capabilities to the termcap/info entry. (Set by default). @@ -3981,7 +4035,7 @@ Gregory Neil Shapiro (gshapiro@wpi.WPI.EDU). .SH VERSION -This is version 3.9 Its roots are a merge of a custom version +This is version 3.9.6. Its roots are a merge of a custom version 2.3PR7 by Wayne Davison and several enhancements to Oliver Laumann's version 2.0. Note that all versions numbered 2.x are copyright by Oliver Laumann. diff --git a/src/doc/screen.info b/src/doc/screen.info index 11447c5..bd2c493 100644 --- a/src/doc/screen.info +++ b/src/doc/screen.info @@ -22,9 +22,9 @@ translation approved by the Foundation. Indirect: screen.info-1: 878 -screen.info-2: 50660 -screen.info-3: 100483 -screen.info-4: 150213 +screen.info-2: 50794 +screen.info-3: 99001 +screen.info-4: 146445 Tag Table: (Indirect) @@ -38,144 +38,146 @@ Node: Colon18437 Node: Commands19059 Node: Default Key Bindings20017 Node: Command Summary25596 -Node: New Window37785 -Node: Chdir38617 -Node: Screen Command39588 -Node: Setenv41289 -Node: Shell41809 -Node: Term42575 -Node: Window Types43356 -Node: Selecting47674 -Node: Next and Previous48228 -Node: Other Window48754 -Node: Select49163 -Node: Session Management49831 -Node: Detach50660 -Node: Power Detach51945 -Node: Lock52584 -Node: Multiuser Session53470 -Node: Multiuser54432 -Node: Acladd54819 -Node: Aclchg55384 -Node: Acldel56790 -Node: Aclgrp57125 -Node: Displays57776 -Node: Umask58070 -Node: Wall59051 -Node: Writelock59288 -Node: Su60184 -Node: Session Name60984 -Node: Suspend61531 -Node: Quit61863 -Node: Regions62288 -Node: Split62773 -Node: Focus63063 -Node: Only63325 -Node: Remove63489 -Node: Caption63698 -Node: Window Settings64443 -Node: Naming Windows65178 -Node: Title Command66678 -Node: Dynamic Titles66952 -Node: Title Prompts68486 -Node: Title Screenrc69567 -Node: Console71206 -Node: Kill71649 -Node: Login72541 -Node: Mode73360 -Node: Monitor73759 -Node: Windows75172 -Node: Hardstatus76234 -Node: Virtual Terminal77427 -Node: Control Sequences78485 -Node: Input Translation85315 -Node: Digraph89831 -Node: Bell90623 -Node: Clear92502 -Node: Info92705 -Node: Redisplay94567 -Node: Wrap95698 -Node: Reset96449 -Node: Window Size96767 -Node: Character Processing97612 -Node: Copy and Paste100483 -Node: Copy101088 -Node: Line Termination101933 -Node: Scrollback102342 -Node: Copy Mode Keys103079 -Node: Movement103894 -Node: Marking105048 -Node: Repeat count105423 -Node: Searching105737 -Node: Specials105999 -Node: Paste107953 -Node: Registers110625 -Node: Screen-Exchange111631 -Node: History112714 -Node: Subprocess Execution113454 -Node: Exec113818 -Node: Using Exec115564 -Node: Key Binding117403 -Node: Bind118046 -Node: Bind Examples119033 -Node: Command Character119713 -Node: Help121254 -Node: Bindkey121767 -Node: Bindkey Examples123313 -Node: Bindkey Control124202 -Node: Flow Control124799 -Node: Flow Control Summary125375 -Node: Flow128309 -Node: XON/XOFF129083 -Node: Termcap129456 -Node: Window Termcap130313 -Node: Dump Termcap135556 -Node: Termcap Syntax136271 -Node: Termcap Examples138438 -Node: Special Capabilities140479 -Node: Autonuke143042 -Node: Obuflimit143692 -Node: Character Translation144521 -Node: Message Line147134 -Node: Privacy Message148045 -Node: Hardware Status Line148542 -Node: Last Message150213 -Node: Message Wait150640 -Node: Logging151066 -Node: Hardcopy151390 -Node: Log152186 -Node: Startup153802 -Node: echo154209 -Node: sleep154617 -Node: Startup Message154958 -Node: Miscellaneous155231 -Node: At156339 -Node: Break158333 -Node: Debug159980 -Node: License160457 -Node: Nethack160722 -Node: Nonblock161400 -Node: Number161854 -Node: Silence162224 -Node: Time163160 -Node: Verbose163534 -Node: Version163868 -Node: Zombie164077 -Node: Printcmd165131 -Node: Sorendition165837 -Node: String Escapes166489 -Node: Environment167814 -Node: Files168849 -Node: Credits169936 -Node: Bugs171849 -Node: Known Bugs172319 -Node: Reporting Bugs174413 -Node: Availability175179 -Node: Installation175723 -Node: Socket Directory176113 -Node: Compiling Screen176643 -Node: Concept Index178035 -Node: Command Index180092 -Node: Keystroke Index188392 +Node: New Window37950 +Node: Chdir38751 +Node: Screen Command39722 +Node: Setenv41423 +Node: Shell41943 +Node: Term42709 +Node: Window Types43490 +Node: Selecting47808 +Node: Next and Previous48362 +Node: Other Window48888 +Node: Select49297 +Node: Session Management49965 +Node: Detach50794 +Node: Power Detach52079 +Node: Lock52718 +Node: Multiuser Session53604 +Node: Multiuser54566 +Node: Acladd54953 +Node: Aclchg55518 +Node: Acldel56924 +Node: Aclgrp57259 +Node: Displays57910 +Node: Umask58204 +Node: Wall59185 +Node: Writelock59422 +Node: Su60318 +Node: Session Name61118 +Node: Suspend61665 +Node: Quit61997 +Node: Regions62422 +Node: Split62989 +Node: Focus63279 +Node: Only63855 +Node: Remove64019 +Node: Resize64227 +Node: Caption64875 +Node: Fit65632 +Node: Window Settings65934 +Node: Naming Windows66669 +Node: Title Command68169 +Node: Dynamic Titles68443 +Node: Title Prompts69977 +Node: Title Screenrc71058 +Node: Console72697 +Node: Kill73140 +Node: Login74032 +Node: Mode74851 +Node: Monitor75250 +Node: Windows76663 +Node: Hardstatus77725 +Node: Virtual Terminal78918 +Node: Control Sequences79976 +Node: Input Translation86934 +Node: Digraph91450 +Node: Bell92242 +Node: Clear94121 +Node: Info94324 +Node: Redisplay96186 +Node: Wrap97317 +Node: Reset98068 +Node: Window Size98386 +Node: Character Processing99001 +Node: Copy and Paste102316 +Node: Copy102921 +Node: Line Termination103766 +Node: Scrollback104175 +Node: Copy Mode Keys104912 +Node: Movement105727 +Node: Marking106881 +Node: Repeat count107256 +Node: Searching107570 +Node: Specials107832 +Node: Paste109786 +Node: Registers112458 +Node: Screen-Exchange113464 +Node: History114547 +Node: Subprocess Execution115287 +Node: Exec115651 +Node: Using Exec117397 +Node: Key Binding119236 +Node: Bind119879 +Node: Bind Examples120866 +Node: Command Character121546 +Node: Help123087 +Node: Bindkey123600 +Node: Bindkey Examples125146 +Node: Bindkey Control126035 +Node: Flow Control126632 +Node: Flow Control Summary127208 +Node: Flow130142 +Node: XON/XOFF130916 +Node: Termcap131289 +Node: Window Termcap132146 +Node: Dump Termcap137389 +Node: Termcap Syntax138104 +Node: Termcap Examples140271 +Node: Special Capabilities142312 +Node: Autonuke144966 +Node: Obuflimit145616 +Node: Character Translation146445 +Node: Message Line149058 +Node: Privacy Message149969 +Node: Hardware Status Line150466 +Node: Last Message152137 +Node: Message Wait152564 +Node: Logging152990 +Node: Hardcopy153314 +Node: Log154110 +Node: Startup155726 +Node: echo156133 +Node: sleep156541 +Node: Startup Message156882 +Node: Miscellaneous157155 +Node: At158263 +Node: Break160257 +Node: Debug161904 +Node: License162381 +Node: Nethack162646 +Node: Nonblock163324 +Node: Number163778 +Node: Silence164148 +Node: Time165084 +Node: Verbose165458 +Node: Version165792 +Node: Zombie166001 +Node: Printcmd167055 +Node: Sorendition167761 +Node: String Escapes168413 +Node: Environment169738 +Node: Files170773 +Node: Credits171860 +Node: Bugs173773 +Node: Known Bugs174243 +Node: Reporting Bugs176337 +Node: Availability177103 +Node: Installation177647 +Node: Socket Directory178037 +Node: Compiling Screen178567 +Node: Concept Index179959 +Node: Command Index182016 +Node: Keystroke Index190480 End Tag Table diff --git a/src/doc/screen.info-1 b/src/doc/screen.info-1 index d9d4b04..5d5d632 100644 --- a/src/doc/screen.info-1 +++ b/src/doc/screen.info-1 @@ -26,7 +26,7 @@ Screen ****** This file documents the `Screen' virtual terminal manager, version -3.9.0. +3.9.6. * Menu: @@ -756,6 +756,9 @@ Command Summary Enable a clear screen to discard unwritten output. *Note Autonuke::. +`bce [STATE]' + Change background color erase. *Note Character Processing::. + `bell_msg [MESSAGE]' Set the bell notification message. *Note Bell::. @@ -820,6 +823,9 @@ Command Summary `defautonuke STATE' Select default autonuke behavior. *Note Autonuke::. +`defbce STATE' + Select background color erase. *Note Character Processing::. + `defbreaktype [TCSENDBREAK | TCSBRK | TIOCSBRK]' Specify the default for generating breaks. *Note Break::. @@ -1204,9 +1210,8 @@ New Window This section describes the commands for creating a new window for running programs. When a new window is created, the first available -number from the range 0...9 is assigned to it. There can be no more -than 10 windows active at any one time unless `screen' was compiled -with a higher MAXWIN setting. +number from the range 0...9 is assigned to it. The number of windows +is limited at compile-time by the MAXWIN configuration parameter. * Menu: diff --git a/src/doc/screen.info-2 b/src/doc/screen.info-2 index 2995343..8128c5e 100644 --- a/src/doc/screen.info-2 +++ b/src/doc/screen.info-2 @@ -344,7 +344,9 @@ contain different windows. * Focus:: Change to the next region * Only:: Delete all other regions * Remove:: Delete the current region +* Resize:: Grow or shrink a region * Caption:: Control the window's caption +* Fit:: Resize a window to fit the region File: screen.info, Node: Split, Next: Focus, Up: Regions @@ -367,7 +369,14 @@ Focus - Command: focus (`C-a Tab') Move the input focus to the next region. This is done in a cyclic - way so that the top region is selected after the bottom one. + way so that the top region is selected after the bottom one. If no + subcommand is given it defaults to `down'. `up' cycles in the + opposite order, `top' and `bottom' go to the top and bottom region + respectively. Useful bindings are (j and k as in vi) + bind j focus down + bind k focus up + bind t focus top + bind b focus bottom File: screen.info, Node: Only, Next: Remove, Prev: Focus, Up: Regions @@ -380,7 +389,7 @@ Only Kill all regions but the current one. -File: screen.info, Node: Remove, Next: Caption, Prev: Only, Up: Regions +File: screen.info, Node: Remove, Next: Resize, Prev: Only, Up: Regions Remove ====== @@ -391,7 +400,25 @@ Remove region. -File: screen.info, Node: Caption, Prev: Remove, Up: Regions +File: screen.info, Node: Resize, Next: Caption, Prev: Remove, Up: Regions + +Resize +====== + + - Command: resize [(+/-)LINES] + (none) + Resize the current region. The space will be removed from or added + to the region below or if there's not enough space from the region + above. + resize +N increase current region height by N + resize -N decrease current region height by N + resize N set current region height to N + resize = make all windows equally high + resize max maximize current region height + resize min minimize current region height + + +File: screen.info, Node: Caption, Next: Fit, Prev: Resize, Up: Regions Caption ======= @@ -413,6 +440,18 @@ Caption argument. +File: screen.info, Node: Fit, Prev: Caption, Up: Regions + +Fit +=== + + - Command: fit + (`C-a F') + Change the window size to the size of the current region. This + command is needed because screen doesn't adapt the window size + automatically if the window is displayed more than once. + + File: screen.info, Node: Window Settings, Next: Virtual Terminal, Prev: Regions, Up: Top Window Settings @@ -857,8 +896,8 @@ functions, respectively. 37 (A) Foreground White 39 (A) Foreground Default 40 (A) Background Black - ... ... - 49 (A) Background Default + ... ... + 49 (A) Background Default ESC [ Pn g Tab Clear Pn = None or 0 Clear Tab at Current Position 3 Clear All Tabs @@ -882,7 +921,9 @@ functions, respectively. ?5 (V) Reverse Video ?6 (V) `Origin' Mode ?7 (V) `Wrap' Mode + ?9 X10 mouse tracking ?25 (V) Visible Cursor + ?1000 (V) VT200 mouse tracking ESC [ 5 i (A) Start relay to printer (ANSI Media Copy) ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy) ESC [ 8 ; Ph ; Pw t Resize the window to `Ph' lines and @@ -1178,78 +1219,3 @@ Window Size Set the display height to a specified number of lines. When no argument is given it toggles between 24 and 42 lines display. - - Command: fit - (`C-a F') - Change the window size to the size of the current region. This - command is needed because screen doesn't adapt the window size - automatically if the window is displayed more than once. - - -File: screen.info, Node: Character Processing, Prev: Window Size, Up: Virtual Terminal - -Character Processing -==================== - - - Command: c1 [STATE] - (none) - Change c1 code processing. `c1 on' tells screen to treat the input - characters between 128 and 159 as control functions. Such an - 8-bit code is normally the same as ESC followed by the - corresponding 7-bit code. The default setting is to process c1 - codes and can be changed with the `defc1' command. Users with - fonts that have usable characters in the c1 positions may want to - turn this off. - - - - Command: gr [STATE] - (none) - Turn GR charset switching on/off. Whenever screen sees an input - char with an 8th bit set, it will use the charset stored in the GR - slot and print the character with the 8th bit stripped. The - default (see also `defgr') is not to process GR switching because - otherwise the ISO88591 charset would not work. - - - Command: kanji WTYPE [DTYPE] - (none) - Tell screen how to process kanji input/output. WTYPE and DTYPE - must be one of the strings `jis', `euc' or `sjis'. The first - argument sets the kanji type of the current window. Each window - can emulate a different type. The optional second parameter tells - screen how to write the kanji codes to the connected terminal. The - preferred method of setting the display type is to use the `KJ' - termcap entry. *Note Special Capabilities::. See also `defkanji', - which changes the default setting of a new window. - - - Command: charset SET - (none) - Change the current character set slot designation and charset - mapping. The first four character of SET are treated as charset - designators while the fifth and sixth character must be in range - `0' to `3' and set the GL/GR charset mapping. On every position a - `.' may be used to indicate that the corresponding charset/mapping - should not be changed (SET is padded to six characters internally - by appending `.' chars). New windows have `BBBB02' as default - charset, unless a `kanji' command is active. - - The current setting can be viewed with the *Note Info:: command. - - - Command: defc1 STATE - (none) - Same as the `c1' command except that the default setting for new - windows is changed. Initial setting is `on'. - - - Command: defgr STATE - (none) - Same as the `gr' command except that the default setting for new - windows is changed. Initial setting is `off'. - - - Command: defkanji WTYPE - (none) - Same as the `kanji' command except that the default setting for - new windows is changed. Initial setting is `off', i.e. `jis'. - - - Command: defcharset [SET] - Like the `charset' command except that the default setting for new - windows is changed. Shows current default if called without - argument. - diff --git a/src/doc/screen.info-3 b/src/doc/screen.info-3 index 809a4e8..6fb7e82 100644 --- a/src/doc/screen.info-3 +++ b/src/doc/screen.info-3 @@ -20,6 +20,87 @@ versions, except that this permission notice may be stated in a translation approved by the Foundation. +File: screen.info, Node: Character Processing, Prev: Window Size, Up: Virtual Terminal + +Character Processing +==================== + + - Command: c1 [STATE] + (none) + Change c1 code processing. `c1 on' tells screen to treat the input + characters between 128 and 159 as control functions. Such an + 8-bit code is normally the same as ESC followed by the + corresponding 7-bit code. The default setting is to process c1 + codes and can be changed with the `defc1' command. Users with + fonts that have usable characters in the c1 positions may want to + turn this off. + + + - Command: gr [STATE] + (none) + Turn GR charset switching on/off. Whenever screen sees an input + char with an 8th bit set, it will use the charset stored in the GR + slot and print the character with the 8th bit stripped. The + default (see also `defgr') is not to process GR switching because + otherwise the ISO88591 charset would not work. + + - Command: bce [STATE] + (none) + Change background-color-erase setting. If `bce' is set to on, all + characters cleared by an erase/insert/scroll/clear operation will + be displayed in the current background color. Otherwise the + default background color is used. + + - Command: kanji WTYPE [DTYPE] + (none) + Tell screen how to process kanji input/output. WTYPE and DTYPE + must be one of the strings `jis', `euc' or `sjis'. The first + argument sets the kanji type of the current window. Each window + can emulate a different type. The optional second parameter tells + screen how to write the kanji codes to the connected terminal. The + preferred method of setting the display type is to use the `KJ' + termcap entry. *Note Special Capabilities::. See also `defkanji', + which changes the default setting of a new window. + + - Command: charset SET + (none) + Change the current character set slot designation and charset + mapping. The first four character of SET are treated as charset + designators while the fifth and sixth character must be in range + `0' to `3' and set the GL/GR charset mapping. On every position a + `.' may be used to indicate that the corresponding charset/mapping + should not be changed (SET is padded to six characters internally + by appending `.' chars). New windows have `BBBB02' as default + charset, unless a `kanji' command is active. + + The current setting can be viewed with the *Note Info:: command. + + - Command: defc1 STATE + (none) + Same as the `c1' command except that the default setting for new + windows is changed. Initial setting is `on'. + + - Command: defgr STATE + (none) + Same as the `gr' command except that the default setting for new + windows is changed. Initial setting is `off'. + + - Command: defbce STATE + (none) + Same as the `bce' command except that the default setting for new + windows is changed. Initial setting is `off'. + + - Command: defkanji WTYPE + (none) + Same as the `kanji' command except that the default setting for + new windows is changed. Initial setting is `off', i.e. `jis'. + + - Command: defcharset [SET] + Like the `charset' command except that the default setting for new + windows is changed. Shows current default if called without + argument. + + File: screen.info, Node: Copy and Paste, Next: Subprocess Execution, Prev: Virtual Terminal, Up: Top Copy and Paste @@ -1118,6 +1199,10 @@ often not possible to place these capabilities in the terminfo database. Describe a translation of characters to strings depending on the current font. (*note Character Translation::.). +`XT' + (bool) + Terminal understands special xterm sequences (OSC, mouse tracking). + `TF' (bool) Add missing capabilities to the termcap/info entry. (Set by @@ -1164,132 +1249,3 @@ Obuflimit Note that you can use the special `OL' terminal capability if you want to have a terminal type dependent limit. - -File: screen.info, Node: Character Translation, Prev: Obuflimit, Up: Termcap - -Character Translation -===================== - - `Screen' has a powerful mechanism to translate characters to -arbitrary strings depending on the current font and terminal type. Use -this feature if you want to work with a common standard character set -(say ISO8851-latin1) even on terminals that scatter the more unusual -characters over several national language font pages. - - Syntax: - - XC=<CHARSET-MAPPING>{,,<CHARSET-MAPPING>} - <CHARSET-MAPPING> := <DESIGNATOR><TEMPLATE>{,<MAPPING>} - <MAPPING> := <CHAR-TO-BE-MAPPED><TEMPLATE-ARG> - - The things in braces may be repeated any number of times. - - A <CHARSET-MAPPING> tells screen how to map characters in font -<DESIGNATOR> (`B': Ascii, `A': UK, `K': german, etc.) to strings. Every -<MAPPING> describes to what string a single character will be -translated. A template mechanism is used, as most of the time the codes -have a lot in common (for example strings to switch to and from another -charset). Each occurrence of `%' in <TEMPLATE> gets substituted with the -TEMPLATE-ARG specified together with the character. If your strings are -not similar at all, then use `%' as a template and place the full -string in <TEMPLATE-ARG>. A quoting mechanism was added to make it -possible to use a real `%'. The `\' character quotes the special -characters `\', `%', and `,'. - - Here is an example: - - termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]' - - This tells `screen', how to translate ISOlatin1 (charset `B') upper -case umlaut characters on a `hp700' terminal that has a german charset. -`\304' gets translated to `\E(K[\E(B' and so on. Note that this line -gets parsed *three* times before the internal lookup table is built, -therefore a lot of quoting is needed to create a single `\'. - - Another extension was added to allow more emulation: If a mapping -translates the unquoted `%' char, it will be sent to the terminal -whenever screen switches to the corresponding <DESIGNATOR>. In this -special case the template is assumed to be just `%' because the charset -switch sequence and the character mappings normally haven't much in -common. - - This example shows one use of the extension: - termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334' - - Here, a part of the german (`K') charset is emulated on an xterm. -If screen has to change to the `K' charset, `\E(B' will be sent to the -terminal, i.e. the ASCII charset is used instead. The template is just -`%', so the mapping is straightforward: `[' to `\304', `\' to `\326', -and `]' to `\334'. - - -File: screen.info, Node: Message Line, Next: Logging, Prev: Termcap, Up: Top - -The Message Line -**************** - - `screen' displays informational messages and other diagnostics in a -"message line" at the bottom of the screen. If your terminal has a -status line defined in its termcap, screen will use this for displaying -its messages, otherwise the last line of the screen will be temporarily -overwritten and output will be momentarily interrupted. The message -line is automatically removed after a few seconds delay, but it can also -be removed early (on terminals without a status line) by beginning to -type. - -* Menu: - -* Privacy Message:: Using the message line from your program. -* Hardware Status Line:: Use the terminal's hardware status line. -* Last Message:: Redisplay the last message. -* Message Wait:: Control how long messages are displayed. - - -File: screen.info, Node: Privacy Message, Next: Hardware Status Line, Up: Message Line - -Using the message line from your program -======================================== - - The message line facility can be used by an application running in -the current window by means of the ANSI "Privacy message" control -sequence. For instance, from within the shell, try something like: - - echo "^Hello world from window $WINDOW\" - - where `' is ASCII ESC and `^' is a literal caret or up-arrow. - - -File: screen.info, Node: Hardware Status Line, Next: Last Message, Prev: Privacy Message, Up: Message Line - -Hardware Status Line -==================== - - - Command: hardstatus [STATE] - - Command: hardstatus [`always']`lastline'|`message'|`ignore' [STRING] - - Command: hardstatus `string' [STRING] - (none) - This command configures the use and emulation of the terminal's - hardstatus line. The first form toggles whether `screen' will use - the hardware status line to display messages. If the flag is set - to `off', these messages are overlaid in reverse video mode at the - display line. The default setting is `on'. - - The second form tells screen what to do if the terminal doesn't - have a hardstatus line (i.e. the termcap/terminfo capabilities - "hs", "ts", "fs" and "ds" are not set). If the type `lastline' is - used, screen will reserve the last line of the display for the - hardstatus. `message' uses `screen''s message mechanism and - `ignore' tells `screen' never to display the hardstatus. If you - prepend the word `always' to the type, `screen' will use the type - even if the terminal supports a hardstatus line. - - The third form specifies the contents of the hardstatus line. - `%h' is used as default string, i.e. the stored hardstatus of the - current window (settable via `\E]0;^G' or `\E_\\') is displayed. - You can customize this to any string you like including string - escapes (*Note String Escapes::). If you leave out the argument - STRING, the current string is displayed. - - You can mix the second and third form by providing the string as - additional argument. - diff --git a/src/doc/screen.info-4 b/src/doc/screen.info-4 index 727e2af..414c4fc 100644 --- a/src/doc/screen.info-4 +++ b/src/doc/screen.info-4 @@ -20,6 +20,135 @@ versions, except that this permission notice may be stated in a translation approved by the Foundation. +File: screen.info, Node: Character Translation, Prev: Obuflimit, Up: Termcap + +Character Translation +===================== + + `Screen' has a powerful mechanism to translate characters to +arbitrary strings depending on the current font and terminal type. Use +this feature if you want to work with a common standard character set +(say ISO8851-latin1) even on terminals that scatter the more unusual +characters over several national language font pages. + + Syntax: + + XC=<CHARSET-MAPPING>{,,<CHARSET-MAPPING>} + <CHARSET-MAPPING> := <DESIGNATOR><TEMPLATE>{,<MAPPING>} + <MAPPING> := <CHAR-TO-BE-MAPPED><TEMPLATE-ARG> + + The things in braces may be repeated any number of times. + + A <CHARSET-MAPPING> tells screen how to map characters in font +<DESIGNATOR> (`B': Ascii, `A': UK, `K': german, etc.) to strings. Every +<MAPPING> describes to what string a single character will be +translated. A template mechanism is used, as most of the time the codes +have a lot in common (for example strings to switch to and from another +charset). Each occurrence of `%' in <TEMPLATE> gets substituted with the +TEMPLATE-ARG specified together with the character. If your strings are +not similar at all, then use `%' as a template and place the full +string in <TEMPLATE-ARG>. A quoting mechanism was added to make it +possible to use a real `%'. The `\' character quotes the special +characters `\', `%', and `,'. + + Here is an example: + + termcap hp700 'XC=B\E(K%\E(B,\304[,\326\\\\,\334]' + + This tells `screen', how to translate ISOlatin1 (charset `B') upper +case umlaut characters on a `hp700' terminal that has a german charset. +`\304' gets translated to `\E(K[\E(B' and so on. Note that this line +gets parsed *three* times before the internal lookup table is built, +therefore a lot of quoting is needed to create a single `\'. + + Another extension was added to allow more emulation: If a mapping +translates the unquoted `%' char, it will be sent to the terminal +whenever screen switches to the corresponding <DESIGNATOR>. In this +special case the template is assumed to be just `%' because the charset +switch sequence and the character mappings normally haven't much in +common. + + This example shows one use of the extension: + termcap xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334' + + Here, a part of the german (`K') charset is emulated on an xterm. +If screen has to change to the `K' charset, `\E(B' will be sent to the +terminal, i.e. the ASCII charset is used instead. The template is just +`%', so the mapping is straightforward: `[' to `\304', `\' to `\326', +and `]' to `\334'. + + +File: screen.info, Node: Message Line, Next: Logging, Prev: Termcap, Up: Top + +The Message Line +**************** + + `screen' displays informational messages and other diagnostics in a +"message line" at the bottom of the screen. If your terminal has a +status line defined in its termcap, screen will use this for displaying +its messages, otherwise the last line of the screen will be temporarily +overwritten and output will be momentarily interrupted. The message +line is automatically removed after a few seconds delay, but it can also +be removed early (on terminals without a status line) by beginning to +type. + +* Menu: + +* Privacy Message:: Using the message line from your program. +* Hardware Status Line:: Use the terminal's hardware status line. +* Last Message:: Redisplay the last message. +* Message Wait:: Control how long messages are displayed. + + +File: screen.info, Node: Privacy Message, Next: Hardware Status Line, Up: Message Line + +Using the message line from your program +======================================== + + The message line facility can be used by an application running in +the current window by means of the ANSI "Privacy message" control +sequence. For instance, from within the shell, try something like: + + echo "^Hello world from window $WINDOW\" + + where `' is ASCII ESC and `^' is a literal caret or up-arrow. + + +File: screen.info, Node: Hardware Status Line, Next: Last Message, Prev: Privacy Message, Up: Message Line + +Hardware Status Line +==================== + + - Command: hardstatus [STATE] + - Command: hardstatus [`always']`lastline'|`message'|`ignore' [STRING] + - Command: hardstatus `string' [STRING] + (none) + This command configures the use and emulation of the terminal's + hardstatus line. The first form toggles whether `screen' will use + the hardware status line to display messages. If the flag is set + to `off', these messages are overlaid in reverse video mode at the + display line. The default setting is `on'. + + The second form tells screen what to do if the terminal doesn't + have a hardstatus line (i.e. the termcap/terminfo capabilities + "hs", "ts", "fs" and "ds" are not set). If the type `lastline' is + used, screen will reserve the last line of the display for the + hardstatus. `message' uses `screen''s message mechanism and + `ignore' tells `screen' never to display the hardstatus. If you + prepend the word `always' to the type, `screen' will use the type + even if the terminal supports a hardstatus line. + + The third form specifies the contents of the hardstatus line. + `%h' is used as default string, i.e. the stored hardstatus of the + current window (settable via `\E]0;^G' or `\E_\\') is displayed. + You can customize this to any string you like including string + escapes (*Note String Escapes::). If you leave out the argument + STRING, the current string is displayed. + + You can mix the second and third form by providing the string as + additional argument. + + File: screen.info, Node: Last Message, Next: Message Wait, Prev: Hardware Status Line, Up: Message Line Display Last Message @@ -692,7 +821,7 @@ Contributors Version ======= - This manual describes version 3.9.0 of the `screen' program. Its + This manual describes version 3.9.6 of the `screen' program. Its roots are a merge of a custom version 2.3PR7 by Wayne Davison and several enhancements to Oliver Laumann's version 2.0. Note that all versions numbered 2.x are copyright by Oliver Laumann. @@ -927,6 +1056,7 @@ Command Index * at: At. * autodetach: Detach. * autonuke: Autonuke. +* bce: Character Processing. * bell_msg: Bell. * bind: Bind. * bindkey: Bindkey. @@ -949,6 +1079,7 @@ Command Index * crlf: Line Termination. * debug: Debug. * defautonuke: Autonuke. +* defbce: Character Processing. * defbreaktype: Break. * defc1: Character Processing. * defcharset: Character Processing. @@ -975,7 +1106,7 @@ Command Index * echo: echo. * escape: Command Character. * exec: Exec. -* fit: Window Size. +* fit: Fit. * flow: Flow. * focus: Focus. * gr: Character Processing. @@ -1037,6 +1168,7 @@ Command Index * remove: Remove. * removebuf: Screen-Exchange. * reset: Reset. +* resize: Resize. * screen: Screen Command. * scrollback: Scrollback. * select: Select. @@ -1103,8 +1235,8 @@ omitted from the key sequences, since it is the same for all bindings. * {: History. * A: Title Command. * a: Command Character. -* c: Screen Command. * C: Clear. +* c: Screen Command. * C-a: Other Window. * C-c: Screen Command. * C-d: Detach. @@ -1128,33 +1260,33 @@ omitted from the key sequences, since it is the same for all bindings. * C-[: Copy. * C-\: Quit. * C-]: Paste. -* D: Power Detach. * d: Detach. +* D: Power Detach. * ESC: Copy. -* F: Window Size. +* F: Fit. * f: Flow. * H: Log. * h: Hardcopy. * i: Info. * k: Kill. -* l: Redisplay. * L: Login. -* m: Last Message. +* l: Redisplay. * M: Monitor. -* N: Number. +* m: Last Message. * n: Next and Previous. +* N: Number. * p: Next and Previous. -* q: XON/XOFF. * Q: Only. +* q: XON/XOFF. * r: Wrap. -* S: Split. * s: XON/XOFF. +* S: Split. * SPC: Next and Previous. * t: Time. * TAB: Focus. * v: Version. -* w: Windows. * W: Window Size. +* w: Windows. * x: Lock. * X: Remove. * z: Suspend. diff --git a/src/doc/screen.texinfo b/src/doc/screen.texinfo index 1267d94..3ec2365 100644 --- a/src/doc/screen.texinfo +++ b/src/doc/screen.texinfo @@ -6,7 +6,7 @@ @finalout @setchapternewpage odd @c %**end of header -@set version 3.9.0 +@set version 3.9.6 @c For examples, use a literal escape in info. @ifinfo @@ -787,6 +787,8 @@ Execute a command at other displays or windows. @xref{At}. Automatically detach the session on SIGHUP. @xref{Detach}. @item autonuke @var{state} Enable a clear screen to discard unwritten output. @xref{Autonuke}. +@item bce @var{[state]} +Change background color erase. @xref{Character Processing}. @item bell_msg @var{[message]} Set the bell notification message. @xref{Bell}. @item bind @var{key [command [args]]} @@ -829,6 +831,8 @@ Select line break behavior for copying. @xref{Line Termination}. Suppress/allow debugging output. @xref{Debug}. @item defautonuke @var{state} Select default autonuke behavior. @xref{Autonuke}. +@item defbce @var{state} +Select background color erase. @xref{Character Processing}. @item defbreaktype @var{[tcsendbreak | TCSBRK | TIOCSBRK]} Specify the default for generating breaks. @xref{Break}. @item defc1 @var{state} @@ -1675,7 +1679,9 @@ which can contain different windows. * Focus:: Change to the next region * Only:: Delete all other regions * Remove:: Delete the current region +* Resize:: Grow or shrink a region * Caption:: Control the window's caption +* Fit:: Resize a window to fit the region @end menu @node Split, Focus, , Regions @@ -1694,7 +1700,16 @@ window is displayed on the new region. @deffn Command focus (@kbd{C-a @key{Tab}})@* Move the input focus to the next region. This is done in a cyclic -way so that the top region is selected after the bottom one. +way so that the top region is selected after the bottom one. If +no subcommand is given it defaults to `down'. `up' cycles in the +opposite order, `top' and `bottom' go to the top and bottom +region respectively. Useful bindings are (j and k as in vi) +@example +bind j focus down +bind k focus up +bind t focus top +bind b focus bottom +@end example @end deffn @node Only, Remove, Focus, Regions @@ -1705,7 +1720,7 @@ way so that the top region is selected after the bottom one. Kill all regions but the current one. @end deffn -@node Remove, Caption, Only, Regions +@node Remove, Resize, Only, Regions @section Remove @kindex X @deffn Command remove @@ -1713,7 +1728,23 @@ Kill all regions but the current one. Kill the current region. This is a no-op if there is only one region. @end deffn -@node Caption, , Remove, Regions +@node Resize, Caption, Remove, Regions +@section Resize +@deffn Command resize @var{[(+/-)lines]} +(none)@* +Resize the current region. The space will be removed from or added to +the region below or if there's not enough space from the region above. +@example +resize +N increase current region height by N +resize -N decrease current region height by N +resize N set current region height to N +resize = make all windows equally high +resize max maximize current region height +resize min minimize current region height +@end example +@end deffn + +@node Caption, Fit, Resize, Regions @section Caption @deffn Command caption @code{always}|@code{splitonly} [string] @deffnx Command caption @code{string} [string] @@ -1733,6 +1764,16 @@ You can mix both forms by providing the string as an additional argument. @end deffn +@node Fit, , Caption, Regions +@section Fit +@kindex F +@deffn Command fit +(@kbd{C-a F})@* +Change the window size to the size of the current region. This +command is needed because screen doesn't adapt the window size +automatically if the window is displayed more than once. +@end deffn + @node Window Settings, Virtual Terminal, Regions, Top @chapter Window Settings @@ -2142,6 +2183,7 @@ ESC [ Pn K Erase in Line Pn = None or 0 From Cursor to End of Line 1 From Beginning of Line to Cursor 2 Entire Line +ESC [ Pn X Erase character ESC [ Pn A Cursor Up ESC [ Pn B Cursor Down ESC [ Pn C Cursor Right @@ -2174,8 +2216,8 @@ ESC [ Ps ;...; Ps m Select Graphic Rendition 37 (A) Foreground White 39 (A) Foreground Default 40 (A) Background Black - ... ... - 49 (A) Background Default + ... ... + 49 (A) Background Default ESC [ Pn g Tab Clear Pn = None or 0 Clear Tab at Current Position 3 Clear All Tabs @@ -2199,7 +2241,9 @@ ESC [ Ps ;...; Ps l Reset Mode ?5 (V) Reverse Video ?6 (V) @samp{Origin} Mode ?7 (V) @samp{Wrap} Mode + ?9 X10 mouse tracking ?25 (V) Visible Cursor + ?1000 (V) VT200 mouse tracking ESC [ 5 i (A) Start relay to printer (ANSI Media Copy) ESC [ 4 i (A) Stop relay to printer (ANSI Media Copy) ESC [ 8 ; Ph ; Pw t Resize the window to @samp{Ph} lines and @@ -2499,14 +2543,6 @@ Set the display height to a specified number of lines. When no argument is given it toggles between 24 and 42 lines display. @end deffn -@kindex F -@deffn Command fit -(@kbd{C-a F})@* -Change the window size to the size of the current region. This -command is needed because screen doesn't adapt the window size -automatically if the window is displayed more than once. -@end deffn - @node Character Processing, ,Window Size, Virtual Terminal @section Character Processing @@ -2530,6 +2566,14 @@ default (see also @samp{defgr}) is not to process GR switching because otherwise the ISO88591 charset would not work. @end deffn +@deffn Command bce [state] +(none)@* +Change background-color-erase setting. If @samp{bce} is set to +on, all characters cleared by an erase/insert/scroll/clear +operation will be displayed in the current background color. +Otherwise the default background color is used. +@end deffn + @deffn Command kanji wtype [dtype] (none)@* Tell screen how to process kanji input/output. @var{wtype} and @@ -2570,6 +2614,12 @@ Same as the @samp{gr} command except that the default setting for new windows is changed. Initial setting is @samp{off}. @end deffn +@deffn Command defbce state +(none)@* +Same as the @samp{bce} command except that the default setting for +new windows is changed. Initial setting is @samp{off}. +@end deffn + @deffn Command defkanji wtype (none)@* Same as the @samp{kanji} command except that the default setting for @@ -3708,6 +3758,10 @@ Does understand ANSI set default fg/bg color (@samp{\E[39m / \E[49m}). Describe a translation of characters to strings depending on the current font. (@pxref{Character Translation}). +@item XT +(bool)@* +Terminal understands special xterm sequences (OSC, mouse tracking). + @item TF (bool)@* Add missing capabilities to the termcap/info entry. (Set by default). diff --git a/src/etc/screenrc b/src/etc/screenrc index c718364..448014a 100644 --- a/src/etc/screenrc +++ b/src/etc/screenrc @@ -1,3 +1,4 @@ + # # Example of a user's .screenrc file # @@ -70,7 +71,7 @@ termcapinfo xterm 'XC=K%,%\E(B,[\304,\\\\\326,]\334,{\344,|\366,}\374,~\337' # xterm-52 tweaks: # - uses background color for delete operations -termcapinfo xterm ut +termcapinfo xterm be ################ # @@ -136,3 +137,7 @@ bind ^] paste [.] # hardstatus alwaysignore # hardstatus alwayslastline "%w" +# bind = resize = +# bind + resize +1 +# bind - resize -1 +# bind _ resize max diff --git a/src/extern.h b/src/extern.h index 59d42f2..96de168 100644 --- a/src/extern.h +++ b/src/extern.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -52,11 +52,11 @@ extern void ResetAnsiState __P((struct win *)); extern void ResetWindow __P((struct win *)); extern void ResetCharsets __P((struct win *)); extern void WriteString __P((struct win *, char *, int)); -extern void NewAutoFlow __P((struct win *, int)); -extern void WBell __P((struct win *, int)); extern void ChangeAKA __P((struct win *, char *, int)); extern void SetCharsets __P((struct win *, char *)); extern int GetAnsiStatus __P((struct win *, char *)); +extern void WNewAutoFlow __P((struct win *, int)); +extern void WBell __P((struct win *, int)); extern void WMsg __P((struct win *, int, char *)); extern void WChangeSize __P((struct win *, int, int)); extern void WindowChanged __P((struct win *, int)); @@ -68,7 +68,7 @@ extern void FinishRc __P((char *)); extern void RcLine __P((char *)); extern FILE *secfopen __P((char *, char *)); extern int secopen __P((char *, int, int)); -extern void WriteFile __P((int)); +extern void WriteFile __P((struct user *, int)); extern char *ReadFile __P((char *, int *)); extern void KillBuffers __P((void)); extern int printpipe __P((struct win *, char *)); @@ -131,7 +131,6 @@ extern int DoStartLog __P((struct win *, char *, int)); extern int ReleaseAutoWritelock __P((struct display *, struct win *)); extern int ObtainAutoWritelock __P((struct display *, struct win *)); extern void CloseDevice __P((struct win *)); -extern void paste_rethink __P((struct win *)); /* utmp.c */ @@ -188,6 +187,12 @@ extern struct win *FindNiceWindow __P((struct win *, char *)); #ifdef COPY_PASTE extern int CompileKeys __P((char *, unsigned char *)); #endif +#ifdef RXVT_OSC +extern void RefreshXtermOSC __P((void)); +#endif +extern int ParseSaveStr __P((struct action *act, char **)); +extern int ParseNum __P((struct action *act, int *)); +extern int ParseSwitch __P((struct action *, int *)); /* termcap.c */ extern int InitTermcap __P((int, int)); @@ -210,7 +215,7 @@ extern struct display *MakeDisplay __P((char *, char *, char *, int, int, struct extern void FreeDisplay __P((void)); extern void DefProcess __P((char **, int *)); extern void DefRedisplayLine __P((int, int, int, int)); -extern void DefClearLine __P((int, int, int)); +extern void DefClearLine __P((int, int, int, int)); extern int DefRewrite __P((int, int, int, struct mchar *, int)); extern int DefResize __P((int, int)); extern void DefRestore __P((void)); @@ -220,19 +225,22 @@ extern void InitTerm __P((int)); extern void FinitTerm __P((void)); extern void PUTCHAR __P((int)); extern void PUTCHARLP __P((int)); -extern void ClearDisplay __P((void)); -extern void Clear __P((int, int, int, int, int, int, int)); -extern void Redisplay __P((int)); -extern void RedisplayDisplays __P((int)); +extern void ClearAll __P((void)); +extern void ClearArea __P((int, int, int, int, int, int, int, int)); +extern void ClearLine __P((struct mline *, int, int, int, int)); +extern void RefreshAll __P((int)); extern void RefreshArea __P((int, int, int, int, int)); extern void RefreshLine __P((int, int, int, int)); +extern void Redisplay __P((int)); +extern void RedisplayDisplays __P((int)); extern void ShowHStatus __P((char *)); extern void RefreshHStatus __P((void)); extern void DisplayLine __P((struct mline *, struct mline *, int, int, int)); extern void GotoPos __P((int, int)); extern int CalcCost __P((char *)); -extern void ScrollH __P((int, int, int, int, struct mline *)); -extern void ScrollV __P((int, int, int, int, int)); +extern void ScrollH __P((int, int, int, int, int, struct mline *)); +extern void ScrollV __P((int, int, int, int, int, int)); +extern void PutChar __P((struct mchar *, int, int)); extern void InsChar __P((struct mchar *, int, int, int, struct mline *)); extern void WrapChar __P((struct mchar *, int, int, int, int, int, int, int)); extern void ChangeScrollRegion __P((int, int)); @@ -241,6 +249,7 @@ extern void KeypadMode __P((int)); extern void CursorkeysMode __P((int)); extern void ReverseVideo __P((int)); extern void CursorVisibility __P((int)); +extern void MouseMode __P((int)); extern void SetFont __P((int)); extern void SetAttr __P((int)); extern void SetColor __P((int)); @@ -267,12 +276,15 @@ extern void RemCanvas __P((void)); extern void OneCanvas __P((void)); extern int RethinkDisplayViewports __P((void)); extern void RethinkViewportOffsets __P((struct canvas *)); +#ifdef RXVT_OSC +extern void ClearAllXtermOSC __P((void)); +extern void SetXtermOSC __P((int, char *)); +#endif /* resize.c */ extern int ChangeWindowSize __P((struct win *, int, int, int)); extern void ChangeScreenSize __P((int, int, int)); extern void CheckScreenSize __P((int)); -extern void DoResize __P((int, int)); extern char *xrealloc __P((char *, int)); extern void ResizeLayersToCanvases __P((void)); extern void ResizeLayer __P((struct layer *, int, int, struct display *)); @@ -341,9 +353,6 @@ extern int xsnprintf __P(()); /* acl.c */ #ifdef MULTIUSER -extern int AclInit __P((char *)); -extern int AclSetPass __P((char *, char *)); -extern int AclDelUser __P((char *)); extern int AclCheckPermWin __P((struct user *, int, struct win *)); extern int AclCheckPermCmd __P((struct user *, int, struct comm *)); extern int AclSetPerm __P((struct user *, struct user *, char *, char *)); @@ -361,9 +370,8 @@ extern int UserAdd __P((char *, char *, struct user **)); extern int UserDel __P((char *, struct user **)); - - - +/* braile.c */ +#ifdef HAVE_BRAILLE extern void InitBraille __P((void)); extern void RefreshBraille __P((void)); extern void DoBrailleAction __P((struct action *, int)); @@ -371,11 +379,9 @@ extern void BGotoPos __P((struct layer *, int, int)); extern void BPutChar __P((struct layer *, struct mchar *, int, int)); extern void BPutStr __P((struct layer *, char *, int, struct mchar *, int, int)); extern void BCDisplayLine __P((struct layer *, struct mline *, int, int, int, int)); +#endif -extern int ParseSaveStr __P((struct action *act, char **)); -extern int ParseNum __P((struct action *act, int *)); -extern int ParseSwitch __P((struct action *, int *)); /* layer.c */ @@ -383,10 +389,12 @@ extern void LGotoPos __P((struct layer *, int, int)); extern void LPutChar __P((struct layer *, struct mchar *, int, int)); extern void LInsChar __P((struct layer *, struct mchar *, int, int, struct mline *)); extern void LPutStr __P((struct layer *, char *, int, struct mchar *, int, int)); -extern void LScrollH __P((struct layer *, int, int, int, int, struct mline *)); -extern void LScrollV __P((struct layer *, int, int, int)); -extern void LClear __P((struct layer *, int, int, int, int, int)); -extern void LClearLine __P((struct layer *, int, int, int, struct mline *)); +extern void LScrollH __P((struct layer *, int, int, int, int, int, struct mline *)); +extern void LScrollV __P((struct layer *, int, int, int, int)); +extern void LClearAll __P((struct layer *, int)); +extern void LClearArea __P((struct layer *, int, int, int, int, int, int)); +extern void LClearLine __P((struct layer *, int, int, int, int, struct mline *)); +extern void LRefreshAll __P((struct layer *, int)); extern void LCDisplayLine __P((struct layer *, struct mline *, int, int, int, int)); extern void LSetRendition __P((struct layer *, struct mchar *)); extern void LWrapChar __P((struct layer *, struct mchar *, int, int, int, int)); @@ -394,19 +402,18 @@ extern void LCursorVisibility __P((struct layer *, int)); extern void LSetFlow __P((struct layer *, int)); extern void LKeypadMode __P((struct layer *, int)); extern void LCursorkeysMode __P((struct layer *, int)); - +extern void LMouseMode __P((struct layer *, int)); #ifdef USEVARARGS extern void LMsg __P((int, char *, ...)) __attribute__((format(printf, 2, 3))); #else extern void LMsg __P(()); #endif -extern void ClearLayer __P((struct layer *, int)); -extern void RedisplayLayer __P((struct layer *, int)); extern void KillLayerChain __P((struct layer *)); extern int InitOverlayPage __P((int, struct LayFuncs *, int)); extern void ExitOverlayPage __P((void)); /* teln.c */ +#ifdef BUILTIN_TELNET extern int TelOpen __P((char **)); extern int TelConnect __P((struct win *)); extern int TelIsline __P((struct win *p)); @@ -416,6 +423,7 @@ extern int TelIn __P((struct win *, char *, int, int)); extern void TelBreak __P((struct win *)); extern void TelWindowSize __P((struct win *)); extern void TelStatus __P((struct win *, char *, int)); +#endif /* nethack.c */ extern char *DoNLS __P((char *)); diff --git a/src/fileio.c b/src/fileio.c index 147bdd5..2707c5a 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -39,6 +39,7 @@ RCS_ID("$Id$ FAU") extern struct display *display, *displays; extern struct win *fore; +extern struct layer *flayer; extern int real_uid, eff_uid; extern int real_gid, eff_gid; extern char *extra_incap, *extra_outcap; @@ -286,7 +287,12 @@ char *ubuf; #endif if (display) - fore = D_fore; + { + fore = D_fore; + flayer = D_forecv->c_layer; + } + else + flayer = fore ? fore->w_savelayer : 0; buf = expand_vars(ubuf, display); if (Parse(buf, args) <= 0) return; @@ -309,7 +315,8 @@ char *ubuf; * needs display for copybuffer access and termcap dumping */ void -WriteFile(dump) +WriteFile(user, dump) +struct user *user; int dump; { /* dump==0: create .termcap, @@ -346,7 +353,7 @@ int dump; strcpy(fn + i, ".termcap"); break; case DUMP_HARDCOPY: - if (hardcopydir && strlen(hardcopydir) < sizeof(fn) - 21) + if (hardcopydir && *hardcopydir && strlen(hardcopydir) < sizeof(fn) - 21) sprintf(fn, "%s/hardcopy.%d", hardcopydir, fore->w_number); else sprintf(fn, "hardcopy.%d", fore->w_number); @@ -416,14 +423,14 @@ int dump; if (*mode == 'a') { putc('>', f); - for (j = D_width - 2; j > 0; j--) + for (j = fore->w_width - 2; j > 0; j--) putc('=', f); fputs("<\n", f); } - for (i = 0; i < D_height; i++) + for (i = 0; i < fore->w_height; i++) { p = fore->w_mlines[i].image; - for (k = D_width - 1; k >= 0 && p[k] == ' '; k--) + for (k = fore->w_width - 1; k >= 0 && p[k] == ' '; k--) ; for (j = 0; j <= k; j++) putc(p[j], f); @@ -439,8 +446,8 @@ int dump; break; #ifdef COPY_PASTE case DUMP_EXCHANGE: - p = D_user->u_copybuffer; - for (i = D_user->u_copylen; i-- > 0; p++) + p = user->u_copybuffer; + for (i = user->u_copylen; i-- > 0; p++) if (*p == '\r' && (i == 0 || p[1] != '\n')) putc('\n', f); else @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -242,7 +242,7 @@ int *plen; static void HelpAbort() { - LAY_CALL_UP(RedisplayLayer(flayer, 0)); + LAY_CALL_UP(LRefreshAll(flayer, 0)); ExitOverlayPage(); } @@ -262,7 +262,7 @@ helppage() helpdata->refcommand_search = helpdata->command_search; /* Clear the help screen */ - ClearLayer(flayer, 0); + LClearAll(flayer, 0); sprintf(cbuf,"Screen key bindings, page %d of %d.", helpdata->grow / (flayer->l_height-5) + 1, helpdata->numpages); centerline(cbuf, 0); @@ -332,7 +332,7 @@ helppage() sprintf(cbuf,"[Press Space %s Return to end.]", helpdata->grow < helpdata->maxrow ? "for next page;" : "or"); centerline(cbuf, flayer->l_height - 2); - SetCursor(); + LaySetCursor(); return 0; } @@ -428,7 +428,7 @@ int y, xs, xe, isblank; if (y != 0 && y != flayer->l_height - 1) return; if (!isblank) - LClear(flayer, xs, y, xe, y, 0); + LClearArea(flayer, xs, y, xe, y, 0, 0); } @@ -464,7 +464,7 @@ static const char cpmsg[] = "\ \n\ Screen version %v\n\ \n\ -Copyright (c) 1993-1999 Juergen Weigert, Michael Schroeder\n\ +Copyright (c) 1993-2000 Juergen Weigert, Michael Schroeder\n\ Copyright (c) 1987 Oliver Laumann\n\ \n\ This program is free software; you can redistribute it and/or \ @@ -522,7 +522,7 @@ int *plen; static void CopyrightAbort() { - LAY_CALL_UP(RedisplayLayer(flayer, 0)); + LAY_CALL_UP(LRefreshAll(flayer, 0)); ExitOverlayPage(); } @@ -558,7 +558,7 @@ copypage() ASSERT(flayer); copydata = (struct copydata *)flayer->l_data; - ClearLayer(flayer, 0); + LClearAll(flayer, 0); x = y = 0; cps = copydata->cps; copydata->refcps = cps; @@ -614,7 +614,7 @@ copypage() *cps ? "for next page;" : "or"); centerline(cbuf, flayer->l_height - 2); copydata->cps = cps; - SetCursor(); + LaySetCursor(); } static void @@ -636,7 +636,7 @@ int y, xs, xe, isblank; return; if (isblank) return; - LClear(flayer, xs, y, xe, y, 0); + LClearArea(flayer, xs, y, xe, y, 0, 0); } @@ -647,6 +647,8 @@ int y, xs, xe, isblank; ** */ +#ifdef MULTI + static void DisplaysProcess __P((char **, int *)); static void DisplaysRedisplayLine __P((int, int, int, int)); static void displayspage __P((void)); @@ -698,6 +700,7 @@ int *plen; } } + void display_displays() { @@ -748,7 +751,7 @@ displayspage() displaysdata = (struct displaysdata *)flayer->l_data; - ClearLayer(flayer, 0); + LClearAll(flayer, 0); leftline("term-type size user interface window", 0); leftline("---------- ------- ---------- ----------------- ----------", 1); @@ -800,7 +803,7 @@ displayspage() sprintf(tbuf,"[Press Space %s Return to end.]", 1 ? "to refresh;" : "or"); centerline(tbuf, flayer->l_height - 2); - SetCursor(); + LaySetCursor(); } static void @@ -820,10 +823,12 @@ int y, xs, xe, isblank; return; if (isblank) return; - LClear(flayer, xs, y, xe, y, 0); + LClearArea(flayer, xs, y, xe, y, 0, 0); /* To be filled in... */ } +#endif /* MULTI */ + /* ** @@ -903,7 +908,7 @@ struct action *tab; static void BindkeyAbort() { - LAY_CALL_UP(RedisplayLayer(flayer, 0)); + LAY_CALL_UP(LRefreshAll(flayer, 0)); ExitOverlayPage(); } @@ -918,7 +923,7 @@ bindkeypage() bindkeydata = (struct bindkeydata *)flayer->l_data; - ClearLayer(flayer, 0); + LClearAll(flayer, 0); sprintf(tbuf, "%s key bindings, page %d of %d.", bindkeydata->title, bindkeydata->page, bindkeydata->pages); centerline(tbuf, 0); @@ -970,7 +975,7 @@ bindkeypage() bindkeydata->last = i; sprintf(tbuf,"[Press Space %s Return to end.]", bindkeydata->page < bindkeydata->pages ? "for next page;" : "or"); centerline(tbuf, flayer->l_height - 2); - SetCursor(); + LaySetCursor(); } static void @@ -1021,7 +1026,7 @@ int y, xs, xe, isblank; if (y != 0 && y != flayer->l_height - 1) return; if (!isblank) - LClear(flayer, xs, y, xe, y, 0); + LClearArea(flayer, xs, y, xe, y, 0, 0); } #endif /* MAPKEYS */ diff --git a/src/image.h b/src/image.h index 39019a9..fb6eb21 100644 --- a/src/image.h +++ b/src/image.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -38,12 +38,18 @@ # define IFCOLOR(x) #endif +#ifdef KANJI +# define IFKANJI(x) x +#else +# define IFKANJI(x) +#endif struct mchar { char image; char attr; IFFONT( char font;) IFCOLOR(char color;) +IFKANJI(char mbcs;) }; struct mline { @@ -109,5 +115,6 @@ IFCOLOR((ml)->color[x] = (mc)->color; )\ (mc)->attr = (ml)->attr[x]; \ IFFONT( (mc)->font = (ml)->font[x]; )\ IFCOLOR((mc)->color = (ml)->color[x]; )\ +IFKANJI((mc)->mbcs = 0; )\ } while (0) diff --git a/src/input.c b/src/input.c index b723880..fd34363 100644 --- a/src/input.c +++ b/src/input.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -243,7 +243,7 @@ int *plen; x = inpdata->inpstringlen; if (inpdata->inp.len && !(inpdata->inpmode & INP_NOECHO)) { - LClear(flayer, x, INPUTLINE, x + inpdata->inp.len - 1, INPUTLINE, 0); + LClearArea(flayer, x, INPUTLINE, x + inpdata->inp.len - 1, INPUTLINE, 0, 0); LGotoPos(flayer, x, INPUTLINE); } inpdata->inp.len = inpdata->inp.pos = 0; @@ -253,7 +253,7 @@ int *plen; x = inpdata->inpstringlen + inpdata->inp.pos; if (inpdata->inp.len > inpdata->inp.pos && !(inpdata->inpmode & INP_NOECHO)) { - LClear(flayer, x, INPUTLINE, x + inpdata->inp.len - inpdata->inp.pos - 1, INPUTLINE, 0); + LClearArea(flayer, x, INPUTLINE, x + inpdata->inp.len - inpdata->inp.pos - 1, INPUTLINE, 0, 0); LGotoPos(flayer, x, INPUTLINE); } inpdata->inp.len = inpdata->inp.pos; @@ -283,7 +283,7 @@ int *plen; struct mchar mc; mc = mchar_so; if (inpdata->inp.len && !(inpdata->inpmode & INP_NOECHO)) - LClear(flayer, inpdata->inpstringlen, INPUTLINE, inpdata->inpstringlen + inpdata->inp.len - 1, INPUTLINE, 0); + LClearArea(flayer, inpdata->inpstringlen, INPUTLINE, inpdata->inpstringlen + inpdata->inp.len - 1, INPUTLINE, 0, 0); inpdata->inp = inphist; /* structure copy */ if (inpdata->inp.len > inpdata->inpmaxlen) @@ -341,7 +341,7 @@ int *plen; static void InpAbort() { - LAY_CALL_UP(RedisplayLine(INPUTLINE, 0, flayer->l_width - 1, 0)); + LAY_CALL_UP(LayRedisplayLine(INPUTLINE, 0, flayer->l_width - 1, 0)); ExitOverlayPage(); } @@ -355,7 +355,7 @@ int y, xs, xe, isblank; inpdata = (struct inpdata *)flayer->l_data; if (y != INPUTLINE) { - LAY_CALL_UP(RedisplayLine(y, xs, xe, isblank)); + LAY_CALL_UP(LayRedisplayLine(y, xs, xe, isblank)); return; } inpdata->inp.buf[inpdata->inp.len] = 0; @@ -390,7 +390,7 @@ int y, xs, xe, isblank; l = v; if (l > r - q) l = r - q; - LClear(flayer, q, y, q + l - 1, y, 0); + LClearArea(flayer, q, y, q + l - 1, y, 0, 0); q += l; } } diff --git a/src/layer.c b/src/layer.c index 00ca6c2..b17dcfe 100644 --- a/src/layer.c +++ b/src/layer.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -117,9 +117,10 @@ int x, y; } void -LScrollH(l, n, y, xs, xe, ol) +LScrollH(l, n, y, xs, xe, bce, ol) struct layer *l; int n, y, xs, xe; +int bce; struct mline *ol; { struct canvas *cv; @@ -143,7 +144,7 @@ struct mline *ol; if (xs2 > xe2) continue; display = cv->c_display; - ScrollH(y2, xs2, xe2, n, ol ? mloff(ol, -vp->v_xoff) : 0); + ScrollH(y2, xs2, xe2, n, bce, ol ? mloff(ol, -vp->v_xoff) : 0); if (xe2 - xs2 == xe - xs) continue; if (n > 0) @@ -166,10 +167,11 @@ struct mline *ol; } void -LScrollV(l, n, ys, ye) +LScrollV(l, n, ys, ye, bce) struct layer *l; int n; int ys, ye; +int bce; { struct canvas *cv; struct viewport *vp; @@ -195,9 +197,9 @@ int ys, ye; continue; display = cv->c_display; #if 0 - ScrollV(xs2, ys2, xe2, ye2, n); + ScrollV(xs2, ys2, xe2, ye2, n, bce); #else - ScrollV(vp->v_xs, ys2, vp->v_xe, ye2, n); + ScrollV(vp->v_xs, ys2, vp->v_xe, ye2, n, bce); #endif debug2("LScrollV: %d %d", ys, ye); debug2(" -> %d %d\n", ys2, ye2); @@ -291,21 +293,20 @@ int x, y; } #endif for (cv = l->l_cvlist; cv; cv = cv->c_lnext) - for (vp = cv->c_vplist; vp; vp = vp->v_next) - { - y2 = y + vp->v_yoff; - if (y2 < vp->v_ys || y2 > vp->v_ye) - continue; - x2 = x + vp->v_xoff; - if (x2 < vp->v_xs || x2 > vp->v_xe) - continue; - display = cv->c_display; - GotoPos(x2, y2); - SetRendition(c); - PUTCHARLP(c->image); - if (D_AM && !D_CLP && x2 == D_width - 1) - GotoPos(x2, y2); - } + { + display = cv->c_display; + for (vp = cv->c_vplist; vp; vp = vp->v_next) + { + y2 = y + vp->v_yoff; + if (y2 < vp->v_ys || y2 > vp->v_ye) + continue; + x2 = x + vp->v_xoff; + if (x2 < vp->v_xs || x2 > vp->v_xe) + continue; + PutChar(c, x2, y2); + break; + } + } } void @@ -354,9 +355,9 @@ int x, y; } void -LClearLine(l, y, xs, xe, ol) +LClearLine(l, y, xs, xe, bce, ol) struct layer *l; -int xs, xe; +int xs, xe, bce; struct mline *ol; { struct canvas *cv; @@ -383,14 +384,15 @@ struct mline *ol; if (xs2 > xe2) continue; display = cv->c_display; - DisplayLine(ol ? mloff(ol, -vp->v_xoff) : &mline_null, &mline_blank, y2, xs2, xe2); + ClearLine(ol ? mloff(ol, -vp->v_xoff) : (struct mline *)0, y2, xs2, xe2, bce); } } void -LClear(l, xs, ys, xe, ye, uself) +LClearArea(l, xs, ys, xe, ye, bce, uself) struct layer *l; int xs, ys, xe, ye; +int bce; int uself; { struct canvas *cv; @@ -440,14 +442,14 @@ int uself; if (ye2 != ye + vp->v_yoff) xe2 = xce; display = cv->c_display; - Clear(xs2, ys2, xcs, xce, xe2, ye2, uself); + ClearArea(xs2, ys2, xcs, xce, xe2, ye2, bce, uself); #else if (xs == 0 || ys2 != ys + vp->v_yoff) xs2 = vp->v_xs; if (xe == l->l_width - 1 || ye2 != ye + vp->v_yoff) xe2 = vp->v_xe; display = cv->c_display; - Clear(xs2, ys2, vp->v_xs, vp->v_xe, xe2, ye2, uself); + ClearArea(xs2, ys2, vp->v_xs, vp->v_xe, xe2, ye2, bce, uself); #endif } } @@ -516,7 +518,13 @@ int ins; struct canvas *cv, *cvlist, *cvlnext; struct viewport *vp, *evp, **vpp; int yy, y2, yy2, top2, bot2; + int bce; +#ifdef COLOR + bce = c->color >> 4 & 0xf; +#else + bce = 0; +#endif if (y != bot) { /* simple case: no scrolling */ @@ -526,6 +534,7 @@ int ins; for (cv = l->l_cvlist; cv; cv = cv->c_lnext) { + y2 = 0; /* gcc -Wall */ display = cv->c_display; /* find the viewport of the wrapped character */ for (vp = cv->c_vplist; vp; vp = vp->v_next) @@ -588,7 +597,7 @@ int ins; cvlnext = cv->c_lnext; l->l_cvlist = cv; cv->c_lnext = 0; - LScrollV(l, 1, top, bot); + LScrollV(l, 1, top, bot, bce); if (!vp) { if (ins) @@ -674,34 +683,50 @@ int on; } } +void +LMouseMode(l, on) +struct layer *l; +int on; +{ + struct canvas *cv; + for (cv = l->l_cvlist; cv; cv = cv->c_lnext) + { + display = cv->c_display; + if (cv != D_forecv) + continue; + MouseMode(on); + } +} + + /*******************************************************************/ void -ClearLayer(l, uself) +LClearAll(l, uself) struct layer *l; int uself; { - LClear(l, 0, 0, l->l_width - 1, l->l_height - 1, uself); + LClearArea(l, 0, 0, l->l_width - 1, l->l_height - 1, 0, uself); } void -RedisplayLayer(l, isblank) +LRefreshAll(l, isblank) struct layer *l; int isblank; { struct layer *oldflayer; int y; - debug1("RedisplayLayer isblank=%d\n", isblank); + debug1("LRefreshAll isblank=%d\n", isblank); oldflayer = flayer; flayer = l; if (!isblank) - LClear(l, 0, 0, l->l_width - 1, l->l_height - 1, 0); + LClearArea(l, 0, 0, l->l_width - 1, l->l_height - 1, -1, 0); /* signal full refresh */ - RedisplayLine(-1, -1, -1, 1); + LayRedisplayLine(-1, -1, -1, 1); for (y = 0; y < l->l_height; y++) - RedisplayLine(y, 0, l->l_width - 1, 1); + LayRedisplayLine(y, 0, l->l_width - 1, 1); flayer = oldflayer; } @@ -829,7 +854,7 @@ int block; newlay->l_next = flayer; newlay->l_bottom = flayer->l_bottom; flayer = newlay; - Restore(); + LayRestore(); return 0; } @@ -887,13 +912,13 @@ ExitOverlayPage() flayer->l_cvlist = oldlay->l_cvlist; /* redisplay only the warped cvs */ if (doredisplay) - RedisplayLayer(flayer, 0); + LRefreshAll(flayer, 0); ocv->c_lnext = cv; } oldlay->l_cvlist = 0; free((char *)oldlay); - Restore(); - SetCursor(); + LayRestore(); + LaySetCursor(); } void diff --git a/src/layer.h b/src/layer.h index 30de0c3..6da3900 100644 --- a/src/layer.h +++ b/src/layer.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -31,13 +31,13 @@ struct mchar; /* forward declaration */ struct LayFuncs { - void (*LayProcess) __P((char **, int *)); - void (*LayAbort) __P((void)); - void (*LayRedisplayLine) __P((int, int, int, int)); - void (*LayClearLine) __P((int, int, int)); - int (*LayRewrite) __P((int, int, int, struct mchar *, int)); - int (*LayResize) __P((int, int)); - void (*LayRestore) __P((void)); + void (*lf_LayProcess) __P((char **, int *)); + void (*lf_LayAbort) __P((void)); + void (*lf_LayRedisplayLine) __P((int, int, int, int)); + void (*lf_LayClearLine) __P((int, int, int, int)); + int (*lf_LayRewrite) __P((int, int, int, struct mchar *, int)); + int (*lf_LayResize) __P((int, int)); + void (*lf_LayRestore) __P((void)); }; struct layer @@ -55,16 +55,16 @@ struct layer int l_blocking; }; -#define Process (*flayer->l_layfn->LayProcess) -#define Abort (*flayer->l_layfn->LayAbort) -#define RedisplayLine (*flayer->l_layfn->LayRedisplayLine) -#define ClearLine (*flayer->l_layfn->LayClearLine) -#define Rewrite (*flayer->l_layfn->LayRewrite) -#define Resize (*flayer->l_layfn->LayResize) -#define Restore (*flayer->l_layfn->LayRestore) +#define LayProcess (*flayer->l_layfn->lf_LayProcess) +#define LayAbort (*flayer->l_layfn->lf_LayAbort) +#define LayRedisplayLine (*flayer->l_layfn->lf_LayRedisplayLine) +#define LayClearLine (*flayer->l_layfn->lf_LayClearLine) +#define LayRewrite (*flayer->l_layfn->lf_LayRewrite) +#define LayResize (*flayer->l_layfn->lf_LayResize) +#define LayRestore (*flayer->l_layfn->lf_LayRestore) -#define SetCursor() LGotoPos(flayer, flayer->l_x, flayer->l_y) -#define CanResize(l) (l->l_layfn->LayResize != DefResize) +#define LaySetCursor() LGotoPos(flayer, flayer->l_x, flayer->l_y) +#define LayCanResize(l) (l->l_layfn->LayResize != DefResize) /* XXX: AArgh! think again! */ diff --git a/src/loadav.c b/src/loadav.c index 532ed35..11eb593 100644 --- a/src/loadav.c +++ b/src/loadav.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann diff --git a/src/logfile.c b/src/logfile.c index f2ae13c..dc50437 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann diff --git a/src/logfile.h b/src/logfile.h index 4c80e76..90170f7 100644 --- a/src/logfile.h +++ b/src/logfile.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -960,7 +960,7 @@ int *inlenp; } if (markdata->hist_offset != fore->w_histheight) { - LAY_CALL_UP(RedisplayLayer(flayer, 0)); + LAY_CALL_UP(LRefreshAll(flayer, 0)); } ExitOverlayPage(); if (append_mode) @@ -969,7 +969,7 @@ int *inlenp; else LMsg(0, "Copied %d characters into buffer", md_user->u_copylen); if (write_buffer) - WriteFile(DUMP_EXCHANGE); + WriteFile(md_user, DUMP_EXCHANGE); in_mark = 0; break; } @@ -1132,16 +1132,18 @@ int tx, ty, line; } else copy_mline2mchar(&mc, ml, x); - LPutChar(flayer, &mc, x, W2D(y)); #ifdef KANJI if (ml->font[x] == KANJI) { - x++; - mc.image = ml->image[x]; - LPutChar(flayer, &mc, x, W2D(y)); + mc.mbcs = ml->image[x + 1]; t++; } #endif + LPutChar(flayer, &mc, x, W2D(y)); +#ifdef KANJI + if (ml->font[x] == KANJI) + x++; +#endif } } LGotoPos(flayer, tx, W2D(ty)); @@ -1164,7 +1166,7 @@ MarkAbort() } if (markdata->hist_offset != fore->w_histheight) { - LAY_CALL_UP(RedisplayLayer(flayer, 0)); + LAY_CALL_UP(LRefreshAll(flayer, 0)); } else { @@ -1243,16 +1245,19 @@ int isblank; mchar_marked.font = ml->font[x]; #endif mchar_marked.image = ml->image[x]; - LPutChar(flayer, &mchar_marked, x, y); #ifdef KANJI + mchar_marked.mbcs = 0; if (ml->font[x] == KANJI) { - x++; - mchar_marked.image = ml->image[x]; - LPutChar(flayer, &mchar_marked, x, y); + mchar_marked.mbcs = ml->image[x + 1]; cp++; } #endif + LPutChar(flayer, &mchar_marked, x, y); +#ifdef KANJI + if (ml->font[x] == KANJI) + x++; +#endif } if (x <= xe) LCDisplayLine(flayer, ml, y, x, xe, isblank); @@ -1345,7 +1350,7 @@ int n; n = fore->w_histheight - markdata->hist_offset; markdata->hist_offset += n; i = (n < flayer->l_height) ? n : (flayer->l_height); - LScrollV(flayer, i, 0, flayer->l_height - 1); + LScrollV(flayer, i, 0, flayer->l_height - 1, 0); while (i-- > 0) MarkRedisplayLine(flayer->l_height - i - 1, 0, flayer->l_width - 1, 1); return n; @@ -1364,7 +1369,7 @@ int n; n = markdata->hist_offset; markdata->hist_offset -= n; i = (n < flayer->l_height) ? n : (flayer->l_height); - LScrollV(flayer, -i, 0, fore->w_height - 1); + LScrollV(flayer, -i, 0, fore->w_height - 1, 0); while (i-- > 0) MarkRedisplayLine(i, 0, flayer->l_width - 1, 1); return n; @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -170,7 +170,12 @@ char *nam; */ #ifdef POSIX -sigret_t (*xsignal(sig, func)) __P(SIGPROTOARG) +sigret_t (*xsignal(sig, func)) +# ifndef __APPLE__ + __P(SIGPROTOARG) +# else +() +# endif int sig; sigret_t (*func) __P(SIGPROTOARG); { diff --git a/src/nethack.c b/src/nethack.c index 75f35a9..641b6fa 100644 --- a/src/nethack.c +++ b/src/nethack.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -37,7 +37,7 @@ struct nlstrans { }; #ifdef NETHACK -struct nlstrans nethacktrans[] = { +static struct nlstrans nethacktrans[] = { {"Cannot lock terminal - fork failed", "Cannot fork terminal - lock failed"}, {"Got only %d bytes from %s", @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -75,7 +75,7 @@ extern int errno; #undef strerror #endif -#ifndef SYSV +#if !defined(SYSV) && !defined(linux) # ifdef NEWSOS # define strlen ___strlen___ # include <strings.h> diff --git a/src/osdef.h.in b/src/osdef.h.in index 2b93ae2..1f9120c 100644 --- a/src/osdef.h.in +++ b/src/osdef.h.in @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -195,3 +195,7 @@ extern int fstat __P((int, struct stat *)); extern int fchmod __P((int, int)); extern int fchown __P((int, int, int)); +#if defined(LOADAV) && defined(LOADAV_GETLOADAVG) +extern int getloadavg(double *, int); +#endif + diff --git a/src/osdef.sh b/src/osdef.sh index d92ade1..05fc22c 100644 --- a/src/osdef.sh +++ b/src/osdef.sh @@ -1,7 +1,7 @@ #! /bin/sh -if test -z "$CC"; then - CC=cc +if test -z "$CPP"; then + CPP="cc -E" fi if test -z "$srcdir"; then srcdir=. @@ -50,7 +50,7 @@ cat << EOF > osdef2.sed 1i\\ */ EOF -$CC -I. -I$srcdir -E osdef0.c | sed -n -f osdef1.sed >> osdef2.sed +$CPP -I. -I$srcdir osdef0.c | sed -n -f osdef1.sed >> osdef2.sed sed -f osdef2.sed < $srcdir/osdef.h.in > osdef.h rm osdef0.c osdef1.sed osdef2.sed diff --git a/src/patchlevel.h b/src/patchlevel.h index f3cca3c..1f1d12e 100644 --- a/src/patchlevel.h +++ b/src/patchlevel.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -423,8 +423,9 @@ * SCO-5 Fixes (Brian L. Gentry). * 25.11.98 -- 3.07.06 resize code now handles tabs correctly. * -- DISTRIBUTED - * -- 3.09.00 loads'o'bugs fixed, 3.8 merged with 3.7, new region - * clip code. Many new features (see NEWS file). + * -- 3.09.00 loads'o'bugs fixed, 3.8 merged with 3.7. + * new region clip code. + * Many new features (see NEWS file). * 3.08.99 -- 3.09.02 -- DISTRIBUTED * 11.08.99 -- 3.09.04 small utmp fix, BSD chflags fix, tty mode fix * -- DISTRIBUTED @@ -434,11 +435,22 @@ * console grabbing with SRIOCSREDIR. * linux utmp workaround added. Some KANJI bugs * fixed. Stupid StuffKey() bug fixed. + * -- DISTRIBUTED + * 24.07.00 -- 3.09.06 kanji fixes. lock escape char fix. + * removed delayed message hack. + * resize command & focus subcomands by joze. + * fix for solaris' utmp_helper bug. + * linux tty handling fix. + * mousetracking, rxvt osc sequences. + * background color erase support. + * don't log user in after hangup. + * hstatus escape update bug fixed. + * 1.09.00 -- 3.09.08 -- DISTRIBUTED */ #define ORIGIN "FAU" #define REV 3 #define VERS 9 -#define PATCHLEVEL 5 -#define DATE "1-Sep-99" +#define PATCHLEVEL 8 +#define DATE "1-Sep-00" #define STATE "" diff --git a/src/process.c b/src/process.c index 1c7e233..81dfcf5 100644 --- a/src/process.c +++ b/src/process.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -142,6 +142,8 @@ static void confirm_fn __P((char *, int, char *)); static int StuffKey __P((int)); #endif static int IsOnDisplay __P((struct win *)); +static void ResizeRegions __P((char*)); +static void ResizeFin __P((char *, int, char *)); extern struct layer *flayer; @@ -406,7 +408,17 @@ InitKeytab() ktab['H'].nr = RC_LOG; ktab['M'].nr = RC_MONITOR; ktab['?'].nr = RC_HELP; +#ifdef MULTI ktab['*'].nr = RC_DISPLAYS; +#endif + { + char *args[2]; + args[0] = "-"; + args[1] = NULL; + + ktab['-'].nr = RC_SELECT; + ktab['-'].args = SaveArgs(args); + } for (i = 0; i < ((MAXWIN < 10) ? MAXWIN : 10); i++) { char *args[2], arg1[10]; @@ -416,6 +428,7 @@ InitKeytab() ktab['0' + i].nr = RC_SELECT; ktab['0' + i].args = SaveArgs(args); } + ktab['\''].nr = ktab['"'].nr = RC_SELECT; /* calling a window by name */ ktab[Ctrl('G')].nr = RC_VBELL; ktab[':'].nr = RC_COLON; #ifdef COPY_PASTE @@ -433,7 +446,6 @@ InitKeytab() ktab['>'].nr = RC_WRITEBUF; ktab['<'].nr = RC_READBUF; ktab['='].nr = RC_REMOVEBUF; - ktab['\''].nr = ktab['"'].nr = RC_SELECT; /* calling a window by name */ #endif #ifdef POW_DETACH ktab['D'].nr = RC_POW_DETACH; @@ -449,19 +461,17 @@ InitKeytab() ktab['X'].nr = RC_REMOVE; ktab['F'].nr = RC_FIT; ktab['\t'].nr = RC_FOCUS; - { - char *args[2]; - args[0] = "-"; - args[1] = NULL; - - ktab['-'].nr = RC_SELECT; - ktab['-'].args = SaveArgs(args); - } /* These come last; they may want overwrite others: */ if (DefaultEsc >= 0) - ktab[DefaultEsc].nr = RC_OTHER; + { + ClearAction(&ktab[DefaultEsc]); + ktab[DefaultEsc].nr = RC_OTHER; + } if (DefaultMetaEsc >= 0) - ktab[DefaultMetaEsc].nr = RC_META; + { + ClearAction(&ktab[DefaultMetaEsc]); + ktab[DefaultMetaEsc].nr = RC_META; + } } static void @@ -609,6 +619,7 @@ int ilen; debug1("ProcessInput2: %d bytes\n", ilen); while (ilen && display) { + debug1(" - ilen now %d bytes\n", ilen); flayer = D_forecv->c_layer; fore = D_fore; slen = ilen; @@ -682,7 +693,7 @@ struct paster *pa; while (flayer && *lenp) { oldlen = *lenp; - Process(bufp, lenp); + LayProcess(bufp, lenp); #ifdef COPY_PASTE if (pa && !pa->pa_pastelayer) break; /* flush rest of paste */ @@ -843,7 +854,10 @@ int key; int argc, i, n, msgok; char *s; char ch; + struct display *odisplay = display; + struct user *user; + user = display ? D_user : users; if (nr == RC_ILLEGAL) { debug1("key '%c': No action\n", key); @@ -860,6 +874,11 @@ int key; Msg(0, "%s: %s: window required", rc_name, comms[nr].name); return; } + if ((n & NEED_LAYER) && flayer == 0) + { + Msg(0, "%s: %s: display or window required", rc_name, comms[nr].name); + return; + } if ((argc = CheckArgNum(nr, args)) < 0) return; #ifdef MULTIUSER @@ -917,10 +936,10 @@ int key; D_obuflenmax = D_obuflen - D_obufmax; break; case RC_DUMPTERMCAP: - WriteFile(DUMP_TERMCAP); + WriteFile(user, DUMP_TERMCAP); break; case RC_HARDCOPY: - WriteFile(DUMP_HARDCOPY); + WriteFile(user, DUMP_HARDCOPY); break; case RC_LOG: n = fore->w_log ? 1 : 0; @@ -946,7 +965,11 @@ int key; if (key >= 0) { +#ifdef PSEUDOS Input(fore->w_pwin ? "Really kill this filter [y/n]" : "Really kill this window [y/n]", 1, INP_RAW, confirm_fn, (char *)RC_KILL); +#else + Input("Really kill this window [y/n]", 1, INP_RAW, confirm_fn, (char *)RC_KILL); +#endif break; } n = fore->w_number; @@ -1299,13 +1322,13 @@ int key; if (StuffKey(i - T_CAPS) == 0) break; #endif - s = D_tcs[i].str; + s = display ? D_tcs[i].str : 0; if (s == 0) break; } n = strlen(s); while(n) - Process(&s, &n); + LayProcess(&s, &n); break; case RC_REDISPLAY: Activate(-1); @@ -1332,27 +1355,27 @@ int key; /* FALLTHROUGH */ case RC_OTHER: if (MoreWindows()) - SwitchWindow(D_other ? D_other->w_number : NextWindow()); + SwitchWindow(display && D_other ? D_other->w_number : NextWindow()); break; case RC_META: - if (D_user->u_Esc == -1) + if (user->u_Esc == -1) break; - ch = D_user->u_Esc; + ch = user->u_Esc; s = &ch; n = 1; - Process(&s, &n); + LayProcess(&s, &n); break; case RC_XON: ch = Ctrl('q'); s = &ch; n = 1; - Process(&s, &n); + LayProcess(&s, &n); break; case RC_XOFF: ch = Ctrl('s'); s = &ch; n = 1; - Process(&s, &n); + LayProcess(&s, &n); break; case RC_DEFBREAKTYPE: case RC_BREAKTYPE: @@ -1486,7 +1509,7 @@ int key; { s = *args; n = strlen(s); - Process(&s, &n); + LayProcess(&s, &n); } break; case RC_LASTMSG: @@ -1586,8 +1609,7 @@ int key; #endif if (fore->w_monitor == MON_OFF) fore->w_monitor = MON_ON; - Msg(0, "Window %d (%s) is now being monitored for all activity.", - fore->w_number, fore->w_title); + Msg(0, "Window %d (%s) is now being monitored for all activity.", fore->w_number, fore->w_title); } else { @@ -1604,13 +1626,14 @@ int key; if (i < 0) #endif fore->w_monitor = MON_OFF; - Msg(0, "Window %d (%s) is no longer being monitored for activity.", - fore->w_number, fore->w_title); + Msg(0, "Window %d (%s) is no longer being monitored for activity.", fore->w_number, fore->w_title); } break; +#ifdef MULTI case RC_DISPLAYS: display_displays(); break; +#endif case RC_HELP: display_help(); break; @@ -1637,7 +1660,7 @@ int key; } if (GetHistory() == 0) break; - if (D_user->u_copybuffer == NULL) + if (user->u_copybuffer == NULL) break; args = pasteargs; } @@ -1673,7 +1696,7 @@ int key; if (ch == '.') { if (display) - l += D_user->u_copylen; + l += user->u_copylen; } else l += plop_tab[(int)(unsigned char)ch].len; @@ -1691,7 +1714,7 @@ int key; if (s[1] == 0 && args[1] == 0) { if (fore) - MakePaster(&fore->w_paster, *s == '.' ? D_user->u_copybuffer : plop_tab[(int)(unsigned char)*s].buf, l, 0); + MakePaster(&fore->w_paster, *s == '.' ? user->u_copybuffer : plop_tab[(int)(unsigned char)*s].buf, l, 0); break; } /* @@ -1713,8 +1736,8 @@ int key; { if (display == 0) continue; - bcopy(D_user->u_copybuffer, dbuf + l, D_user->u_copylen); - l += D_user->u_copylen; + bcopy(user->u_copybuffer, dbuf + l, user->u_copylen); + l += user->u_copylen; } else { @@ -1747,10 +1770,10 @@ int key; free(dbuf); break; } - if (D_user->u_copybuffer != NULL) - UserFreeCopyBuffer(D_user); - D_user->u_copybuffer = dbuf; - D_user->u_copylen = l; + if (user->u_copybuffer != NULL) + UserFreeCopyBuffer(user); + user->u_copybuffer = dbuf; + user->u_copylen = l; } else { @@ -1765,20 +1788,20 @@ int key; break; } case RC_WRITEBUF: - if (D_user->u_copybuffer == NULL) + if (user->u_copybuffer == NULL) { Msg(0, "empty buffer"); break; } - WriteFile(DUMP_EXCHANGE); + WriteFile(user, DUMP_EXCHANGE); break; case RC_READBUF: if ((s = ReadFile(BufferFile, &n))) { - if (D_user->u_copybuffer) - UserFreeCopyBuffer(D_user); - D_user->u_copylen = n; - D_user->u_copybuffer = s; + if (user->u_copybuffer) + UserFreeCopyBuffer(user); + user->u_copylen = n; + user->u_copybuffer = s; } break; case RC_REMOVEBUF: @@ -1786,7 +1809,7 @@ int key; break; #endif /* COPY_PASTE */ case RC_ESCAPE: - if (ParseEscape(display ? D_user : users, *args)) + if (ParseEscape(user, *args)) { Msg(0, "%s: two characters required after escape.", rc_name); break; @@ -1794,7 +1817,7 @@ int key; /* Change defescape if master user. This is because we only * have one ktab. */ - if (display && D_user != users) + if (display && user != users) break; /* FALLTHROUGH */ case RC_DEFESCAPE: @@ -1818,7 +1841,10 @@ int key; ShellArgs[0] = ShellProg; break; case RC_HARDCOPYDIR: - (void)ParseSaveStr(act, &hardcopydir); + if (*args) + (void)ParseSaveStr(act, &hardcopydir); + if (msgok) + Msg(0, "hardcopydir is %s\n", hardcopydir && *hardcopydir ? hardcopydir : "<cwd>"); break; case RC_LOGFILE: if (*args) @@ -1871,7 +1897,7 @@ int key; case RC_TERMCAP: case RC_TERMCAPINFO: case RC_TERMINFO: - if (!rc_name || rc_name == "") + if (!rc_name || !*rc_name) Msg(0, "Sorry, too late now. Place that in your .screenrc file."); break; case RC_SLEEP: @@ -1882,7 +1908,7 @@ int key; break; if (strlen(s) >= 20) { - Msg(0,"%s: term: argument too long ( < 20)", rc_name); + Msg(0, "%s: term: argument too long ( < 20)", rc_name); free(s); break; } @@ -1896,7 +1922,7 @@ int key; if (!msgok) break; /* - * D_user typed ^A:echo... well, echo isn't FinishRc's job, + * user typed ^A:echo... well, echo isn't FinishRc's job, * but as he wanted to test us, we show good will */ if (*args && (args[1] == 0 || (strcmp(args[1], "-n") == 0 && args[2] == 0))) @@ -1980,6 +2006,11 @@ int key; case RC_DEFC1: (void)ParseOnOff(act, &nwin_default.c1); break; +#ifdef COLOR + case RC_DEFBCE: + (void)ParseOnOff(act, &nwin_default.bce); + break; +#endif case RC_DEFGR: (void)ParseOnOff(act, &nwin_default.gr); break; @@ -2389,17 +2420,15 @@ int key; case RC_PASSWORD: if (*args) { - struct user *u = display ? D_user : users; - - n = (*u->u_password) ? 1 : 0; - if (u->u_password != NullStr) free((char *)u->u_password); - u->u_password = SaveStr(*args); - if (!strcmp(u->u_password, "none")) + n = (*user->u_password) ? 1 : 0; + if (user->u_password != NullStr) free((char *)user->u_password); + user->u_password = SaveStr(*args); + if (!strcmp(user->u_password, "none")) { if (n) Msg(0, "Password checking disabled"); - free(u->u_password); - u->u_password = NullStr; + free(user->u_password); + user->u_password = NullStr; } } else @@ -2409,7 +2438,7 @@ int key; Msg(0, "%s: password: window required", rc_name); break; } - Input("New screen password:", 100, INP_NOECHO, pass1, (char *)D_user); + Input("New screen password:", 100, INP_NOECHO, pass1, display ? (char *)D_user : (char *)users); } break; #endif /* PASSWORD */ @@ -2421,7 +2450,6 @@ int key; break; } n = (unsigned char)ch; - ClearAction(&ktab[n]); if (args[1]) { if ((i = FindCommnr(args[1])) == RC_ILLEGAL) @@ -2431,10 +2459,13 @@ int key; } if (CheckArgNum(i, args + 2) < 0) break; + ClearAction(&ktab[n]); ktab[n].nr = i; if (args[2]) ktab[n].args = SaveArgs(args + 2); } + else + ClearAction(&ktab[n]); break; #ifdef MAPKEYS case RC_BINDKEY: @@ -2527,7 +2558,6 @@ int key; i -= T_CAPS; } newact = df ? &dmtab[i] : mf ? &mmtab[i] : &umtab[i]; - ClearAction(newact); if (args[1]) { if ((newnr = FindCommnr(args[1])) == RC_ILLEGAL) @@ -2537,6 +2567,7 @@ int key; } if (CheckArgNum(newnr, args + 2) < 0) break; + ClearAction(newact); newact->nr = newnr; if (args[2]) newact->args = SaveArgs(args + 2); @@ -2548,6 +2579,8 @@ int key; kmap_extras_fl[i - (KMAP_KEYS+KMAP_AKEYS)] = fl; } } + else + ClearAction(newact); for (display = displays; display; display = display->d_next) remap(i, args[1] ? 1 : 0); if (kf == 0 && !args[1]) @@ -2695,6 +2728,12 @@ int key; if (ParseSwitch(act, &fore->w_c1) == 0 && msgok) Msg(0, "Will %suse C1", fore->w_c1 ? "" : "not "); break; +#ifdef COLOR + case RC_BCE: + if (ParseSwitch(act, &fore->w_bce) == 0 && msgok) + Msg(0, "Will %serase with background color", fore->w_bce ? "" : "not "); + break; +#endif #ifdef KANJI case RC_KANJI: for (i = 0; i < 2; i++) @@ -2761,7 +2800,7 @@ int key; { s = *args; n = strlen(s); - Process(&s, &n); + LayProcess(&s, &n); } break; @@ -2896,19 +2935,55 @@ int key; D_forecv->c_yoff = D_forecv->c_ys; RethinkViewportOffsets(D_forecv); ResizeLayer(D_forecv->c_layer, D_forecv->c_xe - D_forecv->c_xs + 1, D_forecv->c_ye - D_forecv->c_ys + 1, 0); - /* XXX: only on canvas? */ flayer = D_forecv->c_layer; - SetCursor(); + LaySetCursor(); break; case RC_FOCUS: - D_forecv = D_forecv->c_next ? D_forecv->c_next : D_cvlist; + if (!*args || !strcmp(*args, "down")) + D_forecv = D_forecv->c_next ? D_forecv->c_next : D_cvlist; + else if (!strcmp(*args, "up")) + { + struct canvas *cv; + for (cv = D_cvlist; cv->c_next && cv->c_next != D_forecv; cv = cv->c_next) + ; + D_forecv = cv; + } + else if (!strcmp(*args, "top")) + D_forecv = D_cvlist; + else if (!strcmp(*args, "bottom")) + { + struct canvas *cv; + for (cv = D_cvlist; cv->c_next; cv = cv->c_next) + ; + D_forecv = cv; + } + else + { + Msg(0, "%s: usage: focus [up|down|top|bottom]", rc_name); + break; + } D_fore = Layer2Window(D_forecv->c_layer); fore = D_fore; + flayer = D_forecv->c_layer; +#ifdef RXVT_OSC + if (D_xtermosc[2] || D_xtermosc[3]) + { + Activate(-1); + break; + } +#endif RefreshHStatus(); - /* XXX: only on canvas? */ +#ifdef RXVT_OSC + RefreshXtermOSC(); +#endif flayer = D_forecv->c_layer; - Restore(); - SetCursor(); + CV_CALL(D_forecv, LayRestore();LaySetCursor()); + break; + case RC_RESIZE: + if (*args) + ResizeRegions(*args); + else + Input("resize # lines: ", 20, INP_COOKED, ResizeFin, (char*)0); break; default: #ifdef HAVE_BRAILLE @@ -2917,6 +2992,12 @@ int key; #endif break; } + if (display != odisplay) + { + for (display = displays; display; display = display->d_next) + if (display == odisplay) + break; + } } void @@ -3041,15 +3122,6 @@ char *buf, **args; } } -/* - * buf is split into argument vector args. - * leading whitespace is removed. - * @!| abbreviations are expanded. - * the end of buffer is recognized by '\0' or an un-escaped '#'. - * " and ' are interpreted. - * - * argc is returned. - */ int ParseEscape(u, p) struct user *u; @@ -3314,7 +3386,7 @@ char *p, *cp; { if (*p == 0) return 0; - if (*p == '^') + if (*p == '^' && p[1]) { if (*++p == '?') *cp = '\177'; @@ -3603,7 +3675,7 @@ MoreWindows() Msg(0, "No window available"); return 0; } - Msg(0, "No other window.", fore->w_number); /* other arg for nethack */ + Msg(0, "No other window."+1-1, fore->w_number); /* other arg for nethack */ return 0; } @@ -3860,16 +3932,21 @@ ShowInfo() #ifdef COPY_PASTE sprintf(p += strlen(p), "+%d", wp->w_histheight); #endif - sprintf(p += strlen(p), " %c%sflow %cwrap", + sprintf(p += strlen(p), " %c%sflow", (wp->w_flow & FLOW_NOW) ? '+' : '-', (wp->w_flow & FLOW_AUTOFLAG) ? "" : - ((wp->w_flow & FLOW_AUTO) ? "(+)" : "(-)"), - wp->w_wrap ? '+' : '-'); + ((wp->w_flow & FLOW_AUTO) ? "(+)" : "(-)")); + if (!wp->w_wrap) sprintf(p += strlen(p), " -wrap"); if (wp->w_insert) sprintf(p += strlen(p), " ins"); if (wp->w_origin) sprintf(p += strlen(p), " org"); if (wp->w_keypad) sprintf(p += strlen(p), " app"); if (wp->w_log) sprintf(p += strlen(p), " log"); if (wp->w_monitor != MON_OFF) sprintf(p += strlen(p), " mon"); + if (wp->w_mouse) sprintf(p += strlen(p), " mouse"); +#ifdef COLOR + if (wp->w_bce) sprintf(p += strlen(p), " bce"); +#endif + if (!wp->w_c1) sprintf(p += strlen(p), " -c1"); if (wp->w_norefresh) sprintf(p += strlen(p), " nored"); p += strlen(p); @@ -3877,10 +3954,10 @@ ShowInfo() if (D_CC0 || (D_CS0 && *D_CS0)) { if (wp->w_gr) - sprintf(p++, " G%c%c [", wp->w_Charset + '0', wp->w_CharsetR + '0'); + sprintf(p++, " G%c%c[", wp->w_Charset + '0', wp->w_CharsetR + '0'); else - sprintf(p, " G%c [", wp->w_Charset + '0'); - p += 5; + sprintf(p, " G%c[", wp->w_Charset + '0'); + p += 4; for (i = 0; i < 4; i++) { if (wp->w_charsets[i] == ASCII) @@ -3932,7 +4009,20 @@ char *data; /* dummy */ static void InputAKA() { + char *s, *ss; + int n; Input("Set window's title to: ", 20, INP_COOKED, AKAfin, NULL); + s = fore->w_title; + if (!s) + return; + for (; *s; s++) + { + if ((*(unsigned char *)s & 0x7f) < 0x20 || *s == 0x7f) + continue; + ss = s; + n = 1; + LayProcess(&ss, &n); + } } static void @@ -4294,20 +4384,6 @@ char *data; /* dummy */ } static void -quit_fn(buf, len, data) -char *buf; -int len; -char *data; /* dummy */ -{ - if (len || (*buf != 'y' && *buf != 'Y')) - { - *buf = 0; - return; - } - Finit(0); -} - -static void confirm_fn(buf, len, data) char *buf; int len; @@ -4519,7 +4595,7 @@ char *data; /* dummy */ i = 1; *buf = x; while(i) - Process(&buf, &i); + LayProcess(&buf, &i); } #ifdef MAPKEYS @@ -4689,3 +4765,130 @@ char *str; #endif +static void +ResizeRegions(arg) +char *arg; +{ + struct canvas *cv; + int nreg, dsize, diff, siz; + + ASSERT(display); + for (nreg = 0, cv = D_cvlist; cv; cv = cv->c_next) + nreg++; + if (nreg < 2) + { + Msg(0, "resize: need more than one region"); + return; + } + dsize = D_height - (D_has_hstatus == HSTATUS_LASTLINE); + if (*arg == '=') + { + /* make all regions the same height */ + int h = dsize; + int hh, i = 0; + for (cv = D_cvlist; cv; cv = cv->c_next) + { + hh = h / nreg-- - 1; + cv->c_ys = i; + cv->c_ye = i + hh - 1; + cv->c_yoff = i; + i += hh + 1; + h -= hh + 1; + } + RethinkDisplayViewports(); + ResizeLayersToCanvases(); + return; + } + siz = D_forecv->c_ye - D_forecv->c_ys + 1; + if (*arg == '+') + diff = atoi(arg + 1); + else if (*arg == '-') + diff = -atoi(arg + 1); + else if (!strcmp(arg, "min")) + diff = 1 - siz; + else if (!strcmp(arg, "max")) + diff = dsize - (nreg - 1) * 2 - 1 - siz; + else + diff = atoi(arg) - siz; + if (diff == 0) + return; + if (siz + diff < 1) + diff = 1 - siz; + if (siz + diff > dsize - (nreg - 1) * 2 - 1) + diff = dsize - (nreg - 1) * 2 - 1 - siz; + if (diff == 0 || siz + diff < 1) + return; + + if (diff < 0) + { + if (D_forecv->c_next) + { + D_forecv->c_ye += diff; + D_forecv->c_next->c_ys += diff; + D_forecv->c_next->c_yoff += diff; + } + else + { + for (cv = D_cvlist; cv; cv = cv->c_next) + if (cv->c_next == D_forecv) + break; + ASSERT(cv); + cv->c_ye -= diff; + D_forecv->c_ys -= diff; + D_forecv->c_yoff -= diff; + } + } + else + { + int s, i = 0, found = 0, di = diff, d2; + s = dsize - (nreg - 1) * 2 - 1 - siz; + for (cv = D_cvlist; cv; i = cv->c_ye + 2, cv = cv->c_next) + { + if (cv == D_forecv) + { + cv->c_ye = i + (cv->c_ye - cv->c_ys) + diff; + cv->c_yoff -= cv->c_ys - i; + cv->c_ys = i; + found = 1; + continue; + } + s -= cv->c_ye - cv->c_ys; + if (!found) + { + if (s >= di) + continue; + d2 = di - s; + } + else + d2 = di > cv->c_ye - cv->c_ys ? cv->c_ye - cv->c_ys : di; + di -= d2; + cv->c_ye = i + (cv->c_ye - cv->c_ys) - d2; + cv->c_yoff -= cv->c_ys - i; + cv->c_ys = i; + } + } + RethinkDisplayViewports(); + ResizeLayersToCanvases(); +} + +static void +ResizeFin(buf, len, data) +char *buf; +int len; +char *data; +{ + ResizeRegions(buf); +} + +#ifdef RXVT_OSC +void +RefreshXtermOSC() +{ + int i; + struct win *p; + + p = Layer2Window(D_forecv->c_layer); + for (i = 3; i >=0; i--) + SetXtermOSC(i, p ? p->w_xtermosc[i] : 0); +} +#endif @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -121,19 +121,19 @@ int f; } void -InitPty(f) +InitPTY(f) int f; { if (f < 0) return; #if defined(I_PUSH) && defined(HAVE_SVR4_PTYS) && !defined(sgi) && !defined(linux) && !defined(__osf__) && !defined(M_UNIX) if (ioctl(f, I_PUSH, "ptem")) - Panic(errno, "InitPty: cannot I_PUSH ptem"); + Panic(errno, "InitPTY: cannot I_PUSH ptem"); if (ioctl(f, I_PUSH, "ldterm")) - Panic(errno, "InitPty: cannot I_PUSH ldterm"); + Panic(errno, "InitPTY: cannot I_PUSH ldterm"); # ifdef sun if (ioctl(f, I_PUSH, "ttcompat")) - Panic(errno, "InitPty: cannot I_PUSH ttcompat"); + Panic(errno, "InitPTY: cannot I_PUSH ttcompat"); # endif #endif } diff --git a/src/putenv.c b/src/putenv.c index 4756459..bab7e20 100644 --- a/src/putenv.c +++ b/src/putenv.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann diff --git a/src/resize.c b/src/resize.c index 8d9ef8c..87b9dbe 100644 --- a/src/resize.c +++ b/src/resize.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -128,8 +128,11 @@ int change_flag; return; } ChangeScreenSize(wi, he, change_flag); +/* XXX Redisplay logic */ +#if 0 if (change_flag == 1) Redisplay(D_fore ? D_fore->w_norefresh : 0); +#endif } void @@ -246,6 +249,7 @@ ResizeLayersToCanvases() int lx, ly; debug("ResizeLayersToCanvases\n"); + D_kaablamm = 0; for (cv = D_cvlist; cv; cv = cv->c_next) { l = cv->c_layer; @@ -303,6 +307,11 @@ ResizeLayersToCanvases() } } Redisplay(0); + if (D_kaablamm) + { + kaablamm(); + D_kaablamm = 0; + } } int @@ -334,7 +343,6 @@ struct layer *l; static void kaablamm() { - /* this only works because of the status_delayed hack... */ Msg(0, "Aborted because of window size change."); } @@ -366,7 +374,7 @@ struct display *norefdisp; { flayer = cv->c_layer; if (flayer->l_next) - kaablamm(); + d->d_kaablamm = 1; while(flayer->l_next) ExitOverlayPage(); } @@ -374,13 +382,13 @@ struct display *norefdisp; l = p->w_savelayer; } flayer = l; - if (flayer->l_next) - kaablamm(); + if (flayer->l_next && display) + D_kaablamm = 1; while(flayer->l_next) ExitOverlayPage(); if (p) flayer = &p->w_layer; - Resize(wi, he); + LayResize(wi, he); /* now everybody is on flayer, redisplay */ l = flayer; for (display = displays; display; display = display->d_next) @@ -390,6 +398,11 @@ struct display *norefdisp; for (cv = D_cvlist; cv; cv = cv->c_next) if (cv->c_layer == l) RefreshArea(cv->c_xs, cv->c_ys, cv->c_xe, cv->c_ye, 0); + if (D_kaablamm) + { + kaablamm(); + D_kaablamm = 0; + } } flayer = oldflayer; display = olddisplay; diff --git a/src/sched.c b/src/sched.c index c45f08e..eaf845e 100644 --- a/src/sched.c +++ b/src/sched.c @@ -1,3 +1,30 @@ +/* Copyright (c) 1993-2000 + * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) + * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) + * Copyright (c) 1987 Oliver Laumann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, write to the + * Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + **************************************************************** + */ + +#include "rcs.h" +RCS_ID("$Id$ FAU") + + #include <sys/types.h> #if !defined(sun) && !defined(B43) && !defined(ISC) && !defined(pyr) && !defined(_CX_UX) # include <time.h> diff --git a/src/sched.h b/src/sched.h index 853cee0..dc44aef 100644 --- a/src/sched.h +++ b/src/sched.h @@ -1,3 +1,26 @@ +/* Copyright (c) 1993-2000 + * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) + * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) + * Copyright (c) 1987 Oliver Laumann + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program (see the file COPYING); if not, write to the + * Free Software Foundation, Inc., + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + * + **************************************************************** + * $Id$ FAU + */ struct event { diff --git a/src/screen.c b/src/screen.c index a410288..b201e26 100644 --- a/src/screen.c +++ b/src/screen.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -105,10 +105,9 @@ FILE *dfp; extern char *blank, *null, Term[], screenterm[], **environ, Termcap[]; -int force_vt = 1, assume_LP = 0; +int force_vt = 1; int VBellWait, MsgWait, MsgMinWait, SilenceWait; -extern struct plop plop_tab[]; extern struct user *users; extern struct display *displays, *display; @@ -281,7 +280,7 @@ pw_try_again: for (; n < 13; n++) { char c = ppp->pw_passwd[n]; - if (!(c == '.' || c == '/' || + if (!(c == '.' || c == '/' || c == '$' || (c >= '0' && c <= '9') || (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'))) @@ -517,7 +516,7 @@ char **av; } if (ParseEscape(NULL, ap)) Panic(0, "Two characters are required with -e option, not '%s'.", ap); - ap += 3; /* estimated size of notation */ + ap = NULL; break; case 'f': ap++; @@ -908,7 +907,7 @@ char **av; #else 0777; #endif - if (mkdir(SockDir, eff_uid ? 0777 : 0755) == -1) + if (mkdir(SockDir, n) == -1) Panic(errno, "Cannot make directory '%s'", SockDir); } else @@ -917,7 +916,7 @@ char **av; Panic(0, "'%s' must be a directory.", SockDir); if (eff_uid == 0 && real_uid && st.st_uid != eff_uid) Panic(0, "Directory '%s' must be owned by root.", SockDir); - n = (eff_uid == 0 && (real_uid || (st.st_mode & 0777) != 0777)) ? 0755 : + n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 : (eff_gid == st.st_gid && eff_gid != real_gid) ? 0775 : 0777; if ((st.st_mode & 0777) != n) @@ -1026,11 +1025,6 @@ char **av; } nwin_compose(&nwin_default, &nwin_options, &nwin_default); - if (DefaultEsc == -1) - DefaultEsc = Ctrl('a'); - if (DefaultMetaEsc == -1) - DefaultMetaEsc = 'a'; - if (!detached || dflag != 2) MasterPid = fork(); else @@ -1041,16 +1035,9 @@ char **av; case -1: Panic(errno, "fork"); /* NOTREACHED */ -#ifdef FORKDEBUG - default: - break; - case 0: - MasterPid = getppid(); -#else case 0: break; default: -#endif if (detached) exit(0); if (SockMatch) @@ -1073,6 +1060,11 @@ char **av; /* NOTREACHED */ } + if (DefaultEsc == -1) + DefaultEsc = Ctrl('a'); + if (DefaultMetaEsc == -1) + DefaultMetaEsc = 'a'; + ap = av0 + strlen(av0) - 1; while (ap >= av0) { @@ -1125,11 +1117,7 @@ char **av; Panic(0, "Could not create user info"); if (!detached) { -#ifdef FORKDEBUG - if (MakeDisplay(LoginName, attach_tty, attach_term, n, MasterPid, &attach_Mode) == 0) -#else if (MakeDisplay(LoginName, attach_tty, attach_term, n, getppid(), &attach_Mode) == 0) -#endif Panic(0, "Could not alloc display"); } @@ -1357,7 +1345,7 @@ SigHup SIGDEFARG D_userfd = -1; } if (auto_detach || displays->d_next) - Detach(D_DETACH); + Detach(D_HANGUP); else Finit(0); SIGRETURN; @@ -1591,6 +1579,7 @@ int e; /* * Detach now has the following modes: *D_DETACH SIG_BYE detach backend and exit attacher + *D_HANGUP SIG_BYE detach backend and exit attacher *D_STOP SIG_STOP stop attacher (and detach backend) *D_REMOTE SIG_BYE remote detach -- reattach to new attacher *D_POWER SIG_POWER_BYE power detach -- attacher kills his parent @@ -1618,6 +1607,9 @@ int mode; FinitTerm(); switch (mode) { + case D_HANGUP: + sign = SIG_BYE; + break; case D_DETACH: AddStr("[detached]\r\n"); sign = SIG_BYE; @@ -1656,7 +1648,7 @@ int mode; #endif #endif case D_LOCK: - ClearDisplay(); + ClearAll(); sign = SIG_LOCK; /* tell attacher to lock terminal with a lockprg. */ break; @@ -1677,7 +1669,8 @@ int mode; } } } - RestoreLoginSlot(); + if (mode != D_HANGUP) + RestoreLoginSlot(); #endif if (displays->d_next == 0 && console_window) { @@ -2003,7 +1996,10 @@ struct event *ev; if (l < 4) break; if (tm == 0) - tm = localtime(&now.tv_sec); + { + time_t nowsec = now.tv_sec; + tm = localtime(&nowsec); + } qmflag = 1; switch (*s) { @@ -2281,15 +2277,6 @@ char *data; InterruptPlease = 0; } - for (display = displays; display; display = display->d_next) - { - if (D_status_delayed > 0) - { - D_status_delayed = -1; - MakeStatus(D_status_lastmsg); - } - } - for (p = windows; p; p = p->w_next) { if (p->w_bell == BELL_FOUND || p->w_bell == BELL_VISUAL) @@ -2305,13 +2292,11 @@ char *data; if (cv == 0) { p->w_bell = BELL_DONE; - D_status_delayed = -1; Msg(0, "%s", MakeWinMsg(BellString, p, '%')); } else if (visual && !D_VB && (!D_status || !D_status_bell)) { - D_status_delayed = -1; - Msg(0, VisualBellString); + Msg(0, "%s", VisualBellString); if (D_status) { D_status_bell = 1; @@ -2339,7 +2324,6 @@ char *data; if (!(ACLBYTE(p->w_mon_notify, D_user->u_id) & ACLBIT(D_user->u_id))) continue; /* user doesn't care */ #endif - D_status_delayed = -1; Msg(0, "%s", MakeWinMsg(ActivityString, p, '%')); p->w_monitor = MON_DONE; } @@ -2369,12 +2353,12 @@ char *data; if (n > cv->c_layer->l_height) n = cv->c_layer->l_height; CV_CALL(cv, - LScrollV(flayer, -n, 0, flayer->l_height - 1); - RedisplayLine(-1, -1, -1, 1); + LScrollV(flayer, -n, 0, flayer->l_height - 1, 0); + LayRedisplayLine(-1, -1, -1, 1); for (i = 0; i < n; i++) - RedisplayLine(i, 0, flayer->l_width - 1, 1); + LayRedisplayLine(i, 0, flayer->l_width - 1, 1); if (cv == cv->c_display->d_forecv) - SetCursor(); + LaySetCursor(); ); } else if (ly + cv->c_yoff > cv->c_ye) @@ -2385,12 +2369,12 @@ char *data; if (n > cv->c_layer->l_height) n = cv->c_layer->l_height; CV_CALL(cv, - LScrollV(flayer, n, 0, cv->c_layer->l_height - 1); - RedisplayLine(-1, -1, -1, 1); + LScrollV(flayer, n, 0, cv->c_layer->l_height - 1, 0); + LayRedisplayLine(-1, -1, -1, 1); for (i = 0; i < n; i++) - RedisplayLine(i + flayer->l_height - n, 0, flayer->l_width - 1, 1); + LayRedisplayLine(i + flayer->l_height - n, 0, flayer->l_width - 1, 1); if (cv == cv->c_display->d_forecv) - SetCursor(); + LaySetCursor(); ); } if (lx + cv->c_xoff < cv->c_xs) @@ -2405,14 +2389,14 @@ char *data; if (n > cv->c_layer->l_width) n = cv->c_layer->l_width; CV_CALL(cv, - RedisplayLine(-1, -1, -1, 1); + LayRedisplayLine(-1, -1, -1, 1); for (i = 0; i < flayer->l_height; i++) { - LScrollH(flayer, -n, i, 0, flayer->l_width - 1, 0); - RedisplayLine(i, 0, n - 1, 1); + LScrollH(flayer, -n, i, 0, flayer->l_width - 1, 0, 0); + LayRedisplayLine(i, 0, n - 1, 1); } if (cv == cv->c_display->d_forecv) - SetCursor(); + LaySetCursor(); ); } else if (lx + cv->c_xoff > cv->c_xe) @@ -2427,14 +2411,14 @@ char *data; if (n > cv->c_layer->l_width) n = cv->c_layer->l_width; CV_CALL(cv, - RedisplayLine(-1, -1, -1, 1); + LayRedisplayLine(-1, -1, -1, 1); for (i = 0; i < flayer->l_height; i++) { - LScrollH(flayer, n, i, 0, flayer->l_width - 1, 0); - RedisplayLine(i, flayer->l_width - n, flayer->l_width - 1, 1); + LScrollH(flayer, n, i, 0, flayer->l_width - 1, 0, 0); + LayRedisplayLine(i, flayer->l_width - n, flayer->l_width - 1, 1); } if (cv == cv->c_display->d_forecv) - SetCursor(); + LaySetCursor(); ); } } @@ -2445,7 +2429,7 @@ char *data; if (D_status == STATUS_ON_WIN || D_cvlist == 0 || D_cvlist->c_next == 0) continue; debug1("serv_select_fn: Restore on cv %#x\n", (int)D_forecv); - CV_CALL(D_forecv, Restore();SetCursor()); + CV_CALL(D_forecv, LayRestore();LaySetCursor()); } } diff --git a/src/screen.h b/src/screen.h index c0ced28..a111320 100644 --- a/src/screen.h +++ b/src/screen.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -131,11 +131,11 @@ struct mode int m_ldisc; int m_lmode; # endif /* TERMIO */ +#endif /* POSIX */ #if defined(KANJI) && defined(TIOCKSET) struct jtchars m_jtchars; int m_knjmode; -# endif -#endif /* POSIX */ +#endif }; @@ -153,6 +153,7 @@ struct mode #define D_POWER 3 #define D_REMOTE_POWER 4 #define D_LOCK 5 +#define D_HANGUP 6 /* * Here are the messages the attacher sends to the backend diff --git a/src/search.c b/src/search.c index ab80d92..154fc0f 100644 --- a/src/search.c +++ b/src/search.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -289,7 +289,7 @@ char *data; /* dummy */ y = pos / flayer->l_width; LAY_CALL_UP ( - RedisplayLine(INPUTLINE, 0, flayer->l_width - 1, 0); + LayRedisplayLine(INPUTLINE, 0, flayer->l_width - 1, 0); revto(x, y); if (W2D(markdata->cy) == INPUTLINE) revto_line(markdata->cx, markdata->cy, INPUTLINE > 0 ? INPUTLINE - 1 : 1); diff --git a/src/socket.c b/src/socket.c index cbda603..297d11d 100644 --- a/src/socket.c +++ b/src/socket.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -357,7 +357,7 @@ char *match; if (wipeflag) Msg(0, "%d socket%s wiped out.", nwipe, nwipe > 1 ? "s" : ""); else - Msg(0, "Remove dead screens with 'screen -wipe'.", ndead > 1 ? "s" : "", ndead > 1 ? "" : "es"); /* other args for nethack */ + Msg(0, "Remove dead screens with 'screen -wipe'."+1-1, ndead > 1 ? "s" : "", ndead > 1 ? "" : "es"); /* other args for nethack */ } if (firsts != -1) { @@ -939,6 +939,15 @@ ReceiveMsg() #endif debug2("RecMsg: apid %d is o.k. and we just opened '%s'\n", m.m.attach.apid, m.m_tty); +#ifndef MULTI + if (displays) + { + write(i, "Screen session in use.\n", 23); + close(i); + Kill(m.m.attach.apid, SIG_BYE); + break; + } +#endif /* create new display */ GetTTY(i, &Mode); @@ -1104,7 +1113,7 @@ struct msg *m; * We reboot our Terminal Emulator. Forget all we knew about * the old terminal, reread the termcap entries in .screenrc * (and nothing more from .screenrc is read. Mainly because - * I did not check, weather a full reinit is save. jw) + * I did not check, weather a full reinit is safe. jw) * and /etc/screenrc, and initialise anew. */ if (extra_outcap) @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -215,7 +215,7 @@ int *lenp; fore->w_telbuf[fore->w_telbufl++] = '\n'; tb = fore->w_telbuf; tl = fore->w_telbufl; - Process(&tb, &tl); + LayProcess(&tb, &tl); fore->w_telbufl = 0; continue; } @@ -476,7 +476,8 @@ struct win *p; if (p->w_telsubidx != 2 || p->w_telsubbuf[1] != 1) return; l = strlen(screenterm); - ASSERT(l < 20); + if (l >= 20) + break; sprintf(trepl, "%c%c%c%c%s%c%c", TC_IAC, TC_SB, TO_TTYPE, 0, screenterm, TC_IAC, TC_SE); TelReply(p, trepl, l + 6); break; @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -159,6 +159,7 @@ struct term term[T_N] = { "VR", T_STR }, { "VN", T_STR }, { "TF", T_FLG }, + { "XT", T_FLG }, /* d_font setting */ { "G0", T_FLG }, diff --git a/src/term.h.dist b/src/term.h.dist index b41db31..0f5321b 100644 --- a/src/term.h.dist +++ b/src/term.h.dist @@ -208,37 +208,39 @@ union tcu #define D_CVN (D_tcs[92].str) #define d_CTF d_tcs[93].flg #define D_CTF (D_tcs[93].flg) -#define d_CG0 d_tcs[94].flg -#define D_CG0 (D_tcs[94].flg) -#define d_CS0 d_tcs[95].str -#define D_CS0 (D_tcs[95].str) -#define d_CE0 d_tcs[96].str -#define D_CE0 (D_tcs[96].str) -#define d_CC0 d_tcs[97].str -#define D_CC0 (D_tcs[97].str) -#define d_AS d_tcs[98].str -#define D_AS (D_tcs[98].str) -#define d_AE d_tcs[99].str -#define D_AE (D_tcs[99].str) -#define d_AC d_tcs[100].str -#define D_AC (D_tcs[100].str) -#define d_EA d_tcs[101].str -#define D_EA (D_tcs[101].str) -#define d_CXC d_tcs[102].str -#define D_CXC (D_tcs[102].str) -#define T_CAPS 103 -#define T_NAVIGATE 142 -#define T_CURSOR 150 -#define T_KEYPAD 154 -#define T_OCAPS 172 -#define T_ECAPS 185 -#define T_N 185 +#define d_CXT d_tcs[94].flg +#define D_CXT (D_tcs[94].flg) +#define d_CG0 d_tcs[95].flg +#define D_CG0 (D_tcs[95].flg) +#define d_CS0 d_tcs[96].str +#define D_CS0 (D_tcs[96].str) +#define d_CE0 d_tcs[97].str +#define D_CE0 (D_tcs[97].str) +#define d_CC0 d_tcs[98].str +#define D_CC0 (D_tcs[98].str) +#define d_AS d_tcs[99].str +#define D_AS (D_tcs[99].str) +#define d_AE d_tcs[100].str +#define D_AE (D_tcs[100].str) +#define d_AC d_tcs[101].str +#define D_AC (D_tcs[101].str) +#define d_EA d_tcs[102].str +#define D_EA (D_tcs[102].str) +#define d_CXC d_tcs[103].str +#define D_CXC (D_tcs[103].str) +#define T_CAPS 104 +#define T_NAVIGATE 143 +#define T_CURSOR 151 +#define T_KEYPAD 155 +#define T_OCAPS 173 +#define T_ECAPS 186 +#define T_N 186 #ifdef MAPKEYS -# define KMAPDEFSTART 103 +# define KMAPDEFSTART 104 # define NKMAPDEF 69 -# define KMAPADEFSTART 150 +# define KMAPADEFSTART 151 # define NKMAPADEF 22 -# define KMAPMDEFSTART 135 +# define KMAPMDEFSTART 136 # define NKMAPMDEF 19 #endif diff --git a/src/termcap.c b/src/termcap.c index 22868f9..a91b686 100644 --- a/src/termcap.c +++ b/src/termcap.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -33,7 +33,7 @@ extern struct display *display, *displays; extern int real_uid, real_gid, eff_uid, eff_gid; extern struct term term[]; /* terminal capabilities */ extern struct NewWindow nwin_undef, nwin_default, nwin_options; -extern int force_vt, assume_LP; +extern int force_vt; extern int Z0width, Z1width; extern int hardstatusemu; #ifdef MAPKEYS @@ -202,7 +202,7 @@ int he; { /* standard fixes for xterms etc */ /* assume color for everything that looks ansi-compatible */ - if (!D_CAF && D_ME && InStr(D_ME, "\033[m")) + if (!D_CAF && D_ME && (InStr(D_ME, "\033[m") || InStr(D_ME, "\033[0m"))) { #ifdef TERMINFO D_CAF = "\033[3%p1%dm"; @@ -219,12 +219,14 @@ int he; /* ISO2022 */ if ((D_EA && InStr(D_EA, "\033(B")) || (D_AS && InStr(D_AS, "\033(0"))) D_CG0 = 1; + if (InStr(D_termname, "xterm") || InStr(D_termname, "rxvt")) + D_CXT = 1; } if (nwin_options.flowflag == nwin_undef.flowflag) nwin_default.flowflag = D_CNF ? FLOW_NOW * 0 : D_NX ? FLOW_NOW * 1 : FLOW_AUTOFLAG; - D_CLP |= (assume_LP || !D_AM || D_XV || D_XN); + D_CLP |= (!D_AM || D_XV || D_XN); if (!D_BL) D_BL = "\007"; if (!D_BC) @@ -326,8 +328,8 @@ int he; D_CAF = D_CSF; D_CAB = D_CSB; } - if (D_BE) - D_UT = 1; /* screen erased with background color */ + if (D_UT) + D_BE = 1; /* screen erased with background color */ if (!D_DO) D_DO = D_NL; diff --git a/src/terminfo/screeninfo.src b/src/terminfo/screeninfo.src index b7e0c7f..aee40a8 100644 --- a/src/terminfo/screeninfo.src +++ b/src/terminfo/screeninfo.src @@ -14,7 +14,7 @@ screen|VT 100/ANSI X3.64 virtual terminal, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kend=\E[4~, - kich1=\E[2~, kll=\E[4~, knp=\E[6~, kpp=\E[5~, nel=\EE, + kich1=\E[2~, knp=\E[6~, kpp=\E[5~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, @@ -38,7 +38,7 @@ screen-w|VT 100/ANSI X3.64 virtual terminal with 132 cols, kf10=\E[21~, kf11=\E[23~, kf12=\E[24~, kf2=\EOQ, kf3=\EOR, kf4=\EOS, kf5=\E[15~, kf6=\E[17~, kf7=\E[18~, kf8=\E[19~, kf9=\E[20~, khome=\E[1~, kend=\E[4~, - kich1=\E[2~, kll=\E[4~, knp=\E[6~, kpp=\E[5~, nel=\EE, + kich1=\E[2~, knp=\E[6~, kpp=\E[5~, nel=\EE, rc=\E8, rev=\E[7m, ri=\EM, rmir=\E[4l, rmkx=\E[?1l\E>, rmso=\E[23m, rmul=\E[24m, rs2=\Ec, sc=\E7, sgr0=\E[m, smir=\E[4h, smkx=\E[?1h\E=, smso=\E[3m, smul=\E[4m, diff --git a/src/tty.c.dist b/src/tty.c.dist index dab3c86..1986465 100644 --- a/src/tty.c.dist +++ b/src/tty.c.dist @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -176,6 +176,15 @@ char *line, *opt; #endif SetTTY(f, &Mode); +#if defined(linux) && defined(TIOCMSET) + { + int mcs = 0; + ioctl(f, TIOCMGET, &mcs); + mcs |= TIOCM_RTS; + ioctl(f, TIOCMSET, &mcs); + } +#endif + brktty(f); alarm(0); signal(SIGALRM, sigalrm); @@ -234,11 +243,11 @@ int ttyflag; m->tio.c_oflag |= OXTABS; #endif /* OXTABS */ /* IF{PARENB} m->tio.c_cflag |= PARENB; nah! jw. */ - } - #if defined(OPOST) m->tio.c_oflag |= OPOST; #endif /* OPOST */ + } + /* * Or-ing the speed into c_cflags is dangerous. @@ -415,12 +424,11 @@ int ttyflag; m->tio.c_iflag |= IXON; #endif /* IXON */ + if (!ttyflag) /* may not even be good for ptys.. */ + { #if defined(OPOST) m->tio.c_oflag |= OPOST; #endif /* OPOST */ - - if (!ttyflag) /* may not even be good for ptys.. */ - { #if defined(ICRNL) m->tio.c_iflag |= ICRNL; #endif /* ICRNL */ @@ -985,6 +993,18 @@ char *opt; m->m_ttyb.sg_flags &= ~TANDEM; #endif } + else if (!strncmp("crtscts", opt, 7)) + { +#if (defined(POSIX) || defined(TERMIO)) && defined(CRTSCTS) + m->tio.c_cflag |= CRTSCTS; +#endif + } + else if (!strncmp("-crtscts", opt, 8)) + { +#if (defined(POSIX) || defined(TERMIO)) && defined(CRTSCTS) + m->tio.c_cflag &= ~CRTSCTS; +#endif + } else return -1; while (*opt && !index(sep, *opt)) opt++; @@ -1253,8 +1273,8 @@ int n, closeopen; #if !defined(TIOCCONS) && defined(SRIOCSREDIR) -struct event consredir_ev; -int consredirfd[2] = {-1, -1}; +static struct event consredir_ev; +static int consredirfd[2] = {-1, -1}; static void consredir_readev_fn(ev, data) @@ -1298,7 +1318,7 @@ char *rc_name; int sfd = -1; if (on < 0) - return; /* pty close will ungrab */ + return 0; /* pty close will ungrab */ if (on) { if (displays == 0) @@ -1461,15 +1481,14 @@ char *buf; #if defined(CLOCAL) || defined(CRTSCTS) GetTTY(fd, &mtio); #endif + clocal = 0; #ifdef CLOCAL if (mtio.tio.c_cflag & CLOCAL) { clocal = 1; *p++ = '{'; } - else #endif - clocal = 0; #ifdef TIOCM_CTS # ifdef CRTSCTS @@ -1491,8 +1510,8 @@ char *buf; # else # ifdef TIOCMODG if (ioctl(fd, TIOCMODG, (char *)&mflags) < 0) -# else - if (ioctl(fd, TIOCMODG, &mflags) < 0) +# else + if (ioctl(fd, MCGETA, &mflags) < 0) # endif # endif { @@ -1518,6 +1537,7 @@ char *buf; while (*s) *p++ = *s++; # endif # ifdef TIOCM_CTS + s = "!CTS "; if (!rtscts) { *p++ = '('; @@ -1536,15 +1556,14 @@ char *buf; while (*s) *p++ = *s++; # endif # if defined(TIOCM_CD) || defined(TIOCM_CAR) + s = "!CD "; # ifdef TIOCGSOFTCAR if (softcar) { *p++ = '('; s = "!CD) "; } - else # endif - s = "!CD "; # ifdef TIOCM_CD if (mflags & TIOCM_CD) s++; # else @@ -24,7 +24,7 @@ sed -e '1,26d' \ chmod -w $1 exit 0 -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -202,6 +202,15 @@ char *line, *opt; #endif SetTTY(f, &Mode); +#if defined(linux) && defined(TIOCMSET) + { + int mcs = 0; + ioctl(f, TIOCMGET, &mcs); + mcs |= TIOCM_RTS; + ioctl(f, TIOCMSET, &mcs); + } +#endif + brktty(f); alarm(0); signal(SIGALRM, sigalrm); @@ -246,9 +255,9 @@ IF{ONLCR} m->tio.c_oflag |= ONLCR; IF{TAB3} m->tio.c_oflag |= TAB3; IF{OXTABS} m->tio.c_oflag |= OXTABS; /* IF{PARENB} m->tio.c_cflag |= PARENB; nah! jw. */ +IF{OPOST} m->tio.c_oflag |= OPOST; } -IF{OPOST} m->tio.c_oflag |= OPOST; /* * Or-ing the speed into c_cflags is dangerous. @@ -327,10 +336,9 @@ XIF{VSTATUS} m->tio.c_cc[VSTATUS] = Ctrl('T'); IF{ISTRIP} m->tio.c_iflag |= ISTRIP; IF{IXON} m->tio.c_iflag |= IXON; -IF{OPOST} m->tio.c_oflag |= OPOST; - if (!ttyflag) /* may not even be good for ptys.. */ { +IF{OPOST} m->tio.c_oflag |= OPOST; IF{ICRNL} m->tio.c_iflag |= ICRNL; IF{ONLCR} m->tio.c_oflag |= ONLCR; IF{TAB3} m->tio.c_oflag |= TAB3; @@ -747,6 +755,18 @@ char *opt; m->m_ttyb.sg_flags &= ~TANDEM; #endif } + else if (!strncmp("crtscts", opt, 7)) + { +#if (defined(POSIX) || defined(TERMIO)) && defined(CRTSCTS) + m->tio.c_cflag |= CRTSCTS; +#endif + } + else if (!strncmp("-crtscts", opt, 8)) + { +#if (defined(POSIX) || defined(TERMIO)) && defined(CRTSCTS) + m->tio.c_cflag &= ~CRTSCTS; +#endif + } else return -1; while (*opt && !index(sep, *opt)) opt++; @@ -1015,8 +1035,8 @@ int n, closeopen; #if !defined(TIOCCONS) && defined(SRIOCSREDIR) -struct event consredir_ev; -int consredirfd[2] = {-1, -1}; +static struct event consredir_ev; +static int consredirfd[2] = {-1, -1}; static void consredir_readev_fn(ev, data) @@ -1060,7 +1080,7 @@ char *rc_name; int sfd = -1; if (on < 0) - return; /* pty close will ungrab */ + return 0; /* pty close will ungrab */ if (on) { if (displays == 0) @@ -1211,15 +1231,14 @@ IF{MCTS}# define TIOCM_CTS MCTS #if defined(CLOCAL) || defined(CRTSCTS) GetTTY(fd, &mtio); #endif + clocal = 0; #ifdef CLOCAL if (mtio.tio.c_cflag & CLOCAL) { clocal = 1; *p++ = '{'; } - else #endif - clocal = 0; #ifdef TIOCM_CTS # ifdef CRTSCTS @@ -1241,8 +1260,8 @@ IF{MCTS}# define TIOCM_CTS MCTS # else # ifdef TIOCMODG if (ioctl(fd, TIOCMODG, (char *)&mflags) < 0) -# else - if (ioctl(fd, TIOCMODG, &mflags) < 0) +# else + if (ioctl(fd, MCGETA, &mflags) < 0) # endif # endif { @@ -1268,6 +1287,7 @@ IF{MCTS}# define TIOCM_CTS MCTS while (*s) *p++ = *s++; # endif # ifdef TIOCM_CTS + s = "!CTS "; if (!rtscts) { *p++ = '('; @@ -1286,15 +1306,14 @@ IF{MCTS}# define TIOCM_CTS MCTS while (*s) *p++ = *s++; # endif # if defined(TIOCM_CD) || defined(TIOCM_CAR) + s = "!CD "; # ifdef TIOCGSOFTCAR if (softcar) { *p++ = '('; s = "!CD) "; } - else # endif - s = "!CD "; # ifdef TIOCM_CD if (mflags & TIOCM_CD) s++; # else @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -33,7 +33,15 @@ RCS_ID("$Id$ FAU") #include "screen.h" #include "extern.h" +#ifdef HAVE_UTEMPTER +#include <utempter.h> +#endif + + extern struct display *display; +#ifdef CAREFULUTMP +extern struct win *windows; +#endif extern struct win *fore; extern char *LoginName; extern int real_uid, eff_uid; diff --git a/src/window.c b/src/window.c index 60e0cbc..1580933 100644 --- a/src/window.c +++ b/src/window.c @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -55,6 +55,7 @@ extern struct event logflushev; extern int log_flush, logtstamp_after; extern int ZombieKey_destroy, ZombieKey_resurrect; extern struct layer *flayer; +extern int maxusercount; #if defined(TIOCSWINSZ) || defined(TIOCGWINSZ) extern struct winsize glwz; @@ -66,7 +67,7 @@ extern int aixhack; static void WinProcess __P((char **, int *)); static void WinRedisplayLine __P((int, int, int, int)); -static void WinClearLine __P((int, int, int)); +static void WinClearLine __P((int, int, int, int)); static int WinRewrite __P((int, int, int, struct mchar *, int)); static int WinResize __P((int, int)); static void WinRestore __P((void)); @@ -112,8 +113,9 @@ struct NewWindow nwin_undef = -1, /* wrap */ -1, /* logging */ -1, /* slowpaste */ - -1, /* c1 */ -1, /* gr */ + -1, /* c1 */ + -1, /* bce */ -1, /* kanji */ (char *)0, /* hstatus */ (char *)0 /* charset */ @@ -136,8 +138,9 @@ struct NewWindow nwin_default = 1, /* wrap */ 0, /* logging */ 0, /* slowpaste */ - 1, /* c1 */ 0, /* gr */ + 1, /* c1 */ + 0, /* bce */ 0, /* kanji */ (char *)0, /* hstatus */ (char *)0 /* charset */ @@ -168,8 +171,9 @@ struct NewWindow *def, *new, *res; COMPOSE(wrap); COMPOSE(Lflag); COMPOSE(slow); - COMPOSE(c1); COMPOSE(gr); + COMPOSE(c1); + COMPOSE(bce); COMPOSE(kanji); COMPOSE(hstatus); COMPOSE(charset); @@ -394,6 +398,10 @@ struct mchar *rend; p = fore->w_mlines[y].attr + x1; #ifdef FONT f = fore->w_mlines[y].font + x1; +# ifdef KANJI + if (rend->font == KANJI) + return EXPENSIVE; +# endif #endif #ifdef COLOR c = fore->w_mlines[y].color + x1; @@ -417,11 +425,12 @@ struct mchar *rend; } static void -WinClearLine(y, xs, xe) -int y, xs, xe; +WinClearLine(y, xs, xe, bce) +int y, xs, xe, bce; { fore = (struct win *)flayer->l_data; - LClearLine(flayer, y, xs, xe, &fore->w_mlines[y]); + debug3("WinClearLine %d %d-%d\n", y, xs, xe); + LClearLine(flayer, y, xs, xe, bce, &fore->w_mlines[y]); } static int @@ -451,6 +460,7 @@ WinRestore() InsertMode(fore->w_insert); ReverseVideo(fore->w_revvid); CursorVisibility(fore->w_curinv ? -1 : fore->w_curvvis); + MouseMode(fore->w_mouse); } } @@ -624,11 +634,27 @@ struct NewWindow *newwin; if (nwin.hstatus) p->w_hstatus = SaveStr(nwin.hstatus); p->w_monitor = nwin.monitor; +#ifdef MULTIUSER + if (p->w_monitor == MON_ON) + { + /* always tell all users */ + for (i = 0; i < maxusercount; i++) + ACLBYTE(p->w_mon_notify, i) |= ACLBIT(i); + } +#endif /* * defsilence by Lloyd Zusman (zusman_lloyd@jpmorgan.com) */ p->w_silence = nwin.silence; p->w_silencewait = SilenceWait; +#ifdef MULTIUSER + if (p->w_silence == SILENCE_ON) + { + /* always tell all users */ + for (i = 0; i < maxusercount; i++) + ACLBYTE(p->w_lio_notify, i) |= ACLBIT(i); + } +#endif #ifdef COPY_PASTE p->w_slowpaste = nwin.slow; #else @@ -638,6 +664,8 @@ struct NewWindow *newwin; p->w_norefresh = 0; strncpy(p->w_tty, TtyName, MAXSTR - 1); +#if 0 + /* XXX Fixme display resize */ if (ChangeWindowSize(p, display ? D_defwidth : 80, display ? D_defheight : 24, nwin.histheight)) @@ -645,10 +673,20 @@ struct NewWindow *newwin; FreeWindow(p); return -1; } +#else + if (ChangeWindowSize(p, display ? D_forecv->c_xe - D_forecv->c_xs + 1: 80, + display ? D_forecv->c_ye - D_forecv->c_ys + 1 : 24, + nwin.histheight)) + { + FreeWindow(p); + return -1; + } +#endif + #ifdef KANJI p->w_kanji = nwin.kanji; #endif - ResetWindow(p); /* sets w_wrap, w_c1, w_gr */ + ResetWindow(p); /* sets w_wrap, w_c1, w_gr, w_bce */ #ifdef FONT if (nwin.charset) SetCharsets(p, nwin.charset); @@ -1065,7 +1103,24 @@ char **args, *ttyn; int i, pat, wfdused; struct pseudowin *pwin = win->w_pwin; #endif +#if (defined(sun) || defined(_IBMR2)) && defined(O_NOCTTY) + int slave; +#endif +#if defined(sun) && defined(O_NOCTTY) + /* sun's utmp_update program opens the salve side, thus corrupting + * pty semantics */ + debug("pre-opening slave...\n"); + if ((slave = open(ttyn, O_RDWR|O_NOCTTY)) == -1) + { + Msg(errno, "ttyn"); + return -1; + } +#endif +#if defined(_IBMR2) && defined(O_NOCTTY) + slave = aixhack; + aixhack = -1; +#endif debug("forking...\n"); proc = *args; if (proc == 0) @@ -1118,14 +1173,14 @@ char **args, *ttyn; if (dfp && dfp != stderr) fclose(dfp); #endif -#ifdef _IBMR2 +#if (defined(sun) || defined(_IBMR2)) && defined(O_NOCTTY) close(0); - dup(aixhack); - close(aixhack); -#endif + dup(slave); + close(slave); + closeallfiles(win->w_ptyfd); + slave = dup(0); +#else closeallfiles(win->w_ptyfd); -#ifdef _IBMR2 - aixhack = dup(0); #endif #ifdef DEBUG if (dfp) /* do not produce child debug, when debug is "off" */ @@ -1187,13 +1242,13 @@ char **args, *ttyn; dup(0); #endif /* PSEUDOS */ close(win->w_ptyfd); -#ifdef _IBMR2 - close(aixhack); +#if (defined(sun) || defined(_IBMR2)) && defined(O_NOCTTY) + close(slave); #endif if (newfd >= 0) { struct mode fakemode, *modep; - InitPty(newfd); + InitPTY(newfd); if (fgtty(newfd)) Msg(errno, "fgtty"); if (display) @@ -1288,9 +1343,8 @@ char **args, *ttyn; default: break; } -#ifdef _IBMR2 - close(aixhack); - aixhack = -1; +#if (defined(sun) || defined(_IBMR2)) && defined(O_NOCTTY) + close(slave); #endif return pid; } @@ -1664,7 +1718,7 @@ char *data; } debug1("going to read from window fd %d\n", ev->fd); - if ((len = read(ev->fd, buf, size)) <= 0) + if ((len = read(ev->fd, buf, size)) < 0) { if (errno == EINTR || errno == EAGAIN) return; @@ -1672,7 +1726,13 @@ char *data; if (errno == EWOULDBLOCK) return; #endif - debug2("Window %d: read error (errno %d) - killing window\n", p->w_number, len ? errno : 0); + debug2("Window %d: read error (errno %d) - killing window\n", p->w_number, errno); + WindowDied(p); + return; + } + if (len == 0) + { + debug1("Window %d: EOF - killing window\n", p->w_number); WindowDied(p); return; } @@ -1684,9 +1744,9 @@ char *data; { debug1("PAKET %x\n", buf[0]); if (buf[0] & TIOCPKT_NOSTOP) - NewAutoFlow(p, 0); + WNewAutoFlow(p, 0); if (buf[0] & TIOCPKT_DOSTOP) - NewAutoFlow(p, 1); + WNewAutoFlow(p, 1); } bp++; len--; diff --git a/src/window.h b/src/window.h index 750bb8e..847f14d 100644 --- a/src/window.h +++ b/src/window.h @@ -1,4 +1,4 @@ -/* Copyright (c) 1993 +/* Copyright (c) 1993-2000 * Juergen Weigert (jnweiger@immd4.informatik.uni-erlangen.de) * Michael Schroeder (mlschroe@immd4.informatik.uni-erlangen.de) * Copyright (c) 1987 Oliver Laumann @@ -41,8 +41,9 @@ struct NewWindow int wrap; int Lflag; /* logging */ int slow; /* inter character milliseconds */ - int c1; int gr; + int c1; + int bce; int kanji; char *hstatus; char *charset; @@ -193,6 +194,7 @@ struct win char *w_hstatus; /* hardstatus line */ int w_gr; /* enable GR flag */ int w_c1; /* enable C1 flag */ + int w_bce; /* enable backcol erase */ #ifdef KANJI int w_kanji; /* for input and paste */ int w_mbcs; /* saved char for multibytes charset */ @@ -209,6 +211,10 @@ struct win int w_silence; /* silence status (Lloyd Zusman) */ char w_vbwait; char w_norefresh; /* dont redisplay when switching to that win */ +#ifdef RXVT_OSC + char w_xtermosc[4][MAXSTR]; /* special xterm/rxvt escapes */ +#endif + int w_mouse; /* mouse mode 0,9,1000 */ #ifdef HAVE_BRAILLE int w_bd_x, w_bd_y; /* Braille cursor position */ #endif |