INSTALL | 23 +- KOI8RXTerm.ad | 20 ++ MANIFEST | 6 Makefile.in | 33 ++- VTparse.def | 6 XTerm.ad | 4 button.c | 39 +++- charproc.c | 116 ++++++++---- configure | 169 ++++++++++++------ configure.in | 23 +- ctlseqs.ms | 25 +- ctlseqs.txt | 16 + doublechr.c | 139 +++++++++------ fontutils.c | 84 +++------ fontutils.h | 11 - gen-pc-fkeys.pl | 50 +++-- input.c | 64 +++++- koi8rxterm | 84 +++++++++ koi8rxterm.man | 97 ++++++++++ main.c | 15 - main.h | 6 menu.c | 255 +++++++++++++++++++++------ menu.h | 6 misc.c | 108 ++++++++++- os2main.c | 15 - ptyx.h | 123 +++++++------ resize.c | 14 - screen.c | 172 +++++++++++------- termcap | 26 +- terminfo | 321 ++++++++++++++++++++++++++++++++-- trace.c | 32 ++- trace.h | 11 - util.c | 468 +++++++++++++++++++++++++++++++++++---------------- uxterm | 12 - uxterm.desktop | 4 uxterm.man | 91 +++++++++ version.h | 4 vttests/tcapquery.pl | 98 ++++++++-- xterm.desktop | 4 xterm.h | 29 ++- xterm.log.html | 119 ++++++++++++ xterm.man | 110 +++++++++++ xtermcap.c | 288 ++++++++++++++++++------------- xtermcap.h | 13 + xtermcfg.hin | 3 45 files changed, 2498 insertions(+), 858 deletions(-)
New commits: commit ddd58d3dddabcdc86ed00c39dfd716fae1a3eeba Author: Julien Cristau <[EMAIL PROTECTED]> Date: Wed Jan 2 19:58:27 2008 +0100 Import xterm-230. diff --git a/INSTALL b/INSTALL index 70c89c8..c1a550f 100644 --- a/INSTALL +++ b/INSTALL @@ -1,5 +1,4 @@ --- $XTermId: INSTALL,v 1.115 2007/06/17 13:44:39 tom Exp $ --- $XFree86: xc/programs/xterm/INSTALL,v 3.42 2006/02/13 01:14:57 dickey Exp $ +-- $XTermId: INSTALL,v 1.117 2007/12/12 01:30:43 tom Exp $ ------------------------------------------------------------------------------- -- Copyright 1997-2006,2007 by Thomas E. Dickey -- @@ -228,6 +227,10 @@ The options (in alphabetic order): match the parent's. In particular, it addresses a problem where the terminal size is not defined in the stty settings. + --disable-rectangles disable VT420 rectangle support + + Do not compile-in code to support VT420 rectangle control-sequences. + --disable-regex disable regular-expression selections Do not compile-in code to support the "regex" option for multiple @@ -267,6 +270,12 @@ The options (in alphabetic order): Do not compile-in code to support Sun-style function keys. + --disable-tcap-fkeys disable termcap function-keys + + Compile-in code to support feature which allows xterm to use the + function-key definitions from the termcap/terminfo entry which it used + to set the $TERM variable on startup. + --disable-tek4014 disable tek4014 emulation Do not compile-in code to support Tektronix 4014 emulation. @@ -406,10 +415,6 @@ The options (in alphabetic order): (See --enable-paste64, which fits xterm's protocol better). - --enable-rectangles enable VT420 rectangle support - - Compile-in code to support VT420 rectangle control-sequences. - --enable-sco-fkeys enable support for SCO-style function keys Compile-in code to support SCO-style function keys. @@ -418,12 +423,6 @@ The options (in alphabetic order): Compile-in code to support Sun-style function keys. - --enable-tcap-fkeys enable termcap function-keys - - Compile-in code to support experimental feature which directs xterm - to use the function-key definitions from the termcap/terminfo entry - which it used to set the $TERM variable on startup. - --enable-tcap-query enable termcap query/report Compile-in code to support experimental DCS '+' control sequence, which diff --git a/KOI8RXTerm.ad b/KOI8RXTerm.ad new file mode 100644 index 0000000..aa21f26 --- /dev/null +++ b/KOI8RXTerm.ad @@ -0,0 +1,20 @@ +! $XTermId: KOI8RXTerm.ad,v 1.2 2007/12/30 15:49:14 tom Exp $ + +! This is based on the UXTerm app-defaults file. + +! Use +! xterm -class KOI8RXTerm +! to set resources for KOI8-R mode with corresponding fonts. + +#include "XTerm-color" + +*fontMenu.Label: KOI8-R Fonts +*VT100*allowC1Printable: true + +! Use Cyrillic instead of Latin fonts. +*VT100.font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-koi8-r +*VT100.font2: -misc-fixed-medium-r-normal--8-80-75-75-c-50-koi8-r +*VT100.font3: -misc-fixed-medium-r-normal--14-130-75-75-c-70-koi8-r +*VT100.font4: -misc-fixed-medium-r-normal--13-120-75-75-c-80-koi8-r +*VT100.font5: -misc-fixed-medium-r-normal--18-120-100-100-c-90-koi8-r +*VT100.font6: -misc-fixed-medium-r-normal--20-200-75-75-c-100-koi8-r diff --git a/MANIFEST b/MANIFEST index ba5965c..d6339d4 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1,4 +1,4 @@ -MANIFEST for xterm-229, version xterm-229 +MANIFEST for xterm-229o, version xterm-230 -------------------------------------------------------------------------------- MANIFEST this file 256colres.h resource-definitions for 256-color mode @@ -8,6 +8,7 @@ MANIFEST this file AAA_README_VMS.txt note for VMS port of 'xterm' INSTALL configure script: options and related install instructions Imakefile imake template for Makefile +KOI8RXTerm.ad resources for koi8rxterm Makefile.in configure script template for Makefile README overview & caveats for 'xterm' README.i18n i18n readme: @@ -49,6 +50,8 @@ input.c VT100 key-symbol and function-key translation install.sh configure script: fallback install script keysym2ucs.c lookup-table for UTF-8 to keysyms keysym2ucs.h interface of keysym2ucs.c +koi8rxterm KOI-8 wrapper from Debian (originally me) +koi8rxterm.man manpage for koi8rxterm link_axp.com build-script for VMS port of xterm main.c main program of 'xterm' main.h default definitions for 'xterm' @@ -81,6 +84,7 @@ trace.h interface of trace.c util.c miscellaneous utility functions for 'xterm' uxterm wrapper script to make unicode-xterm uxterm.desktop sample desktop file for uxterm +uxterm.man manpage for uxterm, from Debian version.h version of xterm vms.c VMS version of xterm's spawn(), etc. vms.h system headers and definitions for vms.c diff --git a/Makefile.in b/Makefile.in index 1d174bb..ff90a4a 100644 --- a/Makefile.in +++ b/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.154 2007/12/30 16:39:48 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 @[EMAIL PROTECTED](manext) ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && $(LN_S) $(actual_xterm).$(manext) @[EMAIL PROTECTED](manext) ; fi" @-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && echo '... created symbolic link:' && ls -l $(actual_xterm).$(manext) @[EMAIL PROTECTED](manext) ; fi" @@ -246,6 +257,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 +265,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 @[EMAIL PROTECTED](manext); fi" @[EMAIL PROTECTED] \ @@ -266,8 +280,8 @@ uninstall-full :: @[EMAIL PROTECTED] \ @[EMAIL PROTECTED] :: @no_icondir@ -$(RM) $(ICONDIR)/xterm-color_32x32.xpm [EMAIL PROTECTED]@ -$(RM) $(ICONDIR)/xterm_48x48.xpm [EMAIL PROTECTED]@ -$(RM) $(ICONDIR)/xterm-color_32x32.xpm [EMAIL PROTECTED]@ -$(RM) $(ICONDIR)/xterm_32x32.xpm [EMAIL PROTECTED]@ -$(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 +309,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/VTparse.def b/VTparse.def index 85bd578..be2c1cd 100644 --- a/VTparse.def +++ b/VTparse.def @@ -1,11 +1,11 @@ -# $XTermId: VTparse.def,v 1.29 2006/07/31 22:17:10 tom Exp $ +# $XTermId: VTparse.def,v 1.30 2007/12/04 21:14:30 tom Exp $ +# +# vile:txtmode rs=lf # # List of symbols that need to be defined for VTparse.h. If you need to # change any of the CASE_ macros, make the change here and rerun the command # shown in VTparse.h. # -# $XFree86: xc/programs/xterm/VTparse.def,v 3.18 2006/02/13 01:14:58 dickey Exp $ -# CASE_GROUND_STATE CASE_IGNORE diff --git a/XTerm.ad b/XTerm.ad index fdb6992..d914402 100644 --- a/XTerm.ad +++ b/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 $ *saveLines: 1024 @@ -51,6 +50,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/button.c b/button.c index 2ff5fd6..63a0e33 100644 --- a/button.c +++ b/button.c @@ -1,4 +1,4 @@ -/* $XTermId: button.c,v 1.277 2007/07/22 20:37:11 tom Exp $ */ +/* $XTermId: button.c,v 1.281 2007/12/31 21:11:05 tom Exp $ */ /* * Copyright 1999-2006,2007 by Thomas E. Dickey @@ -1041,7 +1041,7 @@ struct _SelectionList { static unsigned DECtoASCII(unsigned ch) { - if (ch < 32) { + if (xtermIsDecGraphic(ch)) { ch = "###########+++++##-##++++|######"[ch]; /* 01234567890123456789012345678901 */ } @@ -1079,7 +1079,7 @@ UTF8toLatin1(Char * s, unsigned len, unsigned long *result) *q++ = value; } else { unsigned eqv = ucs2dec(value); - if (eqv < 32) { + if (xtermIsDecGraphic(eqv)) { *q++ = DECtoASCII(eqv); } else { eqv = AsciiEquivs(value); @@ -1198,9 +1198,9 @@ MapSelections(XtermWidget xw, String * params, Cardinal num_params) } } if (map) { - String mapTo = (xw->screen.selectToClipboard - ? "CLIPBOARD" - : "PRIMARY"); + const char *mapTo = (xw->screen.selectToClipboard + ? "CLIPBOARD" + : "PRIMARY"); UnmapSelections(xw); if ((result = TypeMallocN(String, num_params + 1)) != 0) { @@ -2466,11 +2466,13 @@ make_indexed_text(TScreen * screen, int row, unsigned length, int *indexed) /* some internal points may not be drawn */ if (data == 0) data = ' '; -#if OPT_WIDE_CHARS - next = convertToUTF8(last, data); -#else - *next++ = CharOf(data); -#endif + + if_WIDE_OR_NARROW(screen, { + next = convertToUTF8(last, data); + } + , { + *next++ = CharOf(data); + }); if_OPT_WIDE_CHARS(screen, { int off; @@ -3448,6 +3450,21 @@ DisownSelection(XtermWidget xw) } } +void +UnhiliteSelection(XtermWidget xw) +{ + TScreen *screen = &(xw->screen); + + if (ScrnHaveSelection(screen)) { + CELL first = screen->startH; + CELL last = screen->endH; + + screen->startH = zeroCELL; + screen->endH = zeroCELL; + ReHiliteText(xw, &first, &last); + } +} + /* returns number of chars in line from scol to ecol out */ /* ARGSUSED */ static int diff --git a/charproc.c b/charproc.c index 4c3da05..b101404 100644 --- a/charproc.c +++ b/charproc.c @@ -1,6 +1,4 @@ -/* $XTermId: charproc.c,v 1.810 2007/07/17 21:09:48 tom Exp $ */ - -/* $XFree86: xc/programs/xterm/charproc.c,v 3.185 2006/06/20 00:42:38 dickey Exp $ */ +/* $XTermId: charproc.c,v 1.824 2007/12/31 21:03:26 tom Exp $ */ /* @@ -259,6 +257,7 @@ static XtActionsRec actionsList[] = { { "bell", HandleBell }, { "clear-saved-lines", HandleClearSavedLines }, { "create-menu", HandleCreateMenu }, + { "delete-is-del", HandleDeleteIsDEL }, { "dired-button", DiredButton }, { "hard-reset", HandleHardReset }, { "ignore", HandleIgnore }, @@ -273,7 +272,6 @@ static XtActionsRec actionsList[] = { { "print-redir", HandlePrintControlMode }, { "quit", HandleQuit }, { "redraw", HandleRedraw }, - { "delete-is-del", HandleDeleteIsDEL }, { "scroll-back", HandleScrollBack }, { "scroll-forw", HandleScrollForward }, { "secure", HandleSecure }, @@ -296,6 +294,7 @@ static XtActionsRec actionsList[] = { { "set-bellIsUrgent", HandleBellIsUrgent }, { "set-cursesemul", HandleCursesEmul }, { "set-jumpscroll", HandleJumpscroll }, + { "set-keep-selection", HandleKeepSelection }, { "set-marginbell", HandleMarginBell }, { "set-old-function-keys", HandleOldFunctionKeys }, { "set-pop-on-bell", HandleSetPopOnBell }, @@ -421,6 +420,7 @@ static XtResource resources[] = Bres(XtNhpLowerleftBugCompat, XtCHpLowerleftBugCompat, screen.hp_ll_bc, False), Bres(XtNi18nSelections, XtCI18nSelections, screen.i18nSelections, True), Bres(XtNjumpScroll, XtCJumpScroll, screen.jumpscroll, True), + Bres(XtNkeepSelection, XtCKeepSelection, screen.keepSelection, False), Bres(XtNloginShell, XtCLoginShell, misc.login_shell, False), Bres(XtNmarginBell, XtCMarginBell, screen.marginbell, False), Bres(XtNmetaSendsEscape, XtCMetaSendsEscape, screen.meta_sends_esc, False), @@ -430,6 +430,7 @@ static XtResource resources[] = Bres(XtNprinterAutoClose, XtCPrinterAutoClose, screen.printer_autoclose, False), Bres(XtNprinterExtent, XtCPrinterExtent, screen.printer_extent, False), Bres(XtNprinterFormFeed, XtCPrinterFormFeed, screen.printer_formfeed, False), + Bres(XtNquietGrab, XtCQuietGrab, screen.quiet_grab, False), Bres(XtNreverseVideo, XtCReverseVideo, misc.re_verse, False), Bres(XtNreverseWrap, XtCReverseWrap, misc.reverseWrap, False), Bres(XtNscrollBar, XtCScrollBar, misc.scrollbar, False), @@ -543,6 +544,7 @@ static XtResource resources[] = Tres(XtNhighlightColor, XtCHighlightColor, HIGHLIGHT_BG, XtDefaultForeground), Tres(XtNhighlightTextColor, XtCHighlightTextColor, HIGHLIGHT_FG, XtDefaultBackground), Bres(XtNhighlightReverse, XtCHighlightReverse, screen.hilite_reverse, True), + Bres(XtNhighlightColorMode, XtCHighlightColorMode, screen.hilite_color, Maybe), #endif /* OPT_HIGHLIGHT_COLOR */ #if OPT_INPUT_METHOD @@ -1040,12 +1042,12 @@ set_max_row(TScreen * screen, int rows) #if OPT_MOD_FKEYS static void -set_mod_fkeys(XtermWidget xw, int which, int what) +set_mod_fkeys(XtermWidget xw, int which, int what, Bool enabled) { #define SET_MOD_FKEYS(field) \ - xw->keyboard.modify_now.field = (what == DEFAULT) \ + xw->keyboard.modify_now.field = ((what == DEFAULT) && enabled) \ ? xw->keyboard.modify_1st.field \ - : param[1]; \ + : what; \ TRACE(("set modify_now.%s to %d\n", #field, \ xw->keyboard.modify_now.field)); @@ -1196,7 +1198,8 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) * codes at 0x242, but no zero-width characters until past 0x300. */ if (c >= 0x300 && screen->wide_chars - && my_wcwidth((int) c) == 0) { + && my_wcwidth((int) c) == 0 + && !isWideControl(c)) { int prev, precomposed; WriteNow(); @@ -1204,15 +1207,10 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) prev = XTERM_CELL(screen->last_written_row, screen->last_written_col); precomposed = do_precomposition(prev, (int) c); -#ifdef DEBUG - if (debug) { - fprintf(stderr, - "do_precomposition (U+%04X [%d], U+%04X [%d]) -> U+%04X [%d]\n", - prev, my_wcwidth(prev), (int) c, my_wcwidth((int) - c), - precomposed, my_wcwidth(precomposed)); - } -#endif + TRACE(("do_precomposition (U+%04X [%d], U+%04X [%d]) -> U+%04X [%d]\n", + prev, my_wcwidth(prev), + (int) c, my_wcwidth((int) c), + precomposed, my_wcwidth(precomposed))); /* substitute combined character with precomposed character * only if it does not change the width of the base character @@ -2274,7 +2272,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) set_tb_margins(screen, 0, screen->max_row); CursorSet(screen, 0, 0, xw->flags); xtermParseRect(xw, 0, 0, &myRect); - ScrnFillRectangle(xw, &myRect, 'E', 0); + ScrnFillRectangle(xw, &myRect, 'E', 0, False); sp->parsestate = sp->groundtable; break; @@ -2643,7 +2641,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_DECERA: TRACE(("CASE_DECERA - Erase rectangular area\n")); xtermParseRect(xw, nparam, param, &myRect); - ScrnFillRectangle(xw, &myRect, ' ', 0); + ScrnFillRectangle(xw, &myRect, ' ', 0, True); sp->parsestate = sp->groundtable; break; @@ -2653,7 +2651,7 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) && ((param[0] >= 32 && param[0] <= 126) || (param[0] >= 160 && param[0] <= 255))) { xtermParseRect(xw, nparam - 1, param + 1, &myRect); - ScrnFillRectangle(xw, &myRect, param[0], xw->flags); + ScrnFillRectangle(xw, &myRect, param[0], xw->flags, True); } sp->parsestate = sp->groundtable; break; @@ -2826,15 +2824,19 @@ doparsing(XtermWidget xw, unsigned c, struct ParseState *sp) case CASE_SET_MOD_FKEYS: TRACE(("CASE_SET_MOD_FKEYS\n")); if (nparam >= 1) { - set_mod_fkeys(xw, param[0], nparam > 1 ? param[1] : DEFAULT); + set_mod_fkeys(xw, param[0], nparam > 1 ? param[1] : DEFAULT, True); } else { for (row = 1; row <= 5; ++row) - set_mod_fkeys(xw, row, DEFAULT); + set_mod_fkeys(xw, row, DEFAULT, True); } break; case CASE_SET_MOD_FKEYS0: TRACE(("CASE_SET_MOD_FKEYS0\n")); - xw->keyboard.modify_now.function_keys = -1; + if (nparam >= 1 && param[0] != DEFAULT) { + set_mod_fkeys(xw, param[0], -1, False); + } else { + xw->keyboard.modify_now.function_keys = -1; + } break; #endif @@ -3710,8 +3712,16 @@ ansi_modes(XtermWidget xw, #define set_bool_mode(flag) \ flag = (IsSM()) ? ON : OFF -#define set_mousemode(mode) \ - screen->send_mouse_pos = IsSM() ? mode : MOUSE_OFF +static void +really_set_mousemode(XtermWidget xw, + Bool enabled, + unsigned mode) +{ + xw->screen.send_mouse_pos = enabled ? mode : MOUSE_OFF; + xtermShowPointer(xw, enabled); +} + +#define set_mousemode(mode) really_set_mousemode(xw, IsSM(), mode) #if OPT_READLINE #define set_mouseflag(f) \ @@ -3990,6 +4000,11 @@ dpmodes(XtermWidget xw, CursorRestore(xw); } break; +#if OPT_TCAP_FKEYS + case 1050: + set_keyboard_type(xw, keyboardIsTermcap, IsSM()); + break; +#endif #if OPT_SUN_FUNC_KEYS case 1051: set_keyboard_type(xw, keyboardIsSun, IsSM()); @@ -5063,12 +5078,12 @@ fill_Tres(XtermWidget target, XtermWidget source, int offset) if (name == 0) { target->screen.Tcolors[offset].value = target->dft_foreground; - } else if (!x_strcasecmp(name, XtDefaultForeground)) { + } else if (isDefaultForeground(name)) { target->screen.Tcolors[offset].value = ((offset == TEXT_FG || offset == TEXT_BG) ? target->dft_foreground : target->screen.Tcolors[TEXT_FG].value); - } else if (!x_strcasecmp(name, XtDefaultBackground)) { + } else if (isDefaultBackground(name)) { target->screen.Tcolors[offset].value = ((offset == TEXT_FG || offset == TEXT_BG) ? target->dft_background @@ -5257,6 +5272,12 @@ VTInitialize(Widget wrequest, ArgList args GCC_UNUSED, Cardinal *num_args GCC_UNUSED) { +#define Kolor(name) wnew->screen.name.resource +#define TxtFg(name) !x_strcasecmp(Kolor(Tcolors[TEXT_FG]), Kolor(name)) +#define TxtBg(name) !x_strcasecmp(Kolor(Tcolors[TEXT_BG]), Kolor(name)) +#define DftFg(name) isDefaultForeground(Kolor(name)) +#define DftBg(name) isDefaultBackground(Kolor(name)) + XtermWidget request = (XtermWidget) wrequest; XtermWidget wnew = (XtermWidget) new_arg; Widget my_parent = SHELL_OF(wnew); @@ -5376,7 +5397,6 @@ VTInitialize(Widget wrequest, init_Ires(screen.scrolllines); init_Bres(screen.scrollttyoutput); init_Bres(screen.scrollkey); - init_Bres(screen.selectToClipboard); init_Sres(screen.term_id); for (s = request->screen.term_id; *s; s++) { @@ -5425,13 +5445,17 @@ VTInitialize(Widget wrequest, init_Ires(screen.multiClickTime); init_Ires(screen.bellSuppressTime); init_Sres(screen.charClass); + + init_Bres(screen.always_highlight); + init_Bres(screen.brokenSelections); init_Bres(screen.cutNewline); init_Bres(screen.cutToBeginningOfLine); init_Bres(screen.highlight_selection); - init_Bres(screen.trim_selection); init_Bres(screen.i18nSelections); - init_Bres(screen.brokenSelections); - init_Bres(screen.always_highlight); + init_Bres(screen.keepSelection); + init_Bres(screen.selectToClipboard); + init_Bres(screen.trim_selection); + wnew->screen.pointer_cursor = request->screen.pointer_cursor; init_Sres(screen.answer_back); @@ -5464,6 +5488,8 @@ VTInitialize(Widget wrequest, wnew->screen.allowTitleOps = wnew->screen.allowTitleOp0; wnew->screen.allowWindowOps = wnew->screen.allowWindowOp0; + init_Bres(screen.quiet_grab); + #ifndef NO_ACTIVE_ICON wnew->screen.fnt_icon = request->screen.fnt_icon; init_Bres(misc.active_icon); @@ -5553,10 +5579,10 @@ VTInitialize(Widget wrequest, #if OPT_COLOR_RES TRACE(("Acolors[%d] = %s\n", i, wnew->screen.Acolors[i].resource)); wnew->screen.Acolors[i].mode = False; - if (!x_strcasecmp(wnew->screen.Acolors[i].resource, XtDefaultForeground)) { + if (DftFg(Acolors[i])) { wnew->screen.Acolors[i].value = T_COLOR(&(wnew->screen), TEXT_FG); wnew->screen.Acolors[i].mode = True; - } else if (!x_strcasecmp(wnew->screen.Acolors[i].resource, XtDefaultBackground)) { + } else if (DftBg(Acolors[i])) { wnew->screen.Acolors[i].value = T_COLOR(&(wnew->screen), TEXT_BG); wnew->screen.Acolors[i].mode = True; } else { @@ -5641,6 +5667,26 @@ VTInitialize(Widget wrequest, init_Tres(HIGHLIGHT_BG); init_Tres(HIGHLIGHT_FG); init_Bres(screen.hilite_reverse); + init_Bres(screen.hilite_color); + if (wnew->screen.hilite_color == Maybe) { + wnew->screen.hilite_color = False; +#if OPT_COLOR_RES + /* + * If the highlight text/background are both set, and if they are + * not equal to either the text/background or background/text, then + * set the highlightColorMode automatically. + */ + if (!DftFg(Tcolors[HIGHLIGHT_BG]) + && !DftBg(Tcolors[HIGHLIGHT_FG]) + && !TxtFg(Tcolors[HIGHLIGHT_BG]) + && !TxtBg(Tcolors[HIGHLIGHT_FG]) + && !TxtBg(Tcolors[HIGHLIGHT_BG]) + && !TxtFg(Tcolors[HIGHLIGHT_FG])) { + TRACE(("...setting hilite_color automatically\n")); + wnew->screen.hilite_color = True; + } +#endif + } #endif #if OPT_TEK4014 @@ -7438,7 +7484,7 @@ DoSetSelectedFont(Widget w, } } - if (len > 0 && (val = malloc(len + 1)) != 0) { + if (len > 0 && (val = TypeMallocN(char, len + 1)) != 0) { memcpy(val, value, len); val[len] = '\0'; used = x_strtrim(val); @@ -7477,7 +7523,7 @@ DoSetSelectedFont(Widget w, } void -FindFontSelection(XtermWidget xw, char *atom_name, Bool justprobe) +FindFontSelection(XtermWidget xw, const char *atom_name, Bool justprobe) { static AtomPtr *atoms; static int atomCount = 0; diff --git a/configure b/configure index 0b4c86c..6c3d984 100755 --- a/configure +++ b/configure @@ -743,7 +743,7 @@ Optional Features: --disable-rightbar disable right-scrollbar support --disable-samename disable check for redundant name-change --disable-session-mgt disable support for session management - --enable-tcap-fkeys compile-in termcap function-keys support + --enable-tcap-fkeys disable termcap function-keys support --enable-tcap-query compile-in termcap-query support --disable-tek4014 disable tek4014 emulation --enable-toolbar compile-in toolbar for pulldown menus @@ -753,7 +753,7 @@ Optional Features: --enable-wide-chars enable wide-character support --enable-dabbrev enable dynamic-abbreviation support --enable-dec-locator enable DECterm Locator support - --enable-rectangles enable VT420 rectangle support + --disable-rectangles disable VT420 rectangle support --disable-ziconbeep disable -ziconbeep option Testing/development Options: --enable-trace test: set to enable debugging traces @@ -11333,15 +11333,15 @@ echo $ECHO_N "checking if you want to use termcap function-keys... $ECHO_C" >&6 # Check whether --enable-tcap-fkeys or --disable-tcap-fkeys was given. if test "${enable_tcap_fkeys+set}" = set; then enableval="$enable_tcap_fkeys" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_tcap_fkeys=yes - else + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then enable_tcap_fkeys=no + else + enable_tcap_fkeys=yes fi else - enableval=no - enable_tcap_fkeys=no + enableval=yes + enable_tcap_fkeys=yes fi; echo "$as_me:11347: result: $enable_tcap_fkeys" >&5 @@ -11707,15 +11707,15 @@ echo $ECHO_N "checking if you want VT420 rectangle support... $ECHO_C" >&6 # Check whether --enable-rectangles or --disable-rectangles was given. if test "${enable_rectangles+set}" = set; then enableval="$enable_rectangles" - test "$enableval" != yes && enableval=no - if test "$enableval" != "no" ; then - enable_rectangles=yes - else + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then enable_rectangles=no + else + enable_rectangles=yes fi else - enableval=no - enable_rectangles=no + enableval=yes + enable_rectangles=yes fi; echo "$as_me:11721: result: $enable_rectangles" >&5 @@ -11871,8 +11871,77 @@ EOF EXTRAOBJS="$EXTRAOBJS testxmc.o" fi +for ac_func in tigetstr +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:11877: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 11883 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11914: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11917: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11920: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11923: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11933: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<EOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +EOF + +fi +done + if test -n "$GCC" ; then -echo "$as_me:11875: checking if you want to turn on gcc warnings" >&5 +echo "$as_me:11944: checking if you want to turn on gcc warnings" >&5 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -11889,7 +11958,7 @@ else with_warnings=no fi; -echo "$as_me:11892: result: $with_warnings" >&5 +echo "$as_me:11961: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "$with_warnings" = yes then @@ -11912,10 +11981,10 @@ cat > conftest.i <<EOF EOF if test "$GCC" = yes then - { echo "$as_me:11915: checking for $CC __attribute__ directives..." >&5 + { echo "$as_me:11984: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <<EOF -#line 11918 "configure" +#line 11987 "configure" #include "confdefs.h" #include "conftest.h" #include "conftest.i" @@ -11953,12 +12022,12 @@ EOF EOF ;; esac - if { (eval echo "$as_me:11956: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:12025: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11959: \$? = $ac_status" >&5 + echo "$as_me:12028: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:11961: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:12030: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h fi @@ -11971,11 +12040,11 @@ fi GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:11974: checking version of $CC" >&5 + echo "$as_me:12043: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:11978: result: $GCC_VERSION" >&5 + echo "$as_me:12047: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -11984,12 +12053,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:11987: checking if this is really Intel C compiler" >&5 + echo "$as_me:12056: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 11992 "configure" +#line 12061 "configure" #include "confdefs.h" int @@ -12006,16 +12075,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12009: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12078: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12012: \$? = $ac_status" >&5 + echo "$as_me:12081: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12015: \"$ac_try\"") >&5 + { (eval echo "$as_me:12084: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12018: \$? = $ac_status" >&5 + echo "$as_me:12087: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -12026,14 +12095,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:12029: result: $INTEL_COMPILER" >&5 + echo "$as_me:12098: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <<EOF -#line 12036 "configure" +#line 12105 "configure" int main(int argc, char *argv[]) { return (argv[argc-1] == 0) ; } EOF @@ -12051,7 +12120,7 @@ then # remark #981: operands are evaluated in unspecified order # warning #269: invalid format string conversion - { echo "$as_me:12054: checking for $CC warning options..." >&5 + { echo "$as_me:12123: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" @@ -12068,12 +12137,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:12071: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:12140: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12074: \$? = $ac_status" >&5 + echo "$as_me:12143: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:12076: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:12145: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -12082,7 +12151,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:12085: checking for $CC warning options..." >&5 + { echo "$as_me:12154: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-W -Wall" @@ -12102,12 +12171,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:12105: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:12174: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12108: \$? = $ac_status" >&5 + echo "$as_me:12177: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:12110: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:12179: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -12248,7 +12317,7 @@ DEFS=-DHAVE_CONFIG_H -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]