diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-02-16 09:40:01 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2008-02-16 09:40:01 +0000 |
commit | b167c48bd3432744ac7c52759b6c7d4bdde76b69 (patch) | |
tree | b0c404e8aaf332198d86e860d959f524b94b7bb6 /app/xterm | |
parent | e8b6624a43e161b556c35d5483247f75d7420a9c (diff) |
Merge xterm 232.
New local change: default value for pointerMode is 0.
Diffstat (limited to 'app/xterm')
-rw-r--r-- | app/xterm/Makefile | 19 | ||||
-rw-r--r-- | app/xterm/Makefile.in | 36 | ||||
-rw-r--r-- | app/xterm/Tekproc.c | 9 | ||||
-rw-r--r-- | app/xterm/XTerm.ad | 4 | ||||
-rw-r--r-- | app/xterm/main.c | 404 | ||||
-rw-r--r-- | app/xterm/ptyx.h | 156 | ||||
-rw-r--r-- | app/xterm/uxterm | 12 | ||||
-rw-r--r-- | app/xterm/version.h | 4 | ||||
-rw-r--r-- | app/xterm/xterm.h | 38 | ||||
-rw-r--r-- | app/xterm/xterm.man | 131 | ||||
-rw-r--r-- | app/xterm/xtermcfg.h | 1 |
11 files changed, 458 insertions, 356 deletions
diff --git a/app/xterm/Makefile b/app/xterm/Makefile index 77360c346..975631de7 100644 --- a/app/xterm/Makefile +++ b/app/xterm/Makefile @@ -1,9 +1,9 @@ -# $OpenBSD: Makefile,v 1.8 2008/01/13 17:22:58 matthieu Exp $ +# $OpenBSD: Makefile,v 1.9 2008/02/16 09:40:00 matthieu Exp $ SUBDIR= icons resize PROG= xterm -MAN= xterm.1tbl +MAN= xterm.1tbl uxterm.1 koi8rxterm.1 BINGRP= utmp BINMODE= 2755 @@ -33,7 +33,16 @@ xterm.1tbl: xterm.man -e 's#__apploaddir__#${X11ETC}/app-defaults#g' \ < ${.CURDIR}/xterm.man > $@ -CLEANFILES+= xterm.1tbl +.SUFFIXES: .man .1 + +.man.1: + sed -e 's#__vendorversion__#"X Window System"#g' \ + -e 's#__mansuffix__#1#g' \ + -e 's#__miscmansuffix__#1#g' \ + -e 's#__apploaddir__#${X11ETC}/app-defaults#g' \ + < $< > $@ + +CLEANFILES+= ${MAN} afterinstall: ${INSTALL} ${INSTALL_COPY} -m 755 ${.CURDIR}/uxterm \ @@ -44,6 +53,10 @@ afterinstall: ${DESTDIR}${XETC}/app-defaults/XTerm-color ${INSTALL} ${INSTALL_COPY} -m 644 ${.CURDIR}/UXTerm.ad \ ${DESTDIR}${XETC}/app-defaults/UXTerm + ${INSTALL} ${INSTALL_COPY} -m 755 ${.CURDIR}/koi8rxterm \ + ${DESTDIR}${BINDIR} + ${INSTALL} ${INSTALL_COPY} -m 644 ${.CURDIR}/KOI8RXTerm.ad \ + ${DESTDIR}${XETC}/app-defaults/KOI8RXTerm obj: _xenocara_obj diff --git a/app/xterm/Makefile.in b/app/xterm/Makefile.in index d7867e030..cc0ac83ca 100644 --- a/app/xterm/Makefile.in +++ b/app/xterm/Makefile.in @@ -1,6 +1,4 @@ -## $XTermId: Makefile.in,v 1.148 2007/06/16 18:47:51 tom Exp $ -## -## $XFree86: xc/programs/xterm/Makefile.in,v 3.56 2006/06/19 00:36:50 dickey Exp $ ## +## $XTermId: Makefile.in,v 1.155 2008/01/05 14:26:52 tom Exp $ ## ## Copyright 2002-2006,2007 by Thomas E. Dickey ## @@ -162,13 +160,15 @@ resize$x : $(OBJS2) charproc$o : main.h @CHARPROC_DEPS@ ################################################################################ -actual_xterm = `echo xterm| sed '$(transform)'` -actual_resize = `echo resize| sed '$(transform)'` -actual_uxterm = `echo uxterm| sed '$(transform)'` +actual_xterm = `echo xterm| sed '$(transform)'` +actual_resize = `echo resize| sed '$(transform)'` +actual_uxterm = `echo uxterm| sed '$(transform)'` +actual_k8term = `echo koi8rxterm| sed '$(transform)'` binary_xterm = $(actual_xterm)$x binary_resize = $(actual_resize)$x binary_uxterm = $(actual_uxterm) +binary_k8term = $(actual_k8term) install \ install-bin \ @@ -185,6 +185,15 @@ install-full :: xterm$x resize$x $(BINDIR) else \ $(INSTALL_SCRIPT) -m 755 $(srcdir)/uxterm $(BINDIR)/$(binary_uxterm); \ fi' + @$(SHELL) -c 'echo "... installing $(BINDIR)/$(binary_k8term)"; \ + if test "$(binary_xterm)" != "xterm"; then \ + name="$(binary_xterm)"; \ + sed -e "s,=xterm,=$$name," $(srcdir)/koi8rxterm >k8term.tmp; \ + $(INSTALL_SCRIPT) -m 755 k8term.tmp $(BINDIR)/$(binary_k8term); \ + rm -f k8term.tmp; \ + else \ + $(INSTALL_SCRIPT) -m 755 $(srcdir)/koi8rxterm $(BINDIR)/$(binary_k8term); \ + fi' @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && rm -f @XTERM_SYMLINK@ ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && $(LN_S) $(binary_xterm) @XTERM_SYMLINK@ ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && echo '... created symbolic link:' && ls -l $(binary_xterm) @XTERM_SYMLINK@ ; fi" @@ -194,6 +203,8 @@ install-man \ install-full :: $(MANDIR) $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/xterm.man $(MANDIR)/$(actual_xterm).$(manext) $(appsdir) $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/resize.man $(MANDIR)/$(actual_resize).$(manext) $(appsdir) + $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/uxterm.man $(MANDIR)/$(actual_uxterm).$(manext) $(appsdir) + $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/koi8rxterm.man $(MANDIR)/$(actual_k8term).$(manext) $(appsdir) @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext) ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && $(LN_S) $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && echo '... created symbolic link:' && ls -l $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi" @@ -210,6 +221,9 @@ install-full :: $(MANDIR) @no_appsdir@ @echo installing $(APPSDIR)/UXTerm @no_appsdir@ @sed -e s/XTerm/$(CLASS)/ $(srcdir)/UXTerm.ad >XTerm.tmp @no_appsdir@ @$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/UXTerm +@no_appsdir@ @echo installing $(APPSDIR)/KOI8RXTerm +@no_appsdir@ @sed -e s/XTerm/$(CLASS)/ $(srcdir)/KOI8RXTerm.ad >XTerm.tmp +@no_appsdir@ @$(INSTALL_DATA) XTerm.tmp $(APPSDIR)/KOI8RXTerm @no_appsdir@ @rm -f XTerm.tmp @no_icondir@ @echo "... installed app-defaults" @@ -246,6 +260,7 @@ uninstall-full :: -$(RM) $(BINDIR)/$(binary_xterm) -$(RM) $(BINDIR)/$(binary_resize) -$(RM) $(BINDIR)/$(binary_uxterm) + -$(RM) $(BINDIR)/$(binary_k8term) @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && rm -f @XTERM_SYMLINK@; fi" uninstall \ @@ -253,6 +268,8 @@ uninstall-man \ uninstall-full :: -$(RM) $(MANDIR)/$(actual_xterm).$(manext) -$(RM) $(MANDIR)/$(actual_resize).$(manext) + -$(RM) $(MANDIR)/$(actual_uxterm).$(manext) + -$(RM) $(MANDIR)/$(actual_k8term).$(manext) @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext); fi" @no_appsdir@uninstall \ @@ -266,8 +283,8 @@ uninstall-full :: @no_icondir@uninstall-icon \ @no_icondir@uninstall-full :: @no_icondir@ -$(RM) $(ICONDIR)/xterm-color_32x32.xpm -@no_icondir@ -$(RM) $(ICONDIR)/xterm_48x48.xpm -@no_icondir@ -$(RM) $(ICONDIR)/xterm-color_32x32.xpm +@no_icondir@ -$(RM) $(ICONDIR)/xterm_32x32.xpm +@no_icondir@ -$(RM) $(ICONDIR)/xterm-color_48x48.xpm @no_icondir@ -$(RM) $(ICONDIR)/xterm_48x48.xpm ################################################################################ # Desktop-utils does not provide an uninstall, and is not uniformly available. @@ -295,6 +312,9 @@ realclean : distclean maintainer-clean : realclean -$(RM) 256colres.h 88colres.h ################################################################################ +terminfo.out : terminfo ; tic -a -I -1 terminfo >$@ +termcap.out : termcap ; tic -a -C -U termcap >$@ +################################################################################ ctlseqs.html : ctlseqs.ms ctlseqs.pdf : ctlseqs.ps ctlseqs.ps : ctlseqs.ms diff --git a/app/xterm/Tekproc.c b/app/xterm/Tekproc.c index c01fb9960..1f97d740d 100644 --- a/app/xterm/Tekproc.c +++ b/app/xterm/Tekproc.c @@ -1,4 +1,4 @@ -/* $XTermId: Tekproc.c,v 1.157 2007/07/10 19:53:11 tom Exp $ */ +/* $XTermId: Tekproc.c,v 1.158 2008/01/26 01:21:10 tom Exp $ */ /* * Warning, there be crufty dragons here. @@ -7,7 +7,7 @@ /* -Copyright 2001-2006,2007 by Thomas E. Dickey +Copyright 2001-2007,2008 by Thomas E. Dickey All Rights Reserved @@ -729,13 +729,16 @@ Tekparse(TekWidget tw) 1); } else #endif + { + char ch2 = (char) ch; XDrawString(XtDisplay(tw), TWindow(tekscr), tekscr->TnormalGC, x, y, - (char *) &ch, + &ch2, 1); + } TCursorForward(tw); break; case CASE_OSC: diff --git a/app/xterm/XTerm.ad b/app/xterm/XTerm.ad index 6ff1caecc..97ae45f14 100644 --- a/app/xterm/XTerm.ad +++ b/app/xterm/XTerm.ad @@ -1,5 +1,4 @@ -! $XTermId: XTerm.ad,v 1.83 2007/03/18 22:41:40 tom Exp $ -! $XFree86: xc/programs/xterm/XTerm.ad,v 3.37 2006/04/10 00:34:36 dickey Exp $ +! $XTermId: XTerm.ad,v 1.85 2007/11/26 18:42:37 tom Exp $ *scrollBar: true *saveLines: 1024 @@ -52,6 +51,7 @@ *vtMenu*scrollkey*Label: Scroll to Bottom on Key Press *vtMenu*scrollttyoutput*Label: Scroll to Bottom on Tty Output *vtMenu*allow132*Label: Allow 80/132 Column Switching +*vtMenu*keepSelection*Label: Keep Selection *vtMenu*selectToClipboard*Label: Select to Clipboard *vtMenu*cursesemul*Label: Enable Curses Emulation *vtMenu*visualbell*Label: Enable Visual Bell diff --git a/app/xterm/main.c b/app/xterm/main.c index 6995b740e..99279d899 100644 --- a/app/xterm/main.c +++ b/app/xterm/main.c @@ -1,4 +1,4 @@ -/* $XTermId: main.c,v 1.574 2007/07/22 20:02:22 tom Exp $ */ +/* $XTermId: main.c,v 1.582 2008/01/15 23:58:01 tom Exp $ */ /* * W A R N I N G @@ -15,7 +15,7 @@ /*********************************************************** -Copyright 2002-2006,2007 by Thomas E. Dickey +Copyright 2002-2007,2008 by Thomas E. Dickey All Rights Reserved @@ -87,8 +87,6 @@ SOFTWARE. ******************************************************************/ -/* $XFree86: xc/programs/xterm/main.c,v 3.212 2006/06/20 00:42:38 dickey Exp $ */ - /* main.c */ #define RES_OFFSET(field) XtOffsetOf(XTERM_RESOURCE, field) @@ -506,54 +504,72 @@ static char **command_to_exec_with_luit = NULL; #define VAL_LINE_SPEED B9600 #endif -/* allow use of system default characters if defined and reasonable */ +/* + * Allow use of system default characters if defined and reasonable. + * These are based on the BSD ttydefaults.h + */ #ifndef CBRK -#define CBRK 0 +#define CBRK 0xff /* was 0 */ +#endif +#ifndef CDISCARD +#define CDISCARD CONTROL('O') #endif #ifndef CDSUSP -#define CDSUSP CONTROL('Y') +#define CDSUSP CONTROL('Y') #endif #ifndef CEOF -#define CEOF CONTROL('D') +#define CEOF CONTROL('D') #endif #ifndef CEOL -#define CEOL 0 +#define CEOL 0xff /* was 0 */ +#endif +#ifndef CERASE +#define CERASE 0177 +#endif +#ifndef CERASE2 +#define CERASE2 CONTROL('H') #endif #ifndef CFLUSH -#define CFLUSH CONTROL('O') +#define CFLUSH CONTROL('O') #endif #ifndef CINTR -#define CINTR 0177 +#define CINTR CONTROL('C') #endif #ifndef CKILL -#define CKILL '@' +#define CKILL CTRL('U') /* was '@' */ #endif #ifndef CLNEXT -#define CLNEXT CONTROL('V') +#define CLNEXT CONTROL('V') #endif #ifndef CNUL -#define CNUL 0 +#define CNUL 0 #endif #ifndef CQUIT -#define CQUIT CONTROL('\\') +#define CQUIT CONTROL('\\') #endif #ifndef CRPRNT -#define CRPRNT CONTROL('R') +#define CRPRNT CONTROL('R') +#endif +#ifndef CREPRINT +#define CREPRINT CRPRNT #endif #ifndef CSTART -#define CSTART CONTROL('Q') +#define CSTART CONTROL('Q') +#endif +#ifndef CSTATUS +#define CSTATUS CONTROL('T') #endif #ifndef CSTOP -#define CSTOP CONTROL('S') +#define CSTOP CONTROL('S') #endif #ifndef CSUSP -#define CSUSP CONTROL('Z') +#define CSUSP CONTROL('Z') #endif #ifndef CSWTCH -#define CSWTCH 0 +#define CSWTCH 0 #endif #ifndef CWERASE -#define CWERASE CONTROL('W') +#define CWERASE CONTROL('W') #endif #ifdef USE_ANY_SYSV_TERMIO @@ -617,13 +633,13 @@ static struct jtchars d_jtc = * POSIX termios has termios.c_cc, which is similar to SVR4. */ #define TTYMODE(name) { name, sizeof(name)-1, 0, 0 } -static int override_tty_modes = 0; +static Boolean override_tty_modes = False; /* *INDENT-OFF* */ static struct _xttymodes { char *name; size_t len; int set; - Char value; + int value; } ttymodelist[] = { TTYMODE("intr"), /* tchars.t_intrc ; VINTR */ #define XTTYMODE_intr 0 @@ -665,6 +681,71 @@ static struct _xttymodes { #define XTTYMODE_eol2 18 { NULL, 0, 0, '\0' }, /* end of data */ }; + +#define validTtyChar(data, n) \ + (known_ttyChars[n].sysMode >= 0 && \ + known_ttyChars[n].sysMode < (int) XtNumber(data.c_cc)) + +static const struct { + int sysMode; + int myMode; + int myDefault; +} known_ttyChars[] = { +#ifdef VINTR + { VINTR, XTTYMODE_intr, CINTR }, +#endif +#ifdef VQUIT + { VQUIT, XTTYMODE_quit, CQUIT }, +#endif +#ifdef VERASE + { VERASE, XTTYMODE_erase, CERASE }, +#endif +#ifdef VKILL + { VKILL, XTTYMODE_kill, CKILL }, +#endif +#ifdef VEOF + { VEOF, XTTYMODE_eof, CEOF }, +#endif +#ifdef VEOL + { VEOL, XTTYMODE_eol, CEOL }, +#endif +#ifdef VSWTCH + { VSWTCH, XTTYMODE_swtch, CNUL }, +#endif +#ifdef VSTART + { VSTART, XTTYMODE_start, CSTART }, +#endif +#ifdef VSTOP + { VSTOP, XTTYMODE_stop, CSTOP }, +#endif +#ifdef VSUSP + { VSUSP, XTTYMODE_susp, CSUSP }, +#endif +#ifdef VDSUSP + { VDSUSP, XTTYMODE_dsusp, CDSUSP }, +#endif +#ifdef VREPRINT + { VREPRINT, XTTYMODE_rprnt, CREPRINT }, +#endif +#ifdef VDISCARD + { VDISCARD, XTTYMODE_flush, CDISCARD }, +#endif +#ifdef VWERASE + { VWERASE, XTTYMODE_weras, CWERASE }, +#endif +#ifdef VLNEXT + { VLNEXT, XTTYMODE_lnext, CLNEXT }, +#endif +#ifdef VSTATUS + { VSTATUS, XTTYMODE_status, CSTATUS }, +#endif +#ifdef VERASE2 + { VERASE2, XTTYMODE_erase2, CERASE2 }, +#endif +#ifdef VEOL2 + { VEOL2, XTTYMODE_eol2, CNUL }, +#endif +}; /* *INDENT-ON* */ #define TMODE(ind,var) if (ttymodelist[ind].set) var = ttymodelist[ind].value @@ -868,6 +949,8 @@ static XrmOptionDescRec optionDescList[] = { #endif #if OPT_HIGHLIGHT_COLOR {"-hc", "*highlightColor", XrmoptionSepArg, (caddr_t) NULL}, +{"-hm", "*highlightColorMode", XrmoptionNoArg, (caddr_t) "on"}, +{"+hm", "*highlightColorMode", XrmoptionNoArg, (caddr_t) "off"}, {"-selfg", "*highlightTextColor", XrmoptionSepArg, (caddr_t) NULL}, {"-selbg", "*highlightColor", XrmoptionSepArg, (caddr_t) NULL}, #endif @@ -1052,6 +1135,7 @@ static OptionHelp xtermOptions[] = { { "-/+cu", "turn on/off curses emulation" }, { "-/+dc", "turn off/on dynamic color selection" }, #if OPT_HIGHLIGHT_COLOR +{ "-/+hm", "turn on/off selection-color override" }, { "-selbg color", "selection background color" }, { "-selfg color", "selection foreground color" }, #endif @@ -1748,6 +1832,7 @@ main(int argc, char *argv[]ENVP_ARG) * of the various terminal structures (which may change from * implementation to implementation). */ + memset(&d_tio, 0, sizeof(d_tio)); d_tio.c_iflag = ICRNL | IXON; #ifdef TAB3 d_tio.c_oflag = OPOST | ONLCR | TAB3; @@ -1758,6 +1843,17 @@ main(int argc, char *argv[]ENVP_ARG) d_tio.c_oflag = OPOST; #endif #endif + { + Cardinal nn; + + /* fill in default-values */ + for (nn = 0; nn < XtNumber(known_ttyChars); ++nn) { + if (validTtyChar(d_tio, nn)) { + d_tio.c_cc[known_ttyChars[nn].sysMode] = + known_ttyChars[nn].myDefault; + } + } + } #if defined(macII) || defined(ATT) || defined(CRAY) /* { */ d_tio.c_cflag = VAL_LINE_SPEED | CS8 | CREAD | PARENB | HUPCL; d_tio.c_lflag = ISIG | ICANON | ECHO | ECHOE | ECHOK; @@ -1767,31 +1863,10 @@ main(int argc, char *argv[]ENVP_ARG) #ifdef ECHOCTL d_tio.c_lflag |= ECHOCTL | IEXTEN; #endif - #ifndef USE_TERMIOS /* { */ d_tio.c_line = 0; #endif /* } */ - - d_tio.c_cc[VINTR] = CINTR; - d_tio.c_cc[VQUIT] = CQUIT; - d_tio.c_cc[VERASE] = CERASE; - d_tio.c_cc[VKILL] = CKILL; - d_tio.c_cc[VEOF] = CEOF; - d_tio.c_cc[VEOL] = CNUL; - d_tio.c_cc[VEOL2] = CNUL; -#ifdef VSWTCH - d_tio.c_cc[VSWTCH] = CNUL; -#endif - #if defined(USE_TERMIOS) || defined(USE_POSIX_TERMIOS) /* { */ - d_tio.c_cc[VSUSP] = CSUSP; -#ifdef VDSUSP - d_tio.c_cc[VDSUSP] = CDSUSP; -#endif - d_tio.c_cc[VREPRINT] = CRPRNT; - d_tio.c_cc[VDISCARD] = CFLUSH; - d_tio.c_cc[VWERASE] = CWERASE; - d_tio.c_cc[VLNEXT] = CLNEXT; d_tio.c_cc[VMIN] = 1; d_tio.c_cc[VTIME] = 0; #endif /* } */ @@ -1839,102 +1914,20 @@ main(int argc, char *argv[]ENVP_ARG) #ifdef __MVS__ d_tio.c_cflag &= ~(HUPCL | PARENB); #endif - d_tio.c_cc[VINTR] = CONTROL('C'); /* '^C' */ - d_tio.c_cc[VERASE] = ANSI_DEL; /* DEL */ - d_tio.c_cc[VKILL] = CONTROL('U'); /* '^U' */ - d_tio.c_cc[VQUIT] = CQUIT; /* '^\' */ - d_tio.c_cc[VEOF] = CEOF; /* '^D' */ - d_tio.c_cc[VEOL] = CEOL; /* '^@' */ - d_tio.c_cc[VMIN] = 1; - d_tio.c_cc[VTIME] = 0; -#ifdef VSWTCH - d_tio.c_cc[VSWTCH] = CSWTCH; /* usually '^Z' */ -#endif -#ifdef VLNEXT - d_tio.c_cc[VLNEXT] = CLNEXT; -#endif -#ifdef VWERASE - d_tio.c_cc[VWERASE] = CWERASE; -#endif -#ifdef VREPRINT - d_tio.c_cc[VREPRINT] = CRPRNT; -#endif -#ifdef VRPRNT - d_tio.c_cc[VRPRNT] = CRPRNT; -#endif -#ifdef VDISCARD - d_tio.c_cc[VDISCARD] = CFLUSH; -#endif -#ifdef VFLUSHO - d_tio.c_cc[VFLUSHO] = CFLUSH; -#endif -#ifdef VSTOP - d_tio.c_cc[VSTOP] = CSTOP; -#endif -#ifdef VSTART - d_tio.c_cc[VSTART] = CSTART; -#endif -#ifdef VSUSP - d_tio.c_cc[VSUSP] = CSUSP; -#endif -#ifdef VDSUSP - d_tio.c_cc[VDSUSP] = CDSUSP; -#endif -#ifdef VSTATUS - d_tio.c_cc[VSTATUS] = CSTATUS; -#endif - /* now, try to inherit tty settings */ { + Cardinal nn; int i; + /* try to inherit tty settings */ for (i = 0; i <= 2; i++) { TERMIO_STRUCT deftio; if (ttyGetAttr(i, &deftio) == 0) { - d_tio.c_cc[VINTR] = deftio.c_cc[VINTR]; - d_tio.c_cc[VQUIT] = deftio.c_cc[VQUIT]; - d_tio.c_cc[VERASE] = deftio.c_cc[VERASE]; - d_tio.c_cc[VKILL] = deftio.c_cc[VKILL]; - d_tio.c_cc[VEOF] = deftio.c_cc[VEOF]; - d_tio.c_cc[VEOL] = deftio.c_cc[VEOL]; -#ifdef VSWTCH - d_tio.c_cc[VSWTCH] = deftio.c_cc[VSWTCH]; -#endif -#ifdef VEOL2 - d_tio.c_cc[VEOL2] = deftio.c_cc[VEOL2]; -#endif -#ifdef VLNEXT - d_tio.c_cc[VLNEXT] = deftio.c_cc[VLNEXT]; -#endif -#ifdef VWERASE - d_tio.c_cc[VWERASE] = deftio.c_cc[VWERASE]; -#endif -#ifdef VREPRINT - d_tio.c_cc[VREPRINT] = deftio.c_cc[VREPRINT]; -#endif -#ifdef VRPRNT - d_tio.c_cc[VRPRNT] = deftio.c_cc[VRPRNT]; -#endif -#ifdef VDISCARD - d_tio.c_cc[VDISCARD] = deftio.c_cc[VDISCARD]; -#endif -#ifdef VFLUSHO - d_tio.c_cc[VFLUSHO] = deftio.c_cc[VFLUSHO]; -#endif -#ifdef VSTOP - d_tio.c_cc[VSTOP] = deftio.c_cc[VSTOP]; -#endif -#ifdef VSTART - d_tio.c_cc[VSTART] = deftio.c_cc[VSTART]; -#endif -#ifdef VSUSP - d_tio.c_cc[VSUSP] = deftio.c_cc[VSUSP]; -#endif -#ifdef VDSUSP - d_tio.c_cc[VDSUSP] = deftio.c_cc[VDSUSP]; -#endif -#ifdef VSTATUS - d_tio.c_cc[VSTATUS] = deftio.c_cc[VSTATUS]; -#endif + for (nn = 0; nn < XtNumber(known_ttyChars); ++nn) { + if (validTtyChar(d_tio, nn)) { + d_tio.c_cc[known_ttyChars[nn].sysMode] = + deftio.c_cc[known_ttyChars[nn].sysMode]; + } + } break; } } @@ -1947,27 +1940,7 @@ main(int argc, char *argv[]ENVP_ARG) d_ltc.t_werasc = CharOf('\377'); d_ltc.t_lnextc = CharOf('\377'); #endif /* } HAS_LTCHARS */ -#if defined(USE_TERMIOS) || defined(USE_POSIX_TERMIOS) /* { */ - d_tio.c_cc[VSUSP] = CSUSP; -#ifdef VDSUSP - d_tio.c_cc[VDSUSP] = CharOf('\000'); -#endif -#ifdef VSTATUS - d_tio.c_cc[VSTATUS] = CharOf('\377'); -#endif -#ifdef VREPRINT - d_tio.c_cc[VREPRINT] = CharOf('\377'); -#endif -#ifdef VDISCARD - d_tio.c_cc[VDISCARD] = CharOf('\377'); -#endif -#ifdef VWERASE - d_tio.c_cc[VWERASE] = CharOf('\377'); -#endif -#ifdef VLNEXT - d_tio.c_cc[VLNEXT] = CharOf('\377'); -#endif -#endif /* } USE_TERMIOS */ + #ifdef TIOCLSET /* { */ d_lmode = 0; #endif /* } TIOCLSET */ @@ -2035,7 +2008,7 @@ main(int argc, char *argv[]ENVP_ARG) fprintf(stderr, "%s: bad tty modes \"%s\"\n", ProgramName, resource.tty_modes); } else if (n > 0) { - override_tty_modes = 1; + override_tty_modes = True; } } #if OPT_ZICONBEEP @@ -2401,13 +2374,9 @@ main(int argc, char *argv[]ENVP_ARG) if ((reversed && term->misc.re_verse0) && ((term->screen.Tcolors[TEXT_FG].resource - && (x_strcasecmp(term->screen.Tcolors[TEXT_FG].resource, - XtDefaultForeground) != 0) - ) + && !isDefaultForeground(term->screen.Tcolors[TEXT_FG].resource)) || (term->screen.Tcolors[TEXT_BG].resource - && (x_strcasecmp(term->screen.Tcolors[TEXT_BG].resource, - XtDefaultBackground) != 0) - ) + && !isDefaultBackground(term->screen.Tcolors[TEXT_BG].resource)) )) ReverseVideo(term); #endif /* OPT_COLOR_RES */ @@ -3001,6 +2970,7 @@ static int spawnXTerm(XtermWidget xw) { TScreen *screen = TScreenOf(xw); + Cardinal nn; #if OPT_PTY_HANDSHAKE Bool got_handshake_size = False; handshake_t handshake; @@ -3695,97 +3665,29 @@ spawnXTerm(XtermWidget xw) #ifdef ECHOCTL tio.c_lflag |= ECHOCTL | IEXTEN; #endif -#ifndef __MVS__ - /* reset EOL to default value */ - tio.c_cc[VEOL] = CEOL; /* '^@' */ - /* certain shells (ksh & csh) change EOF as well */ - tio.c_cc[VEOF] = CEOF; /* '^D' */ -#else - if (tio.c_cc[VEOL] == 0) - tio.c_cc[VEOL] = CEOL; /* '^@' */ - if (tio.c_cc[VEOF] == 0) - tio.c_cc[VEOF] = CEOF; /* '^D' */ -#endif -#ifdef VLNEXT - tio.c_cc[VLNEXT] = CLNEXT; -#endif -#ifdef VWERASE - tio.c_cc[VWERASE] = CWERASE; -#endif -#ifdef VREPRINT - tio.c_cc[VREPRINT] = CRPRNT; -#endif -#ifdef VRPRNT - tio.c_cc[VRPRNT] = CRPRNT; -#endif -#ifdef VDISCARD - tio.c_cc[VDISCARD] = CFLUSH; -#endif -#ifdef VFLUSHO - tio.c_cc[VFLUSHO] = CFLUSH; -#endif -#ifdef VSTOP - tio.c_cc[VSTOP] = CSTOP; -#endif -#ifdef VSTART - tio.c_cc[VSTART] = CSTART; -#endif -#ifdef VSUSP - tio.c_cc[VSUSP] = CSUSP; -#endif -#ifdef VDSUSP - tio.c_cc[VDSUSP] = CDSUSP; + for (nn = 0; nn < XtNumber(known_ttyChars); ++nn) { + if (validTtyChar(tio, nn)) { + int sysMode = known_ttyChars[nn].sysMode; +#ifdef __MVS__ + if (tio.c_cc[sysMode] != 0) { + switch (sysMode) { + case VEOL: + case VEOF: + continue; + } + } #endif + tio.c_cc[sysMode] = known_ttyChars[nn].myDefault; + } + } + if (override_tty_modes) { - /* sysv-specific */ - TMODE(XTTYMODE_intr, tio.c_cc[VINTR]); - TMODE(XTTYMODE_quit, tio.c_cc[VQUIT]); - TMODE(XTTYMODE_erase, tio.c_cc[VERASE]); - TMODE(XTTYMODE_kill, tio.c_cc[VKILL]); - TMODE(XTTYMODE_eof, tio.c_cc[VEOF]); - TMODE(XTTYMODE_eol, tio.c_cc[VEOL]); -#ifdef VSWTCH - TMODE(XTTYMODE_swtch, tio.c_cc[VSWTCH]); -#endif -#ifdef VSUSP - TMODE(XTTYMODE_susp, tio.c_cc[VSUSP]); -#endif -#ifdef VDSUSP - TMODE(XTTYMODE_dsusp, tio.c_cc[VDSUSP]); -#endif -#ifdef VREPRINT - TMODE(XTTYMODE_rprnt, tio.c_cc[VREPRINT]); -#endif -#ifdef VRPRNT - TMODE(XTTYMODE_rprnt, tio.c_cc[VRPRNT]); -#endif -#ifdef VDISCARD - TMODE(XTTYMODE_flush, tio.c_cc[VDISCARD]); -#endif -#ifdef VFLUSHO - TMODE(XTTYMODE_flush, tio.c_cc[VFLUSHO]); -#endif -#ifdef VWERASE - TMODE(XTTYMODE_weras, tio.c_cc[VWERASE]); -#endif -#ifdef VLNEXT - TMODE(XTTYMODE_lnext, tio.c_cc[VLNEXT]); -#endif -#ifdef VSTART - TMODE(XTTYMODE_start, tio.c_cc[VSTART]); -#endif -#ifdef VSTOP - TMODE(XTTYMODE_stop, tio.c_cc[VSTOP]); -#endif -#ifdef VSTATUS - TMODE(XTTYMODE_status, tio.c_cc[VSTATUS]); -#endif -#ifdef VERASE2 - TMODE(XTTYMODE_erase2, tio.c_cc[VERASE2]); -#endif -#ifdef VEOL2 - TMODE(XTTYMODE_eol2, tio.c_cc[VEOL2]); -#endif + for (nn = 0; nn < XtNumber(known_ttyChars); ++nn) { + if (validTtyChar(tio, nn)) { + TMODE(known_ttyChars[nn].myMode, + tio.c_cc[known_ttyChars[nn].sysMode]); + } + } #ifdef HAS_LTCHARS /* both SYSV and BSD have ltchars */ TMODE(XTTYMODE_susp, ltc.t_suspc); diff --git a/app/xterm/ptyx.h b/app/xterm/ptyx.h index 674ca9118..844758dda 100644 --- a/app/xterm/ptyx.h +++ b/app/xterm/ptyx.h @@ -1,9 +1,7 @@ -/* $XTermId: ptyx.h,v 1.494 2007/07/17 21:08:07 tom Exp $ */ - -/* $XFree86: xc/programs/xterm/ptyx.h,v 3.134 2006/06/19 00:36:51 dickey Exp $ */ +/* $XTermId: ptyx.h,v 1.510 2008/01/31 01:01:52 tom Exp $ */ /* - * Copyright 1999-2006,2007 by Thomas E. Dickey + * Copyright 1999-2007,2008 by Thomas E. Dickey * * All Rights Reserved * @@ -291,6 +289,8 @@ typedef struct { #define isSameCol(a,b) ((a)->col == (b)->col) #define isSameCELL(a,b) (isSameRow(a,b) && isSameCol(a,b)) +#define xBIT(n) (1 << (n)) + /* * ANSI emulation, special character codes */ @@ -1012,11 +1012,15 @@ extern int A2E(int); #if OPT_WIDE_CHARS #define if_OPT_WIDE_CHARS(screen, code) if(screen->wide_chars) code -#define PAIRED_CHARS(a,b) a,b +#define if_WIDE_OR_NARROW(screen, wide, narrow) if(screen->wide_chars) wide else narrow +#define PAIRED_CHARS(lo,hi) lo,hi +#define PACK_PAIR(lo,hi,n) (lo[n] | (hi ? (hi[n] << 8) : 0)) typedef unsigned IChar; /* for 8 or 16-bit characters, plus flag */ #else #define if_OPT_WIDE_CHARS(screen, code) /* nothing */ -#define PAIRED_CHARS(a,b) a +#define if_WIDE_OR_NARROW(screen, wide, narrow) narrow +#define PAIRED_CHARS(lo,hi) lo +#define PACK_PAIR(lo,hi,n) lo[n] typedef unsigned char IChar; /* for 8-bit characters */ #endif @@ -1306,6 +1310,7 @@ typedef struct { gid_t gid; /* group id of actual person */ ColorRes Tcolors[NCOLORS]; /* terminal colors */ #if OPT_HIGHLIGHT_COLOR + Boolean hilite_color; /* hilite colors override */ Boolean hilite_reverse; /* hilite overrides reverse */ #endif #if OPT_ISO_COLORS @@ -1353,7 +1358,7 @@ typedef struct { #if OPT_BROKEN_ST Boolean brokenStringTerm; /* true to match old OSC parse */ #endif -#if OPT_C1_PRINT +#if OPT_C1_PRINT || OPT_WIDE_CHARS Boolean c1_printable; /* true if we treat C1 as print */ #endif int border; /* inner border */ @@ -1362,6 +1367,7 @@ typedef struct { unsigned short send_mouse_pos; /* user wants mouse transition */ /* and position information */ Boolean send_focus_pos; /* user wants focus in/out info */ + Boolean quiet_grab; /* true if no cursor change on focus */ #if OPT_PASTE64 int base64_paste; /* set to send paste in base64 */ int base64_final; /* string-terminator for paste */ @@ -1423,7 +1429,10 @@ typedef struct { VTwin *whichVwin; #endif /* NO_ACTIVE_ICON */ - Cursor pointer_cursor; /* pointer cursor in window */ + int pointer_mode; /* when to use hidden_cursor */ + Boolean hide_pointer; /* true to use "hidden_cursor" */ + Cursor pointer_cursor; /* pointer cursor in window */ + Cursor hidden_cursor; /* hidden cursor in window */ String answer_back; /* response to ENQ */ String printer_command; /* pipe/shell command string */ @@ -1441,10 +1450,10 @@ typedef struct { #endif Dimension fnt_wide; Dimension fnt_high; - XFontStruct *fnts[fMAX]; /* normal/bold/etc for terminal */ + XTermFonts fnts[fMAX]; /* normal/bold/etc for terminal */ Boolean free_bold_box; /* same_font_size's austerity */ #ifndef NO_ACTIVE_ICON - XFontStruct *fnt_icon; /* icon font */ + XTermFonts fnt_icon; /* icon font */ #endif /* NO_ACTIVE_ICON */ int enbolden; /* overstrike for bold font */ XPoint *box; /* draw unselected cursor */ @@ -1610,6 +1619,7 @@ typedef struct { Boolean trim_selection; /* controls trimming of selection */ Boolean i18nSelections; Boolean brokenSelections; + Boolean keepSelection; /* do not lose selection on output */ Boolean replyToEmacs; /* Send emacs escape code when done selecting or extending? */ Char *selection_data; /* the current selection */ int selection_size; /* size of allocated buffer */ @@ -1754,6 +1764,12 @@ typedef enum { keyboardIsVT220 } xtermKeyboardType; +typedef enum { /* legal values for screen.pointer_mode */ + pNever = 0, + pNoMouse = 1, + pAlways = 2 +} pointerModeTypes; + typedef enum { /* legal values for screen.utf8_mode */ uFalse = 0, uTrue = 1, @@ -1938,18 +1954,18 @@ extern WidgetClass tekWidgetClass; #endif /* define masks for keyboard.flags */ -#define MODE_KAM 0x01 /* keyboard action mode */ -#define MODE_DECKPAM 0x02 /* keypad application mode */ -#define MODE_DECCKM 0x04 /* cursor keys */ -#define MODE_SRM 0x08 /* send-receive mode */ -#define MODE_DECBKM 0x10 /* backarrow */ +#define MODE_KAM xBIT(0) /* keyboard action mode */ +#define MODE_DECKPAM xBIT(1) /* keypad application mode */ +#define MODE_DECCKM xBIT(2) /* cursor keys */ +#define MODE_SRM xBIT(3) /* send-receive mode */ +#define MODE_DECBKM xBIT(4) /* backarrow */ #define N_MARGINBELL 10 -#define TAB_BITS_SHIFT 5 /* 2**5 == 32 */ +#define TAB_BITS_SHIFT 5 /* FIXME: 2**5 == 32 (should derive) */ #define TAB_BITS_WIDTH (1 << TAB_BITS_SHIFT) -#define TAB_ARRAY_SIZE 10 /* number of ints to provide MAX_TABS bits */ +#define TAB_ARRAY_SIZE (1024 / TAB_BITS_WIDTH) #define MAX_TABS (TAB_BITS_WIDTH * TAB_ARRAY_SIZE) typedef unsigned Tabs [TAB_ARRAY_SIZE]; @@ -1997,20 +2013,61 @@ typedef struct _TekWidgetRec { * term->flags and screen->save_modes. This need only fit in an unsigned. */ +#define AttrBIT(n) xBIT(n) /* text-attributes */ +#define DrawBIT(n) xBIT(n + 8) /* drawXtermText flags */ +#define MiscBIT(n) xBIT(n + 16) /* miscellaneous state flags */ + /* global flags and character flags (visible character attributes) */ -#define INVERSE 0x01 /* invert the characters to be output */ -#define UNDERLINE 0x02 /* true if underlining */ -#define BOLD 0x04 -#define BLINK 0x08 +#define INVERSE AttrBIT(0) /* invert the characters to be output */ +#define UNDERLINE AttrBIT(1) /* true if underlining */ +#define BOLD AttrBIT(2) +#define BLINK AttrBIT(3) /* global flags (also character attributes) */ -#define BG_COLOR 0x10 /* true if background set */ -#define FG_COLOR 0x20 /* true if foreground set */ +#define BG_COLOR AttrBIT(4) /* true if background set */ +#define FG_COLOR AttrBIT(5) /* true if foreground set */ /* character flags (internal attributes) */ -#define PROTECTED 0x40 /* a character is drawn that cannot be erased */ -#define CHARDRAWN 0x80 /* a character has been drawn here on the - screen. Used to distinguish blanks from - empty parts of the screen when selecting */ +#define PROTECTED AttrBIT(6) /* a character that cannot be erased */ +#define CHARDRAWN AttrBIT(7) /* a character has been drawn here on + the screen. Used to distinguish + blanks from empty parts of the + screen when selecting */ + +/* The following attributes are used in the argument of drawXtermText() */ +#define NOBACKGROUND DrawBIT(0) /* Used for overstrike */ +#define NOTRANSLATION DrawBIT(1) /* No scan for chars missing in font */ +#define DOUBLEWFONT DrawBIT(2) /* The actual X-font is double-width */ +#define DOUBLEHFONT DrawBIT(3) /* The actual X-font is double-height */ +#define CHARBYCHAR DrawBIT(4) /* Draw chars one-by-one */ + +/* The following attribute is used in the argument of xtermSpecialFont etc */ +#define NORESOLUTION DrawBIT(5) /* find the font without resolution */ + +/* + * Other flags + */ +#define WRAPAROUND MiscBIT(0) /* true if auto wraparound mode */ +#define REVERSEWRAP MiscBIT(1) /* true if reverse wraparound mode */ +#define REVERSE_VIDEO MiscBIT(2) /* true if screen white on black */ +#define LINEFEED MiscBIT(3) /* true if in auto linefeed mode */ +#define ORIGIN MiscBIT(4) /* true if in origin mode */ +#define INSERT MiscBIT(5) /* true if in insert mode */ +#define SMOOTHSCROLL MiscBIT(6) /* true if in smooth scroll mode */ +#define IN132COLUMNS MiscBIT(7) /* true if in 132 column mode */ +#define INVISIBLE MiscBIT(8) /* true if writing invisible text */ +#define NATIONAL MiscBIT(9) /* true if writing national charset */ + +/* + * Groups of attributes + */ + /* mask for video-attributes only */ +#define SGR_MASK (BOLD | BLINK | UNDERLINE | INVERSE) + + /* mask: user-visible attributes */ +#define ATTRIBUTES (SGR_MASK | BG_COLOR | FG_COLOR | INVISIBLE | PROTECTED) + +/* The toplevel-call to drawXtermText() should have text-attributes guarded: */ +#define DRAWX_MASK (ATTRIBUTES | CHARDRAWN) #if OPT_BLINK_TEXT #define BOLDATTR(screen) (BOLD | ((screen)->blink_as_bold ? BLINK : 0)) @@ -2018,37 +2075,6 @@ typedef struct _TekWidgetRec { #define BOLDATTR(screen) (BOLD | BLINK) #endif -/* The following attributes make sense in the argument of drawXtermText() */ -#define NOBACKGROUND 0x100 /* Used for overstrike */ -#define NOTRANSLATION 0x200 /* No scan for chars missing in font */ -#define NATIVEENCODING 0x400 /* strings are in the font encoding */ -#define DOUBLEWFONT 0x800 /* The actual X-font is double-width */ -#define DOUBLEHFONT 0x1000 /* The actual X-font is double-height */ -#define CHARBYCHAR 0x2000 /* Draw chars one-by-one */ - -/* The toplevel-call to drawXtermText() should have text-attributes guarded: */ -#define DRAWX_MASK 0xff /* text flags should be bitand'ed */ - -/* The following attribute makes sense in the argument of xtermSpecialFont etc */ -#define NORESOLUTION 0x800000 /* find the font without resolution */ - - /* mask: user-visible attributes */ -#define ATTRIBUTES (INVERSE|UNDERLINE|BOLD|BLINK|BG_COLOR|FG_COLOR|INVISIBLE|PROTECTED) - - /* mask for video-attributes only */ -#define SGR_MASK (BOLD|BLINK|UNDERLINE|INVERSE) - -#define WRAPAROUND 0x400 /* true if auto wraparound mode */ -#define REVERSEWRAP 0x800 /* true if reverse wraparound mode */ -#define REVERSE_VIDEO 0x1000 /* true if screen white on black */ -#define LINEFEED 0x2000 /* true if in auto linefeed mode */ -#define ORIGIN 0x4000 /* true if in origin mode */ -#define INSERT 0x8000 /* true if in insert mode */ -#define SMOOTHSCROLL 0x10000 /* true if in smooth scroll mode */ -#define IN132COLUMNS 0x20000 /* true if in 132 column mode */ -#define INVISIBLE 0x40000 /* true if writing invisible text */ -#define NATIONAL 0x100000 /* true if writing national charset */ - /* * Per-line flags */ @@ -2106,11 +2132,11 @@ typedef struct _TekWidgetRec { #define WhichVWin(screen) ((screen)->whichVwin) #define WhichTWin(screen) ((screen)->whichTwin) -#define WhichVFont(screen,name) (IsIcon(screen) ? (screen)->fnt_icon \ +#define WhichVFont(screen,name) (IsIcon(screen) ? (screen)->fnt_icon.fs \ : (screen)->name) -#define FontAscent(screen) (IsIcon(screen) ? (screen)->fnt_icon->ascent \ +#define FontAscent(screen) (IsIcon(screen) ? (screen)->fnt_icon.fs->ascent \ : WhichVWin(screen)->f_ascent) -#define FontDescent(screen) (IsIcon(screen) ? (screen)->fnt_icon->descent \ +#define FontDescent(screen) (IsIcon(screen) ? (screen)->fnt_icon.fs->descent \ : WhichVWin(screen)->f_descent) #else /* NO_ACTIVE_ICON */ @@ -2147,12 +2173,12 @@ typedef struct _TekWidgetRec { #define FontWidth(screen) WhichVWin(screen)->f_width #define FontHeight(screen) WhichVWin(screen)->f_height -#define NormalFont(screen) WhichVFont(screen, fnts[fNorm]) -#define BoldFont(screen) WhichVFont(screen, fnts[fBold]) +#define NormalFont(screen) WhichVFont(screen, fnts[fNorm].fs) +#define BoldFont(screen) WhichVFont(screen, fnts[fBold].fs) #if OPT_WIDE_CHARS -#define NormalWFont(screen) WhichVFont(screen, fnts[fWide]) -#define BoldWFont(screen) WhichVFont(screen, fnts[fWBold]) +#define NormalWFont(screen) WhichVFont(screen, fnts[fWide].fs) +#define BoldWFont(screen) WhichVFont(screen, fnts[fWBold].fs) #endif #define ScrollbarWidth(screen) WhichVWin(screen)->sb_info.width diff --git a/app/xterm/uxterm b/app/xterm/uxterm index 16d99fbad..1e0ea97c8 100644 --- a/app/xterm/uxterm +++ b/app/xterm/uxterm @@ -1,8 +1,10 @@ #!/bin/sh -# $XTermId: uxterm,v 1.23 2006/01/04 02:10:27 tom Exp $ -# $XFree86: xc/programs/xterm/uxterm,v 1.12 2006/01/04 02:10:27 dickey Exp $ +# $XTermId: uxterm,v 1.25 2007/12/30 16:33:36 tom Exp $ +# # wrapper script to setup xterm with UTF-8 locale +whoami=uxterm + : ${XTERM_PROGRAM=xterm} # Check if there is a workable locale program. If there is not, we will read @@ -66,9 +68,9 @@ if test $found != yes ; then eval ${name}=${save} eval export ${name} - echo "uxterm tried to use locale $value by setting \$$name" >&2 + echo "$whoami tried to use locale $value by setting \$$name" >&2 xmessage -file - <<EOF -uxterm tried unsuccessfully to use locale $value +$whoami tried unsuccessfully to use locale $value by setting \$$name to "${value}". EOF exit 1 @@ -79,4 +81,4 @@ fi # for testing: #test -f ./xterm && XTERM_PROGRAM=./xterm -exec $XTERM_PROGRAM -class UXTerm -title 'uxterm' -en UTF-8 "$@" +exec $XTERM_PROGRAM -class UXTerm -title $whoami -en UTF-8 "$@" diff --git a/app/xterm/version.h b/app/xterm/version.h index e29f71ad0..ab02065ba 100644 --- a/app/xterm/version.h +++ b/app/xterm/version.h @@ -1,4 +1,4 @@ -/* $XTermId: version.h,v 1.285 2007/08/12 15:37:19 tom Exp $ */ +/* $XTermId: version.h,v 1.288 2008/01/06 22:36:16 tom Exp $ */ /* * These definitions are used to build the string that's printed in response to @@ -6,7 +6,7 @@ * version of X to which this version of xterm has been built. The number in * parentheses is my patch number (Thomas E. Dickey). */ -#define XTERM_PATCH 229 +#define XTERM_PATCH 232 #ifndef __vendorversion__ #define __vendorversion__ "XTerm/OpenBSD" diff --git a/app/xterm/xterm.h b/app/xterm/xterm.h index 01e17b77d..4e92f18e4 100644 --- a/app/xterm/xterm.h +++ b/app/xterm/xterm.h @@ -1,10 +1,8 @@ -/* $XTermId: xterm.h,v 1.482 2007/07/22 20:14:48 tom Exp $ */ - -/* $XFree86: xc/programs/xterm/xterm.h,v 3.117 2006/06/19 00:36:52 dickey Exp $ */ +/* $XTermId: xterm.h,v 1.498 2008/01/30 00:50:07 tom Exp $ */ /************************************************************ -Copyright 1999-2006,2007 by Thomas E. Dickey +Copyright 1999-2007,2008 by Thomas E. Dickey All Rights Reserved @@ -334,6 +332,8 @@ extern char **environ; #define XK_Fn(n) (XK_F1 + (n) - 1) +#define Maybe 2 + /***====================================================================***/ #define XtNallowC1Printable "allowC1Printable" @@ -399,6 +399,7 @@ extern char **environ; #define XtNforceBoxChars "forceBoxChars" #define XtNfreeBoldBox "freeBoldBox" #define XtNhighlightColor "highlightColor" +#define XtNhighlightColorMode "highlightColorMode" #define XtNhighlightReverse "highlightReverse" #define XtNhighlightSelection "highlightSelection" #define XtNhighlightTextColor "highlightTextColor" @@ -408,6 +409,7 @@ extern char **environ; #define XtNinternalBorder "internalBorder" #define XtNitalicULMode "italicULMode" #define XtNjumpScroll "jumpScroll" +#define XtNkeepSelection "keepSelection" #define XtNkeyboardDialect "keyboardDialect" #define XtNlimitResize "limitResize" #define XtNlocale "locale" @@ -433,6 +435,7 @@ extern char **environ; #define XtNnMarginBell "nMarginBell" #define XtNnumLock "numLock" #define XtNoldXtermFKeys "oldXtermFKeys" +#define XtNpointerMode "pointerMode" #define XtNpointerColor "pointerColor" #define XtNpointerColorBackground "pointerColorBackground" #define XtNpointerShape "pointerShape" @@ -443,6 +446,7 @@ extern char **environ; #define XtNprinterControlMode "printerControlMode" #define XtNprinterExtent "printerExtent" #define XtNprinterFormFeed "printerFormFeed" +#define XtNquietGrab "quietGrab" #define XtNrenderFont "renderFont" #define XtNresizeGravity "resizeGravity" #define XtNreverseWrap "reverseWrap" @@ -542,12 +546,14 @@ extern char **environ; #define XtCFontStyle "FontStyle" #define XtCForceBoxChars "ForceBoxChars" #define XtCFreeBoldBox "FreeBoldBox" +#define XtCHighlightColorMode "HighlightColorMode" #define XtCHighlightReverse "HighlightReverse" #define XtCHighlightSelection "HighlightSelection" #define XtCHpLowerleftBugCompat "HpLowerleftBugCompat" #define XtCI18nSelections "I18nSelections" #define XtCInitialFont "InitialFont" #define XtCJumpScroll "JumpScroll" +#define XtCKeepSelection "KeepSelection" #define XtCKeyboardDialect "KeyboardDialect" #define XtCLimitResize "LimitResize" #define XtCLocale "Locale" @@ -572,6 +578,7 @@ extern char **environ; #define XtCMultiScroll "MultiScroll" #define XtCNumLock "NumLock" #define XtCOldXtermFKeys "OldXtermFKeys" +#define XtCPointerMode "PointerMode" #define XtCPopOnBell "PopOnBell" #define XtCPrintAttributes "PrintAttributes" #define XtCPrinterAutoClose "PrinterAutoClose" @@ -579,6 +586,7 @@ extern char **environ; #define XtCPrinterControlMode "PrinterControlMode" #define XtCPrinterExtent "PrinterExtent" #define XtCPrinterFormFeed "PrinterFormFeed" +#define XtCQuietGrab "QuietGrab" #define XtCRenderFont "RenderFont" #define XtCResizeGravity "ResizeGravity" #define XtCReverseWrap "ReverseWrap" @@ -678,6 +686,7 @@ extern void TekSimulatePageButton (TekWidget /* tw */, Bool /* reset */); extern Bool SendMousePosition (XtermWidget /* w */, XEvent* /* event */); extern void DiredButton PROTO_XT_ACTIONS_ARGS; extern void DisownSelection (XtermWidget /* termw */); +extern void UnhiliteSelection (XtermWidget /* termw */); extern void HandleInsertSelection PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectEnd PROTO_XT_ACTIONS_ARGS; extern void HandleKeyboardSelectExtend PROTO_XT_ACTIONS_ARGS; @@ -725,13 +734,13 @@ extern GC freeCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/); extern GC getCgsGC(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/); extern Pixel getCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/); extern Pixel getCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/); -extern XFontStruct * getCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/); -extern void clrCgsFonts(XtermWidget /*xw*/, VTwin * /*cgsWin*/, XFontStruct * /*font*/); +extern XTermFonts * getCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, GC /*gc*/); +extern void clrCgsFonts(XtermWidget /*xw*/, VTwin * /*cgsWin*/, XTermFonts * /*font*/); extern void copyCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/); extern void redoCgs(XtermWidget /*xw*/, Pixel /*fg*/, Pixel /*bg*/, CgsEnum /*cgsId*/); extern void setCgsBack(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*bg*/); extern void setCgsCSet(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, unsigned /*cset*/); -extern void setCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XFontStruct * /*font*/); +extern void setCgsFont(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, XTermFonts * /*font*/); extern void setCgsFore(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*cgsId*/, Pixel /*fg*/); extern void swapCgs(XtermWidget /*xw*/, VTwin * /*cgsWin*/, CgsEnum /*dstCgsId*/, CgsEnum /*srcCgsId*/); @@ -742,7 +751,7 @@ extern void noleaks_cachedCgs (XtermWidget /* xw */); /* charproc.c */ extern int VTInit (void); extern int v_write (int /* f */, Char * /* d */, unsigned /* len */); -extern void FindFontSelection (XtermWidget /* xw */, char * /* atom_name */, Bool /* justprobe */); +extern void FindFontSelection (XtermWidget /* xw */, const char * /* atom_name */, Bool /* justprobe */); extern void HideCursor (void); extern void ShowCursor (void); extern void SwitchBufPtrs (TScreen * /* screen */); @@ -810,10 +819,12 @@ extern void xterm_DECSWL (XtermWidget /* xw */); extern void xterm_DECDWL (XtermWidget /* xw */); #if OPT_DEC_CHRSET extern int xterm_Double_index(XtermWidget /* xw */, unsigned /* chrset */, unsigned /* flags */); -extern GC xterm_DoubleGC(XtermWidget /* xw */, unsigned /* chrset */, unsigned /* flags */, GC /* old_gc */); +extern GC xterm_DoubleGC(XtermWidget /* xw */, unsigned /* chrset */, unsigned /* flags */, GC /* old_gc */, int * /* inxp */); #endif /* input.c */ +extern int xtermParamToState (XtermWidget /* xw */, unsigned /* param */); +extern int xtermStateToParam (XtermWidget /* xw */, unsigned /* state */); extern Bool xtermDeleteIsDEL (XtermWidget /* xw */); extern void Input (XtermWidget /* xw */, XKeyEvent */* event */, Bool /* eightbit */); extern void StringInput (XtermWidget /* xw */, Char * /* string */, size_t /* nbytes */); @@ -910,7 +921,9 @@ extern void timestamp_filename(char * /* dst */, const char * /* src */); extern void xevents (void); extern void xt_error (String /* message */); extern void xtermCopyEnv (char ** /* oldenv */); +extern void xtermDisplayCursor (XtermWidget /* xw */); extern void xtermSetenv (char * /* var */, char * /* value */); +extern void xtermShowPointer (XtermWidget /* xw */, Bool /* enable */); #if OPT_DABBREV extern void HandleDabbrevExpand PROTO_XT_ACTIONS_ARGS; @@ -992,7 +1005,7 @@ extern void ScrnClearCells (XtermWidget /* xw */, int /* row */, int /* col */, extern void ScrnDeleteChar (XtermWidget /* xw */, unsigned /* n */); extern void ScrnDeleteLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* n */, int /* last */, unsigned /* size */, unsigned /* where */); extern void ScrnDisownSelection (XtermWidget /* xw */); -extern void ScrnFillRectangle (XtermWidget /* xw */, XTermRect *, int , unsigned); +extern void ScrnFillRectangle (XtermWidget /* xw */, XTermRect *, int , unsigned /* flags */, Bool /* keepColors */); extern void ScrnInsertChar (XtermWidget /* xw */, unsigned /* n */); extern void ScrnInsertLine (XtermWidget /* xw */, ScrnBuf /* sb */, int /* last */, int /* where */, unsigned /* n */, unsigned /* size */); extern void ScrnRefresh (XtermWidget /* xw */, int /* toprow */, int /* leftcol */, int /* nrows */, int /* ncols */, Bool /* force */); @@ -1080,6 +1093,8 @@ extern void TabSet (Tabs /* tabs */, int /* col */); extern void TabZonk (Tabs /* tabs */); /* util.c */ +extern Boolean isDefaultBackground(const char * /* name */); +extern Boolean isDefaultForeground(const char * /* name */); extern GC updatedXtermGC (XtermWidget /* xw */, unsigned /* flags */, unsigned /* fg_bg */, Bool /* hilite */); extern int AddToRefresh (XtermWidget /* xw */); extern int ClearInLine (XtermWidget /* xw */, int /* row */, int /* col */, unsigned /* len */); @@ -1220,6 +1235,7 @@ extern void putXtermCell (TScreen * /* screen */, int /* row */, int /* col */ #endif #if OPT_WIDE_CHARS +extern Boolean isWideControl(unsigned /* ch */); extern int DamagedCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */, int /* row */, int /* col */); extern int DamagedCurCells(TScreen * /* screen */, unsigned /* n */, int * /* klp */, int * /* krp */); extern unsigned AsciiEquivs(unsigned /* ch */); @@ -1239,7 +1255,7 @@ unsigned visual_width(PAIRED_CHARS(Char * /* str */, Char * /* str2 */), Cardina #define visual_width(a, b) (b) #endif -#define BtoS(b) ((b) ? "on" : "off") +#define BtoS(b) (((b) == Maybe) ? "maybe" : ((b) ? "on" : "off")) #define NonNull(s) ((s) ? (s) : "<null>") #ifdef __cplusplus diff --git a/app/xterm/xterm.man b/app/xterm/xterm.man index 1c5e7d3f4..26bdff7fe 100644 --- a/app/xterm/xterm.man +++ b/app/xterm/xterm.man @@ -1,7 +1,7 @@ '\" t -.\" $XTermId: xterm.man,v 1.392 2007/07/22 17:14:09 tom Exp $ +.\" $XTermId: xterm.man,v 1.405 2008/01/27 17:37:46 tom Exp $ .\" -.\" Copyright 1996-2006,2007 by Thomas E. Dickey +.\" Copyright 1996-2007,2008 by Thomas E. Dickey .\" .\" All Rights Reserved .\" @@ -54,8 +54,6 @@ .\" other dealings in this Software without prior written authorization .\" from The Open Group. .\" -.\" $XFree86: xc/programs/xterm/xterm.man,v 3.126 2006/06/20 00:42:38 dickey Exp $ -.\" .\" updated by Thomas E. Dickey for XFree86, July 1996 - February 2006. . .de DS @@ -527,6 +525,18 @@ This option indicates that HP Function Key escape codes should not be generated for function keys. It sets the \fBhpFunctionKeys\fP resource to ``false''. .TP 8 +.BI -hm +Tells \fIxterm\fP to use +\fBhighlightTextColor\fP and \fBhighlightColor\fP +to override the reversed foreground/background colors in a selection. +It sets the \fBhighlightColorMode\fP resource to ``true''. +.TP 8 +.BI +hm +Tells \fIxterm\fP not to use +\fBhighlightTextColor\fP and \fBhighlightColor\fP +to override the reversed foreground/background colors in a selection. +It sets the \fBhighlightColorMode\fP resource to ``false''. +.TP 8 .BI -hold Turn on the \fBhold\fP resource, i.e., \fIxterm\fP will not immediately destroy its window when the shell command completes. @@ -1092,7 +1102,7 @@ It sets the \fBborderWidth\fP resource of the shell widget, and may provide advice to your window manager to set the thickness of the window frame. Most window managers do not use this information. -See the \fB-b\fP option, which controls the inner border of the \fBxterm\fP +See the \fB-b\fP option, which controls the inner border of the \fIxterm\fP window. .TP 8 .B -display \fIdisplay\fP @@ -2029,7 +2039,8 @@ When using an ISO-10646-1 font and the \fBwideChars\fP resource is true, .IP If ``false'', \fIxterm\fP checks for missing glyphs in the font and makes line-drawing characters directly as needed. -If ``true'', \fIxterm\fP uses whatever is in the font without checking. +If ``true'', \fIxterm\fP assumes the font does not contain the +line-drawing characters, and draws them directly. The default is ``false.'' .TP 8 .B "foreground (\fPclass\fB Foreground)" @@ -2056,6 +2067,69 @@ Specifies the color to use for the background of selected (highlighted) text. If not specified (i.e., matching the default foreground), reverse video is used. The default is ``XtDefaultForeground.'' .TP 8 +.B "highlightColorMode (\fPclass\fB HighlightColorMode)" +Specifies whether \fIxterm\fP should use +\fBhighlightTextColor\fP and \fBhighlightColor\fP +to override the reversed foreground/background colors in a selection. +The default is unspecified: +at startup, \fIxterm\fP checks if those resources are set to something +other than the default foreground and background colors. +Setting this resource disables the check. +.IP +The following table shows the interaction of the highlighting +resources, abbreviated as shown to fit in this page: +.RS +.TP 3 +HCM +highlightColorMode +.TP 3 +HR +highlightReverse +.TP 3 +HBG +highlightColor +.TP 3 +HFG +highlightTextColor +.RE +.IP +.TS +l l l l l +_ _ _ _ _ +l l l l l. +\fIHCM\fR \fIHR\fR \fIHBG\fR \fIHFG\fR \fIHighlight\fP +false false default default bg/fg\"0 +false false default set bg/fg\"1 +false false set default fg/HBG\"2 +false false set set fg/HBG\"3 += +false true default default bg/fg\"4 +false true default set bg/fg\"5 +false true set default fg/HBG\"6 +false true set set fg/HBG\"7 += +true false default default bg/fg\"8 +true false default set HFG/fg\"9 +true false set default bg/HBG\"10 +true false set set HFG/HBG\"11 += +true true default default fg/fg (useless)\"12 +true true default set HFG/fg\"13 +true true set default fg/HBG\"14 +true true set set HFG/HBG\"15 += +default false default default bg/fg\"16 +default false default set bg/fg\"17 +default false set default fg/HBG\"18 +default false set set HFG/HBG\"19 += +default true default default bg/fg\"20 +default true default set bg/fg\"21 +default true set default fg/HBG\"22 +default true set set HFG/HBG\"23 += +.TE +.TP 8 .B "highlightReverse (\fPclass\fB HighlightReverse)" Specifies whether \fIxterm\fP should reverse the selection foreground and background colors when selecting text with reverse-video attribute. @@ -2063,6 +2137,7 @@ This applies only to the \fBhighlightColor\fP and \fBhighlightTextColor\fP resources, e.g., to match the color scheme of \fIxwsh\fP. If ``true'', \fIxterm\fP reverses the colors, +If ``false'', \fIxterm\fP does not reverse colors, The default is ``true.'' .TP 8 .B "highlightSelection (\fPclass\fB HighlightSelection)" @@ -2138,6 +2213,11 @@ Specifies whether or not jump scroll should be used. This corresponds to the VT102 DECSCLM private mode. The default is ``true.'' .TP 8 +.B "keepSelection (\fPclass\fB KeepSelection)" +Specifies whether \fIxterm\fR will keep the selection even after the +selected area was touched by some output to the terminal. +The default is ``false''. +.TP 8 .B "keyboardDialect (\fPclass\fB KeyboardDialect)" Specifies the initial keyboard dialect, as well as the default value when the terminal is reset. @@ -2438,6 +2518,23 @@ Specifies the background color of the pointer. The default is ``XtDefaultBackground.'' .TP 8 +.B "pointerMode (\fPclass\fB PointerMode)" +Specifies when the pointer may be hidden as the user types. +It will be redisplayed if the user moves the mouse, +or clicks one of its buttons. +.RS +.TP 3 +0 +never +.TP 3 +1 +the application running in \fIxterm\fP has not activated mouse mode. +This is the default. +.TP 3 +2 +always. +.RE +.TP 8 .B "pointerShape (\fPclass\fB Cursor)" Specifies the name of the shape of the pointer. The default is ``xterm.'' @@ -2490,6 +2587,12 @@ Controls whether a form feed is sent to the printer at the end of a print page function. The default is ``false.'' .TP 8 +.B "quietGrab (\fPclass\fB QuietGrab)" +Controls whether the cursor is repainted +when \fINotifyGrab\fP and \fINotifyUngrab\fP +event types are received during change of focus. +The default is ``false.'' +.TP 8 .B "renderFont (\fPclass\fB RenderFont)" If \fIxterm\fR is built with the Xft library, this controls whether the \fBfaceName\fR resource is used. @@ -3474,6 +3577,18 @@ option and the resource. . .TP +Keep Selection (keepSelection) +Tell \fIxterm\fP whether to disown the selection when it stops highlighting it, +e.g., when an application modifies the display so that it no longer matches +the text which has been highlighted. +As long as \fIxterm\fP continues to own the selection, +it can provide the corresponding text to other clients via cut/paste. +This corresponds to the +.B keepSelection +resource. +There is no corresponding command-line option. +. +.TP Select to Clipboard (selectToClipboard) Tell \fIxterm\fP whether to use the PRIMARY or CLIPBOARD for SELECT tokens in the \fBtranslations\fP resource which @@ -4214,6 +4329,10 @@ This action toggles the \fIxterm\fR's state regarding whether the current font has line-drawing characters and whether it should draw them directly. It is also invoked by the \fBfont-linedrawing\fP entry in \fIfontMenu\fP. .TP 8 +.B "set-keep-selection(\fIon/off/toggle\fP)" +This action toggles the \fBkeepSelection\fP resource and is also invoked by +the \fBkeepSelection\fP entry in \fIvtMenu\fP. +.TP 8 .B "set-logging()" This action toggles the state of the logging option. .TP 8 diff --git a/app/xterm/xtermcfg.h b/app/xterm/xtermcfg.h index 6664e6cdb..bc24dc2fb 100644 --- a/app/xterm/xtermcfg.h +++ b/app/xterm/xtermcfg.h @@ -69,6 +69,7 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #define HAVE_TERMIOS_H 1 /* AC_CHECK_HEADERS(termios.h) */ /* #undef HAVE_TERMIO_C_ISPEED */ /* CF_TERMIO_C_ISPEED */ #define HAVE_TERM_H 1 /* AC_CHECK_HEADERS(term.h) */ +#define HAVE_TIGETSTR 1 /* AC_CHECK_FUNCS(tigetstr) */ #define HAVE_UNISTD_H 1 /* AC_CHECK_HEADERS(unistd.h) */ #define HAVE_UTMP 1 /* CF_UTMP */ #define HAVE_UTMP_UT_HOST 1 /* CF_UTMP_UT_HOST */ |