├── 256colres.h ├── 256colres.pl ├── 88colres.h ├── 88colres.pl ├── COPYING ├── INSTALL ├── Imakefile ├── KOI8RXTerm.ad ├── MANIFEST ├── Makefile.in ├── README ├── README.i18n ├── THANKS ├── TekPrsTbl.c ├── Tekparse.def ├── Tekparse.h ├── Tekproc.c ├── Tests ├── UXTerm.ad ├── VTPrsTbl.c ├── VTparse.def ├── VTparse.h ├── XTerm-col.ad ├── XTerm.ad ├── aclocal.m4 ├── button.c ├── cachedGCs.c ├── charclass.c ├── charclass.h ├── charproc.c ├── charsets.c ├── charsets.dat ├── charsets.h ├── config.guess ├── config.sub ├── configure ├── configure.in ├── ctlseqs.ms ├── ctlseqs.txt ├── cursor.c ├── data.c ├── data.h ├── df-install.in ├── doublechr.c ├── error.h ├── fontutils.c ├── fontutils.h ├── gen-charsets.pl ├── gen-pc-fkeys.pl ├── graphics.c ├── graphics.h ├── graphics_regis.c ├── graphics_regis.h ├── graphics_sixel.c ├── graphics_sixel.h ├── html.c ├── icons ├── filled-xterm.png ├── filled-xterm.svg ├── filled-xterm.xpms ├── filled-xterm_16x16.xpm ├── filled-xterm_32x32.xpm ├── filled-xterm_48x48.xpm ├── make-xpms ├── mini.xterm.svg ├── mini.xterm.xpms ├── mini.xterm_16x16.png ├── mini.xterm_16x16.xpm ├── mini.xterm_256x256.png ├── mini.xterm_32x32.png ├── mini.xterm_32x32.xpm ├── mini.xterm_48x48.png ├── mini.xterm_48x48.xpm ├── terminal_48x48.svg ├── terminal_48x48.xpm ├── xterm-color.png ├── xterm-color.svg ├── xterm-color.xpms ├── xterm-color_16x16.xpm ├── xterm-color_32x32.xpm ├── xterm-color_48x48.xpm ├── xterm.png ├── xterm.svg ├── xterm.xpms ├── xterm_16x16.xpm ├── xterm_32x32.xpm └── xterm_48x48.xpm ├── input.c ├── install-sh ├── keysym2ucs.c ├── keysym2ucs.h ├── koi8rxterm ├── koi8rxterm.man ├── linedata.c ├── main.c ├── main.h ├── menu.c ├── menu.h ├── minstall.in ├── misc.c ├── package ├── debian │ ├── changelog │ ├── color.sed │ ├── compat │ ├── control │ ├── copyright │ ├── postinst │ ├── prerm │ ├── rules │ ├── source │ │ └── format │ ├── watch │ ├── xterm-dev.docs │ ├── xterm-dev.lintian-overrides │ ├── xterm-dev.menu │ └── xterm-xres.sed ├── freebsd │ ├── Makefile │ ├── distinfo │ ├── pkg-descr │ ├── pkg-message.wchar │ └── pkg-plist ├── pkgsrc │ ├── DESCR │ ├── Makefile │ ├── PLIST │ ├── distinfo │ └── options.mk └── xterm.spec ├── plink.sh ├── precompose.c ├── precompose.h ├── print.c ├── ptydata.c ├── ptyx.h ├── resize.c ├── resize.man ├── run-tic.in ├── screen.c ├── scrollback.c ├── scrollbar.c ├── sinstall.sh ├── svg.c ├── tabs.c ├── tektests ├── aitest.tek ├── dmerc.tek ├── fotest.tek ├── imtest.tek ├── imtesth.tek ├── ocpred.tek └── usmap.tek ├── termcap ├── terminfo ├── testxmc.c ├── trace.c ├── trace.h ├── unicode ├── README ├── convmap.pl ├── keysym.map ├── make-precompose.sh ├── precompose.c.head └── precompose.c.tail ├── util.c ├── uxterm ├── uxterm.desktop ├── uxterm.man ├── version.c ├── version.h ├── vttests ├── 16colors.sh ├── 256colors.pl ├── 256colors2.pl ├── 88colors.pl ├── 88colors2.pl ├── 8colors.sh ├── acolors.sh ├── acs.pl ├── altchars.sh ├── blink.pl ├── bold-italics.pl ├── bounce.sh ├── closest-rgb.pl ├── ctlpix.sh ├── cursor.pl ├── decsed.pl ├── dl.sh ├── doublechars.sh ├── dynamic.pl ├── dynamic.sh ├── dynamic2.sh ├── erase.pl ├── fonts.sh ├── halves.pl ├── il.sh ├── insdelln.pl ├── iso2022.pl ├── lrmm-scroll.pl ├── modify-keys.pl ├── mouse-codes ├── nrcs.pl ├── other-sgr.sh ├── palettes.pl ├── paste64.pl ├── pointer-shapes.sh ├── print-vt-chars.pl ├── query-color.pl ├── query-dynamic.pl ├── query-fonts.pl ├── query-status.pl ├── query-xres.pl ├── report-sgr.pl ├── resize.pl ├── resize.sh ├── scroll.pl ├── setpos.pl ├── sgrPushPop.pl ├── sgrPushPop2.pl ├── tab0.sh ├── tcapquery.pl ├── title.sh ├── titlestack.pl ├── unascii.sh ├── under-latin.pl ├── utf8.pl ├── version.sh ├── vt52chars.pl ├── wrap.pl ├── xorblink.pl └── xtra-scroll.pl ├── wcwidth.c ├── wcwidth.h ├── xcharmouse.h ├── xstrings.c ├── xstrings.h ├── xterm.appdata.xml ├── xterm.desktop ├── xterm.h ├── xterm.log.html ├── xterm.man ├── xterm_io.h ├── xtermcap.c ├── xtermcap.h ├── xtermcfg.hin ├── xutf8.c └── xutf8.h /256colres.pl: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl 2 | # $XTermId: 256colres.pl,v 1.16 2007/06/08 23:58:37 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2002,2007 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | 35 | # Construct a header file defining default resources for the 256-color model 36 | # of xterm. This is modeled after the 256colors2.pl script. 37 | 38 | # use the resources for colors 0-15 - usually more-or-less a 39 | # reproduction of the standard ANSI colors, but possibly more 40 | # pleasing shades 41 | 42 | use strict; 43 | 44 | our ( $line1, $line2, $line3 ); 45 | our ( $red, $green, $blue, $gray ); 46 | our ( $level, $code, @steps ); 47 | 48 | print < 0 ) { $level += 23.18181818; } 86 | $code = 80 + $gray; 87 | printf($line1, $code); 88 | printf($line2, $code); 89 | printf($line3, 90 | int($level), int($level), int($level)); 91 | } 92 | 93 | print < 46 | 47 | #endif /* included_Tekparse_h */ 48 | -------------------------------------------------------------------------------- /Tests: -------------------------------------------------------------------------------- 1 | Tests for xterm: 2 | 3 | If system supports window size (i.e., some combination of SIGWINCH, 4 | TIOCSSIZE, TIOCSWINSZ), start a full-screen program (e.g., Emacs, 5 | Jove, vi) and resize the xterm window. The program must immediately 6 | update its screen image for the new size. 7 | 8 | If compiled with -DUTMP, starting a new xterm should create a new utmp 9 | entry. ("who" will show this info.) Exiting xterm should remove the 10 | entry. Killing the xterm window (or other unnatural exit) should also 11 | remove the entry. When should entries be made in the wtmp file? 12 | 13 | Process group stuff should be correct. 14 | 15 | Should work without access to /dev/tty, say started from an xdm 16 | started from a boot-time script. 17 | 18 | If "xterm -help" offers the -C option, it should work. 19 | 20 | echo "test" > /dev/tty 21 | 22 | vi with lines that wrap. 23 | 24 | Exec'ing things other than shells. 25 | 26 | Another thing that has caused problems in the past is process groups, 27 | especially w.r.t. signal propagation to the child. 28 | 29 | Popup menu signals: running only a shell, click on "Send INT Signal." 30 | Do you get a new prompt from the shell? (Same as typing ^C at it.) 31 | 32 | Should scroll *fast* with jumpScroll enabled. 33 | 34 | While a mouse button is down tracing out a selection, output to the 35 | screen should be suspended. 36 | 37 | Selections more than one screen long. 38 | 39 | start xterm running only Tek widget: "xterm -t" 40 | 41 | 42 | Please add to this list if you find xterm failing in some way. 43 | -------------------------------------------------------------------------------- /UXTerm.ad: -------------------------------------------------------------------------------- 1 | ! $XTermId: UXTerm.ad,v 1.14 2020/09/15 21:07:49 tom Exp $ 2 | ! ----------------------------------------------------------------------------- 3 | ! this file is part of xterm 4 | ! 5 | ! Copyright 2000-2010,2020 by Thomas E. Dickey 6 | ! 7 | ! All Rights Reserved 8 | ! 9 | ! Permission is hereby granted, free of charge, to any person obtaining a 10 | ! copy of this software and associated documentation files (the 11 | ! "Software"), to deal in the Software without restriction, including 12 | ! without limitation the rights to use, copy, modify, merge, publish, 13 | ! distribute, sublicense, and/or sell copies of the Software, and to 14 | ! permit persons to whom the Software is furnished to do so, subject to 15 | ! the following conditions: 16 | ! 17 | ! The above copyright notice and this permission notice shall be included 18 | ! in all copies or substantial portions of the Software. 19 | ! 20 | ! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | ! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | ! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | ! IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24 | ! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | ! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | ! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | ! 28 | ! Except as contained in this notice, the name(s) of the above copyright 29 | ! holders shall not be used in advertising or otherwise to promote the 30 | ! sale, use or other dealings in this Software without prior written 31 | ! authorization. 32 | ! ----------------------------------------------------------------------------- 33 | ! Use 34 | ! xterm -class UXTerm 35 | ! to set resources for UTF-8 mode with corresponding fonts. 36 | ! See the uxterm script for an example. 37 | 38 | #include "XTerm" 39 | 40 | *fontMenu.Label: Unicode Fonts 41 | *VT100.utf8: 1 42 | 43 | ! This includes "XTerm-color" which includes "XTerm", which defines fonts. 44 | ! Why set them here? 45 | ! 46 | ! Here is a simple description. A technically precise one would be very long. 47 | ! When xterm starts up, it uses the 48 | ! 49 | ! *VT100.font 50 | ! 51 | ! resource, and if it is told to switch to wide-character (UTF-8) mode, it 52 | ! checks if the given font is "wide", and if not looks for the 53 | ! 54 | ! *VT100.utf8Fonts.font 55 | ! 56 | ! to obtain a wide font. A "wide" font has more than 256 glyphs. Typical 57 | ! wide fonts have 10,000 glyphs. If the original "*VT100.font" is not wide, 58 | ! and xterm can load the *VT100.utf8Fonts.font, it will use that. 59 | ! 60 | ! Making the wide fonts associated with *VT100.font in this file allows uxterm 61 | ! to skip that step. It will use the fonts that the XTerm file gives for the 62 | ! *VT100.uft8Fonts.font pattern. 63 | *VT100.font2: -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1 64 | *VT100.font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1 65 | *VT100.font3: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1 66 | *VT100.font4: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1 67 | *VT100.font5: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1 68 | *VT100.font6: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1 69 | *VT100.font7: -adobe-courier-medium-r-normal--24-240-75-75-m-150-iso10646-1 70 | 71 | ! Here is an alternate set of fonts with better support for bold: 72 | !*VT100.font2: -efont-biwidth-medium-r-normal--10-100-75-75-p-50-iso10646-1 73 | !*VT100.font: -efont-biwidth-medium-r-normal--10-100-75-75-p-50-iso10646-1 74 | !*VT100.font3: -efont-biwidth-medium-r-normal--12-120-75-75-p-60-iso10646-1 75 | !*VT100.font4: -efont-biwidth-medium-r-normal--14-140-75-75-p-70-iso10646-1 76 | !*VT100.font5: -efont-biwidth-medium-r-normal--16-160-75-75-p-80-iso10646-1 77 | !*VT100.font6: -efont-biwidth-medium-r-normal--24-240-75-75-p-120-iso10646-1 78 | -------------------------------------------------------------------------------- /VTparse.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: VTparse.h,v 1.73 2024/09/02 16:06:16 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 1996-2023,2024 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | */ 32 | 33 | #ifndef included_VTparse_h 34 | #define included_VTparse_h 1 35 | 36 | #include 37 | 38 | /* 39 | * PARSE_T has to be large enough to handle the number of cases enumerated here. 40 | */ 41 | typedef unsigned char PARSE_T; 42 | 43 | extern const PARSE_T ansi_table[]; 44 | extern const PARSE_T cigtable[]; 45 | extern const PARSE_T csi2_table[]; 46 | extern const PARSE_T csi_amp_table[]; 47 | extern const PARSE_T csi_dec_dollar_table[]; 48 | extern const PARSE_T csi_ex_table[]; 49 | extern const PARSE_T csi_quo_table[]; 50 | extern const PARSE_T csi_sp_table[]; 51 | extern const PARSE_T csi_table[]; 52 | extern const PARSE_T csi_tick_table[]; 53 | extern const PARSE_T dec2_table[]; 54 | extern const PARSE_T dec3_table[]; 55 | extern const PARSE_T dec_table[]; 56 | extern const PARSE_T eigtable[]; 57 | extern const PARSE_T esc_sp_table[]; 58 | extern const PARSE_T esc_table[]; 59 | extern const PARSE_T scrtable[]; 60 | extern const PARSE_T scs96table[]; 61 | extern const PARSE_T scstable[]; 62 | extern const PARSE_T sos_table[]; 63 | 64 | #if OPT_DEC_RECTOPS 65 | extern const PARSE_T csi_dollar_table[]; 66 | extern const PARSE_T csi_star_table[]; 67 | #endif /* OPT_DEC_LOCATOR */ 68 | 69 | #if OPT_VT52_MODE 70 | extern const PARSE_T vt52_table[]; 71 | extern const PARSE_T vt52_esc_table[]; 72 | extern const PARSE_T vt52_ignore_table[]; 73 | #endif 74 | 75 | #if OPT_VT525_COLORS 76 | extern const PARSE_T csi_comma_table[]; 77 | #endif 78 | 79 | #if OPT_WIDE_CHARS 80 | extern const PARSE_T esc_pct_table[]; 81 | extern const PARSE_T scs_amp_table[]; 82 | extern const PARSE_T scs_pct_table[]; 83 | extern const PARSE_T scs_2qt_table[]; 84 | #endif 85 | 86 | #if OPT_XTERM_SGR 87 | extern const PARSE_T csi_hash_table[]; 88 | #endif 89 | 90 | #include 91 | 92 | #endif /* included_VTparse_h */ 93 | -------------------------------------------------------------------------------- /charclass.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: charclass.h,v 1.10 2024/12/01 23:50:21 tom Exp $ */ 2 | 3 | /* $XFree86: xc/programs/xterm/charclass.h,v 1.3 2006/02/13 01:14:58 dickey Exp $ */ 4 | 5 | /* 6 | * Copyright 2006-2023,2024 by Thomas E. Dickey 7 | * 8 | * All Rights Reserved 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a 11 | * copy of this software and associated documentation files (the 12 | * "Software"), to deal in the Software without restriction, including 13 | * without limitation the rights to use, copy, modify, merge, publish, 14 | * distribute, sublicense, and/or sell copies of the Software, and to 15 | * permit persons to whom the Software is furnished to do so, subject to 16 | * the following conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be included 19 | * in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * Except as contained in this notice, the name(s) of the above copyright 30 | * holders shall not be used in advertising or otherwise to promote the 31 | * sale, use or other dealings in this Software without prior written 32 | * authorization. 33 | */ 34 | 35 | #ifndef CHARCLASS_H 36 | #define CHARCLASS_H 37 | 38 | typedef enum { 39 | IDENT = -1, 40 | OTHER = 0, 41 | CNTRL = 1, 42 | ALNUM = 48, 43 | BLANK = 32, 44 | U_CJK = 0x4e00, 45 | U_SUP = 0x2070, 46 | U_SUB = 0x2080, 47 | U_HIR = 0x3040, 48 | U_KAT = 0x30a0, 49 | U_HAN = 0xac00 50 | } Classes; 51 | 52 | extern void init_classtab(void); 53 | /* initialise the table. needs calling before either of the 54 | others. */ 55 | 56 | extern int SetCharacterClassRange(int low, int high, int value); 57 | extern int CharacterClass(int c); 58 | 59 | #if OPT_REPORT_CCLASS 60 | extern void report_wide_char_class(void); 61 | #endif 62 | 63 | #ifdef NO_LEAKS 64 | extern void noleaks_CharacterClass(void); 65 | #endif 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /data.c: -------------------------------------------------------------------------------- 1 | /* $XTermId: data.c,v 1.100 2021/05/27 22:29:26 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2002-2017,2021 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | * 32 | * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts. 33 | * 34 | * All Rights Reserved 35 | * 36 | * Permission to use, copy, modify, and distribute this software and its 37 | * documentation for any purpose and without fee is hereby granted, 38 | * provided that the above copyright notice appear in all copies and that 39 | * both that copyright notice and this permission notice appear in 40 | * supporting documentation, and that the name of Digital Equipment 41 | * Corporation not be used in advertising or publicity pertaining to 42 | * distribution of the software without specific, written prior permission. 43 | * 44 | * 45 | * DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 46 | * ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL 47 | * DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR 48 | * ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 49 | * WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, 50 | * ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS 51 | * SOFTWARE. 52 | */ 53 | 54 | #include 55 | 56 | Widget toplevel; /* top-most widget in xterm */ 57 | 58 | #if OPT_TEK4014 59 | Char *Tpushb; 60 | Char *Tpushback; 61 | TekLink *tekRefreshList; 62 | TekWidget tekWidget; 63 | Widget tekshellwidget; 64 | int T_lastx = -1; 65 | int T_lasty = -1; 66 | int Ttoggled = 0; 67 | jmp_buf Tekend; 68 | #endif 69 | 70 | char *ProgramName; 71 | char *ProgramPath; 72 | 73 | Arg ourTopLevelShellArgs[] = 74 | { 75 | {XtNallowShellResize, (XtArgVal) True}, 76 | {XtNinput, (XtArgVal) True}, 77 | }; 78 | Cardinal number_ourTopLevelShellArgs = 2; 79 | 80 | Atom wm_delete_window; /* for ICCCM delete window */ 81 | 82 | Boolean guard_keyboard_type = False; 83 | XTERM_RESOURCE resource; 84 | 85 | PtyData *VTbuffer; 86 | 87 | jmp_buf VTend; 88 | 89 | #ifdef DEBUG 90 | int debug = 0; /* true causes error messages to be displayed */ 91 | #endif /* DEBUG */ 92 | 93 | XtAppContext app_con; 94 | XtermWidget term; /* master data structure for client */ 95 | 96 | int hold_screen; 97 | SIG_ATOMIC_T need_cleanup = False; 98 | SIG_ATOMIC_T caught_intr = False; 99 | 100 | int am_slave = -1; /* set to file-descriptor if we're a slave process */ 101 | int max_plus1; 102 | PtySelect Select_mask; 103 | PtySelect X_mask; 104 | PtySelect pty_mask; 105 | char *ptydev; 106 | char *ttydev; 107 | 108 | #if HANDLE_STRUCT_NOTIFY 109 | int mapstate = -1; 110 | #endif /* HANDLE_STRUCT_NOTIFY */ 111 | 112 | #ifdef HAVE_LIB_XCURSOR 113 | char *xterm_cursor_theme; 114 | #endif 115 | 116 | #if OPT_SESSION_MGT 117 | int ice_fd = -1; 118 | char **restart_command; 119 | #endif 120 | 121 | int restart_params = 0; 122 | 123 | #ifdef USE_IGNORE_RC 124 | int ignore_unused; 125 | #endif 126 | 127 | #if OPT_DIRECT_COLOR 128 | CellColor initCColor = 129 | {0, 0}; 130 | #else 131 | CellColor initCColor = 0; 132 | #endif 133 | -------------------------------------------------------------------------------- /graphics_regis.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: graphics_regis.h,v 1.3 2023/07/07 20:10:32 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2014-2016,2023 by Ross Combs 5 | * Copyright 2014-2016,2023 by Thomas E. Dickey 6 | * 7 | * All Rights Reserved 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a 10 | * copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included 18 | * in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * Except as contained in this notice, the name(s) of the above copyright 29 | * holders shall not be used in advertising or otherwise to promote the 30 | * sale, use or other dealings in this Software without prior written 31 | * authorization. 32 | */ 33 | 34 | #ifndef included_graphics_regis_h 35 | #define included_graphics_regis_h 36 | /* *INDENT-OFF* */ 37 | 38 | #include 39 | 40 | #if OPT_REGIS_GRAPHICS 41 | extern void reset_regis(void); 42 | extern void parse_regis(XtermWidget /* xw */, ANSI */* params */, char const */* string */); 43 | #else 44 | #define reset_regis() /* nothing */ 45 | #define parse_regis(xw, params, string) /* nothing */ 46 | #endif 47 | 48 | /* *INDENT-ON* */ 49 | 50 | #endif /* included_graphics_regis_h */ 51 | -------------------------------------------------------------------------------- /graphics_sixel.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: graphics_sixel.h,v 1.9 2024/07/01 21:19:14 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2014-2016,2024 by Thomas E. Dickey 5 | * Copyright 2014,2016 by Ross Combs 6 | * 7 | * All Rights Reserved 8 | * 9 | * Permission is hereby granted, free of charge, to any person obtaining a 10 | * copy of this software and associated documentation files (the 11 | * "Software"), to deal in the Software without restriction, including 12 | * without limitation the rights to use, copy, modify, merge, publish, 13 | * distribute, sublicense, and/or sell copies of the Software, and to 14 | * permit persons to whom the Software is furnished to do so, subject to 15 | * the following conditions: 16 | * 17 | * The above copyright notice and this permission notice shall be included 18 | * in all copies or substantial portions of the Software. 19 | * 20 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | * 28 | * Except as contained in this notice, the name(s) of the above copyright 29 | * holders shall not be used in advertising or otherwise to promote the 30 | * sale, use or other dealings in this Software without prior written 31 | * authorization. 32 | */ 33 | 34 | #ifndef included_graphics_sixel_h 35 | #define included_graphics_sixel_h 36 | /* *INDENT-OFF* */ 37 | 38 | #include 39 | 40 | #if OPT_SIXEL_GRAPHICS 41 | extern void parse_sixel_init(XtermWidget /* xw */, ANSI * /* params */); 42 | extern void parse_sixel_char(char /* cp */); 43 | extern void parse_sixel_finished(void); 44 | #endif 45 | 46 | /* *INDENT-ON* */ 47 | 48 | #endif /* included_graphics_sixel_h */ 49 | -------------------------------------------------------------------------------- /icons/filled-xterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/filled-xterm.png -------------------------------------------------------------------------------- /icons/filled-xterm_16x16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * filled_xterm_16x16_xpm[] = { 3 | "16 16 110 2", 4 | " c None", 5 | ". c #BAA9A9", 6 | "+ c #C59C9C", 7 | "@ c #C49999", 8 | "# c #C6AAAA", 9 | "$ c #4D4242", 10 | "% c #F0E4E4", 11 | "& c #CEBABA", 12 | "* c #D5BEBE", 13 | "= c #C6B5B5", 14 | "- c #CEBEBE", 15 | "; c #796D6D", 16 | "> c #DEC5C5", 17 | ", c #B19B9B", 18 | "' c #C6B8B8", 19 | ") c #B19696", 20 | "! c #EBE5E5", 21 | "~ c #FFFFFF", 22 | "{ c #D6D6D6", 23 | "] c #D0BDBD", 24 | "^ c #FFF4F4", 25 | "/ c #FEFDFD", 26 | "( c #706969", 27 | "_ c #CCC3C3", 28 | ": c #FFF0F0", 29 | "< c #978989", 30 | "[ c #A9A5A5", 31 | "} c #A7A3A3", 32 | "| c #E3E1E1", 33 | "1 c #DACBCB", 34 | "2 c #DEDEDE", 35 | "3 c #FFF8F8", 36 | "4 c #FFF6F6", 37 | "5 c #FFFCFC", 38 | "6 c #FFFEFE", 39 | "7 c #D2D2D2", 40 | "8 c #9C9C9C", 41 | "9 c #9B8787", 42 | "0 c #B3A0A0", 43 | "a c #FFD5D5", 44 | "b c #D4C2C2", 45 | "c c #FFE7E7", 46 | "d c #7A6F6F", 47 | "e c #786F6F", 48 | "f c #C2C2C2", 49 | "g c #B4B4B4", 50 | "h c #FFE3E3", 51 | "i c #E1CECE", 52 | "j c #FED8D8", 53 | "k c #908888", 54 | "l c #878080", 55 | "m c #898383", 56 | "n c #F3ECEC", 57 | "o c #D8C2C2", 58 | "p c #FFFAFA", 59 | "q c #FFF2F2", 60 | "r c #FFF9F9", 61 | "s c #EFEFEF", 62 | "t c #FEFEFE", 63 | "u c #C8C3C3", 64 | "v c #D2BFBF", 65 | "w c #8A8383", 66 | "x c #FCE5E5", 67 | "y c #D9B6B6", 68 | "z c #DDBCBC", 69 | "A c #BCA0A0", 70 | "B c #F0D2D2", 71 | "C c #AB9C9C", 72 | "D c #000000", 73 | "E c #B0A2A2", 74 | "F c #AE9F9F", 75 | "G c #C6ABAB", 76 | "H c #B48E8E", 77 | "I c #C8ABAB", 78 | "J c #C39A9A", 79 | "K c #D0B2B2", 80 | "L c #C3A0A0", 81 | "M c #CFB2B2", 82 | "N c #C59999", 83 | "O c #CCC1C1", 84 | "P c #3C3535", 85 | "Q c #A39C9C", 86 | "R c #FAEDED", 87 | "S c #FEFCFC", 88 | "T c #F9F2F2", 89 | "U c #FEF7F7", 90 | "V c #FAEBEB", 91 | "W c #FEFAFA", 92 | "X c #F9F1F1", 93 | "Y c #FEF4F4", 94 | "Z c #FAEFEF", 95 | "` c #EBE0E0", 96 | " . c #DFB9B9", 97 | ".. c #E8E3E3", 98 | "+. c #BBB0B0", 99 | "@. c #BBA9A9", 100 | "#. c #CEC8C8", 101 | "$. c #BCADAD", 102 | "%. c #CDC8C8", 103 | "&. c #C78D8D", 104 | "*. c #E3B2B2", 105 | "=. c #E3BCBC", 106 | "-. c #BBAAAA", 107 | ";. c #746C6C", 108 | ">. c #858585", 109 | ",. c #8A7F7F", 110 | "'. c #977878", 111 | "). c #A38686", 112 | "!. c #A78686", 113 | "~. c #201717", 114 | " . + @ @ @ @ @ @ @ @ # $ ", 115 | " % & * * * * * * * * = - ; ", 116 | " > , ' ) ! ~ ~ ~ ~ ~ { ] ^ ", 117 | " > / ( _ ~ ~ ~ ~ ~ ~ { ] : ", 118 | " > ~ < [ ~ ~ ~ ~ ~ ~ { ] : ", 119 | " > } | 1 2 ~ ~ ~ ~ ~ { ] : ", 120 | " > ~ ~ 3 ~ 4 4 5 6 4 7 ] : ", 121 | " > 7 8 9 0 a b c d e f ] : ", 122 | " > ~ g h i j k c l m f ] n ", 123 | " o ~ ~ p ~ q 6 r s t u v w ", 124 | " x y z z z z z z A z B C ", 125 | " D ", 126 | " E F G H I J K L M N O P ", 127 | " Q R S T U V W X Y Z U ` Q ", 128 | " ...+._ @.#.$.%.&.*.=.-.;. ", 129 | " >.>.>.,.'.).).).).).!.~. "}; 130 | -------------------------------------------------------------------------------- /icons/make-xpms: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: make-xpms,v 1.7 2025/03/08 13:12:31 tom Exp $ 3 | # some files are generated from other icons... 4 | for name in mini.xterm filled-xterm xterm xterm-color 5 | do 6 | target=${name}.xpms 7 | NAME=`echo "$target" | sed -e 's/[\.-]/_/g'` 8 | LIST= 9 | echo "** creating $target" 10 | rm -f $target 11 | echo "/* @XTermId@ */" | sed -e 's/@/$/g' >$target 12 | echo "/* generated by $0 $* */" >>$target 13 | echo "/* vile:xpmmode */" >>$target 14 | for source in "${name}"_*[0-9]x[1-9]*.xpm 15 | do 16 | echo ".. from $source" 17 | BASE=`basename "$source" .xpm` 18 | PART=`echo "$source" | sed -e 's/[\.-]/_/g'` 19 | test -n "$LIST" && LIST="$LIST," 20 | LIST="$LIST 21 | { \"$BASE\", $PART }" 22 | sed -e 's/char \*/const char * const/' "$source" >>$target 23 | done 24 | echo "static const XPM_DATA $NAME[] = {$LIST 25 | };" >>$target 26 | done 27 | -------------------------------------------------------------------------------- /icons/mini.xterm_16x16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/mini.xterm_16x16.png -------------------------------------------------------------------------------- /icons/mini.xterm_16x16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * mini_xterm_16x16_xpm[] = { 3 | "16 16 84 1", 4 | " c None", 5 | ". c #FF3200", 6 | "+ c #FF3C00", 7 | "@ c #FF3F00", 8 | "# c #FF3B00", 9 | "$ c #FF3800", 10 | "% c #FF2000", 11 | "& c #FF1100", 12 | "* c #FF3D00", 13 | "= c #FF3900", 14 | "- c #FF2200", 15 | "; c #FF0A00", 16 | "> c #FF5D00", 17 | ", c #FF1300", 18 | "' c #FF0500", 19 | ") c #D0412F", 20 | "! c #DD6722", 21 | "~ c #DA3E25", 22 | "{ c #D84727", 23 | "] c #D03C2F", 24 | "^ c #0023F3", 25 | "/ c #000BF2", 26 | "( c #0E21E6", 27 | "_ c #4433B4", 28 | ": c #352EC3", 29 | "< c #0010F2", 30 | "[ c #0004F1", 31 | "} c #2C33CB", 32 | "| c #3E2ABA", 33 | "1 c #011EF3", 34 | "2 c #0012F3", 35 | "3 c #022DF5", 36 | "4 c #F2140D", 37 | "5 c #FF5E00", 38 | "6 c #052AF0", 39 | "7 c #0013F3", 40 | "8 c #DD4822", 41 | "9 c #002CF5", 42 | "0 c #004FF7", 43 | "a c #003AF6", 44 | "b c #1529E1", 45 | "c c #D83827", 46 | "d c #0037F7", 47 | "e c #004CF8", 48 | "f c #FF5900", 49 | "g c #182EDE", 50 | "h c #FF2100", 51 | "i c #152CE1", 52 | "j c #DD3B22", 53 | "k c #FF2300", 54 | "l c #FF2A00", 55 | "m c #0C28E9", 56 | "n c #E1571E", 57 | "o c #FF2E00", 58 | "p c #012AF4", 59 | "q c #E1661E", 60 | "r c #FF3600", 61 | "s c #FF3500", 62 | "t c #0028F4", 63 | "u c #0011F2", 64 | "v c #D64E29", 65 | "w c #FF5C00", 66 | "x c #FF2B00", 67 | "y c #FF1D00", 68 | "z c #FF2F00", 69 | "A c #000EF2", 70 | "B c #0003F1", 71 | "C c #8C4072", 72 | "D c #FF4C00", 73 | "E c #FF2D00", 74 | "F c #0360F6", 75 | "G c #0031F6", 76 | "H c #0016F3", 77 | "I c #0827EE", 78 | "J c #3D47BE", 79 | "K c #E5631A", 80 | "L c #FF4300", 81 | "M c #FF3E00", 82 | "N c #FF2400", 83 | "O c #FF0700", 84 | "P c #FF3400", 85 | "Q c #FF5700", 86 | "R c #FF5600", 87 | "S c #FF3700", 88 | " .+@#$% &$$*=- ", 89 | " ;>#, '+ ", 90 | " )!~ {] ", 91 | " ^/(_:<[}|1/2 ", 92 | " 2345=678 97 ", 93 | " 0a =>b7c de ", 94 | " fg7 ", 95 | " hg7 ", 96 | " $i7j ", 97 | " klm7no ", 98 | " # p7qr ", 99 | " sk tuvwx ", 100 | " yz ABCfDE ", 101 | " = FGHHIJKr ", 102 | " $LM$N O$PQRS- ", 103 | " "}; 104 | -------------------------------------------------------------------------------- /icons/mini.xterm_256x256.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/mini.xterm_256x256.png -------------------------------------------------------------------------------- /icons/mini.xterm_32x32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/mini.xterm_32x32.png -------------------------------------------------------------------------------- /icons/mini.xterm_48x48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/mini.xterm_48x48.png -------------------------------------------------------------------------------- /icons/terminal_48x48.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * terminal_48x48_xpm[] = { 3 | "48 48 2 1", 4 | " c #000000", 5 | ". c #FFFFFF", 6 | "................................................", 7 | "...... ........", 8 | "..... .................................. ......", 9 | "..... ... ... . .....", 10 | "..... .. ............................ .. .. ....", 11 | "..... . .............................. . ... ...", 12 | "..... . .............................. . .... ..", 13 | "..... . .............................. . .... ..", 14 | "..... . .............................. . .... ..", 15 | "..... . .............................. . .... ..", 16 | "..... . .............................. . .... ..", 17 | "..... . .............................. . .... ..", 18 | "..... . .............................. . .... ..", 19 | "..... . .............................. . .... ..", 20 | "..... . .............................. . .... ..", 21 | "..... . .............................. . .... ..", 22 | "..... . .............................. . .... ..", 23 | "..... . .............................. . .... ..", 24 | "..... . .............................. . .... ..", 25 | "..... . .............................. . .... ..", 26 | "..... . .............................. . .... ..", 27 | "..... . .............................. . .... ..", 28 | "..... . .............................. . .... ..", 29 | "..... . .............................. . .... ..", 30 | "..... . .............................. . .... ..", 31 | "..... . .............................. . ... ...", 32 | "..... . .............................. . ... ...", 33 | "..... . .............................. . .. ....", 34 | "..... . .............................. . .. ....", 35 | "..... . .............................. . . .....", 36 | "..... .. ............................ .. . .....", 37 | "..... ... ... ......", 38 | "..... .................................. ......", 39 | "...... ........", 40 | "................................................", 41 | "................................................", 42 | "...... ......", 43 | "..... .................................. ......", 44 | "..... . . . . . . . . . . . . . . . . .. ......", 45 | ".... .................................. . ......", 46 | ".... . . . . . . . . . . . . . . . . .. . ......", 47 | "... .................................. .. ......", 48 | "... . . . . . . . . . . . . . . . . .. .. ......", 49 | ".. .................................. .. .......", 50 | ".. . . . . . ........", 51 | ". .................................. . .........", 52 | ". ..........", 53 | "................................................"}; 54 | -------------------------------------------------------------------------------- /icons/xterm-color.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/xterm-color.png -------------------------------------------------------------------------------- /icons/xterm-color_16x16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_color_16x16_xpm[] = { 3 | "16 16 80 1", 4 | ". c None", 5 | " c #555500", 6 | "+ c #545400", 7 | "@ c #3A3A00", 8 | "# c #222200", 9 | "$ c #2A2A00", 10 | "% c #2B2B00", 11 | "& c #151500", 12 | "* c #5E5E00", 13 | "= c #5A5A00", 14 | "- c #909098", 15 | "; c #3E3E3E", 16 | "> c #000000", 17 | ", c #F2F2F2", 18 | "' c #2E2E36", 19 | ") c #343400", 20 | "! c #4C0000", 21 | "~ c #140000", 22 | "{ c #7C0000", 23 | "] c #7F7F7F", 24 | "^ c #858588", 25 | "/ c #EA0000", 26 | "( c #0B0000", 27 | "_ c #460000", 28 | ": c #8E0000", 29 | "< c #A80000", 30 | "[ c #474747", 31 | "} c #868686", 32 | "| c #404548", 33 | "1 c #8F3400", 34 | "2 c #451200", 35 | "3 c #299000", 36 | "4 c #1F6C00", 37 | "5 c #192E48", 38 | "6 c #1B3448", 39 | "7 c #888888", 40 | "8 c #CF4C00", 41 | "9 c #3B0700", 42 | "0 c #39C700", 43 | "a c #42E800", 44 | "b c #2D5181", 45 | "c c #55A3E3", 46 | "d c #305C81", 47 | "e c #989898", 48 | "f c #D84F00", 49 | "g c #3A0600", 50 | "h c #258100", 51 | "i c #376599", 52 | "j c #396D99", 53 | "k c #7E7E7E", 54 | "l c #010100", 55 | "m c #000101", 56 | "n c #9A9A9A", 57 | "o c #101000", 58 | "p c #5B5B00", 59 | "q c #3D3D00", 60 | "r c #272700", 61 | "s c #2F2F00", 62 | "t c #303000", 63 | "u c #1A1A00", 64 | "v c #464636", 65 | "w c #7A7A7F", 66 | "x c #8B8B90", 67 | "y c #1B1B00", 68 | "z c #0F0F00", 69 | "A c #FFFFFF", 70 | "B c #5B5B5B", 71 | "C c #C9C9C9", 72 | "D c #BFBFBF", 73 | "E c #B5B5B5", 74 | "F c #5C5C5C", 75 | "G c #79797F", 76 | "H c #7F7F88", 77 | "I c #484835", 78 | "J c #3C3C00", 79 | "K c #1E1E00", 80 | "L c #909090", 81 | "M c #333336", 82 | "N c #464600", 83 | "O c #575700", 84 | ".+@#$$$$$$$$%&*+", 85 | ".=-;>>>>>>>>>,')", 86 | ".=>!~{>>>>>>>>]^", 87 | ".=>>/(>>>>>>>>]]", 88 | ".=>_:<>>>>>>>>]]", 89 | ".=>>>>>>>>>>>>]]", 90 | ".=>[}|12345>6>]]", 91 | ".=>>7>890abcd>]]", 92 | ".=>>e>fgh0i>j>k^", 93 | ".=>>>l>>>>>m>>no", 94 | ".=-;>>>>>>>>>,>p", 95 | ".+qrsssssssstu*.", 96 | ".pvwwwwwwwwwwxy.", 97 | "+zABABCDDDEAFG*.", 98 | "*HBABAEDDDCBAIJ.", 99 | "KL]]]]]]]]]]MNO."}; 100 | -------------------------------------------------------------------------------- /icons/xterm-color_32x32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_color_32x32_xpm[] = { 3 | "32 32 60 1", 4 | ". c None", 5 | " c #FFFFFF", 6 | "+ c #000000", 7 | "@ c #EFEFEF", 8 | "# c #FEFEFE", 9 | "$ c #FBFBFB", 10 | "% c #F3F3F3", 11 | "& c #ADADAD", 12 | "* c #909090", 13 | "= c #737373", 14 | "- c #D2D2D2", 15 | "; c #646464", 16 | "> c #9A9A9A", 17 | ", c #8D8D8D", 18 | "' c #D3D3D3", 19 | ") c #0E0E0E", 20 | "! c #F6F6F6", 21 | "~ c #5E5E5E", 22 | "{ c #B1B1B1", 23 | "] c #777777", 24 | "^ c #949494", 25 | "/ c #757575", 26 | "( c #C4C4C4", 27 | "_ c #E7E7E7", 28 | ": c #F1F1F1", 29 | "< c #F8F8F8", 30 | "[ c #EEEEEE", 31 | "} c #F0F0F0", 32 | "| c #FAFAFA", 33 | "1 c #7B7B7B", 34 | "2 c #3D3D3D", 35 | "3 c #868686", 36 | "4 c #4F4F4F", 37 | "5 c #ABABAB", 38 | "6 c #545454", 39 | "7 c #5B5B5B", 40 | "8 c #AFAFAF", 41 | "9 c #292929", 42 | "0 c #181818", 43 | "a c #C7C7C7", 44 | "b c #CFCFCF", 45 | "c c #7F7F7F", 46 | "d c #A3A3A3", 47 | "e c #4D4D4D", 48 | "f c #6A6A6A", 49 | "g c #A1A1A1", 50 | "h c #8E8E8E", 51 | "i c #696969", 52 | "j c #474747", 53 | "k c #5A5A5A", 54 | "l c #959595", 55 | "m c #767676", 56 | "n c #8B8B8B", 57 | "o c #BCBCBC", 58 | "p c #BFBFBF", 59 | "q c #D7D7D7", 60 | "r c #404040", 61 | "s c #636363", 62 | "t c #989898", 63 | "u c #8A8A8A", 64 | "................................", 65 | ".....+++++++++++++++++++++++....", 66 | "....+..+++++++++++++++++++..++..", 67 | "....+.+...................+.+.+.", 68 | "....++.@#.$%................+..+", 69 | "....++.&*.=-................+..+", 70 | "....++..;>,.................+..+", 71 | "....++..')!.................+..+", 72 | "....++.#~{].................+..+", 73 | "....++.^{./(................+..+", 74 | "....++......................+..+", 75 | "....++......................+..+", 76 | "....++.____:___<_[..<}..[|..+..+", 77 | "....++.1;21341156]7.89$:0a..+..+", 78 | "....++..bc.8^__8d.e.8fghia..+..+", 79 | "....++..bc.84115jkl.887mna..+..+", 80 | "....++..bc.8d..8dof.88pqna..+..+", 81 | "....++..bc.8rss5d.tu88..na..+...", 82 | "....++......................+.+.", 83 | "....++......................+.+.", 84 | "....+.+...................+.++..", 85 | "....+..+++++++++++++++++++..+...", 86 | ".....+++++++++++++++++++++++....", 87 | "................................", 88 | ".....++++++++++++++++++++++++...", 89 | "....+.......................+...", 90 | "...+.......................+....", 91 | "...+..++..++.++..++..+..++.+....", 92 | "....++..++..+..++..++.++........", 93 | "..+.......................+.+...", 94 | ".+.......................+......", 95 | ".++++++++++++++++++++++++++....."}; 96 | -------------------------------------------------------------------------------- /icons/xterm-color_48x48.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_color_48x48_xpm[] = { 3 | "48 48 10 1", 4 | ". c None", 5 | " c #555500", 6 | "+ c #000000", 7 | "@ c #FFFFFF", 8 | "# c #FF0000", 9 | "$ c #070700", 10 | "% c #0B0B00", 11 | "& c #FF8400", 12 | "* c #49FF00", 13 | "= c #60B7FF", 14 | "................................................", 15 | "......++++++++++++++++++++++++++++++++++........", 16 | ".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......", 17 | ".....+@@@++++++++++++++++++++++++++++@@@+@+.....", 18 | ".....+@@++++++++++++++++++++++++++++++@@+@@+....", 19 | ".....+@++++++++++++++++++++++++++++++++@+@@@+...", 20 | ".....+@++###++++###++++++++++++++++++++@+@@@@+..", 21 | ".....+@+++##++++##+++++++++++++++++++++@+@@@@+..", 22 | ".....+@++++##++##++++++++++++++++++++++@+@@@@+..", 23 | ".....+@++++##++##++++++++++++++++++++++@+@@@@+..", 24 | ".....+@+++++####+++++++++++++++++++++++@+@@@@+..", 25 | ".....+@+++++####+++++++++++++++++++++++@+@@@@+..", 26 | ".....+@++++++##++++++++++++++++++++++++@+@@@@+..", 27 | ".....+@+++++####+++++++++++++++++++++++@+@@@@+..", 28 | ".....+@+++++####+++++++++++++++++++++++@+@@@@+..", 29 | ".....+@++++##++##++++++++++++++++++++++@+@@@@+..", 30 | ".....+@++++##++##++++++++++++++++++++++@+@@@@+..", 31 | ".....+@+++##++++##+++++++++++++++++++++@+@@@@+..", 32 | ".....+@++###++++###++++++++++++++++++++@+@@@@+..", 33 | ".....+@++++++++++++++++++++++++++++++++@+@@@@+..", 34 | ".....+@$+++++++++++++++++++++++++++++++@+@@@@+..", 35 | ".....+@%@@@@@@@+&&&&&++****+++==+++==++@+@@@@+..", 36 | ".....+@++++@++++&++++++*+++*++==+++==++@+@@@@+..", 37 | ".....+@++++@++++&++++++*+++*++=+=+=+=++@+@@@@+..", 38 | ".....+@++++@++++&&&&+++****+++=+=+=+=++@+@@@@+..", 39 | ".....+@++++@++++&++++++*+*++++=++=++=++@+@@@+...", 40 | ".....+@++++@++++&++++++*++*+++=++=++=++@+@@@+...", 41 | ".....+@++++@++++&&&&&++*+++*++=+++++=++@+@@+....", 42 | ".....+@++++++++++++++++++++++++++++++++@+@@+....", 43 | ".....+@++++++++++++++++++++++++++++++++@+@+.....", 44 | ".....+@@++++++++++++++++++++++++++++++@@+@+.....", 45 | ".....+@@@++++++++++++++++++++++++++++@@@++......", 46 | ".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......", 47 | "......++++++++++++++++++++++++++++++++++........", 48 | "................................................", 49 | "................................................", 50 | "......++++++++++++++++++++++++++++++++++++......", 51 | ".....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@++......", 52 | ".....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@++......", 53 | "....+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+......", 54 | "....+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@+......", 55 | "...+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+......", 56 | "...+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@+@@+@@+......", 57 | "..+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@@+.......", 58 | "..+@++@++++++++++++++++++++++++++@++@+@+........", 59 | ".+@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@+@+.........", 60 | ".+++++++++++++++++++++++++++++++++++++..........", 61 | "................................................"}; 62 | -------------------------------------------------------------------------------- /icons/xterm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ThomasDickey/xterm-snapshots/d4f08d309169562dd0158a847d3b5e1b10a595ee/icons/xterm.png -------------------------------------------------------------------------------- /icons/xterm_16x16.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_16x16_xpm[] = { 3 | "16 16 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " . ", 8 | " .... . ", 9 | " .. . ", 10 | " .. . ", 11 | " .. . . ", 12 | " . ", 13 | " .... .. . ", 14 | " . . . .. . ", 15 | " . . ", 16 | " . . ", 17 | " . ", 18 | " . ", 19 | " ", 20 | " ", 21 | " . "}; 22 | -------------------------------------------------------------------------------- /icons/xterm_32x32.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_32x32_xpm[] = { 3 | "32 32 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " . .. ", 8 | " . ................... ... ", 9 | " . . ... . ", 10 | " . ... . ", 11 | " . .. ... ... . ", 12 | " . . . ... . ", 13 | " . .. ... . ", 14 | " . .. ... . ", 15 | " . .. ... . ", 16 | " . . . ... . ", 17 | " . ... .. ... . ", 18 | " . ... . ", 19 | " . ... . ", 20 | " . ........ ... .. ..... . ", 21 | " . . . . . ........ . ", 22 | " . . ... .. . . .... . ", 23 | " . . . . . . . .... . ", 24 | " . . ... . .. . .... . ", 25 | " . . .... ", 26 | " . . . ... ", 27 | " . .. ", 28 | " ....................... ", 29 | " ", 30 | " ........................ ", 31 | " . .. ", 32 | " .. ", 33 | " . . . ", 34 | " . . ", 35 | " . . ................. .. . ", 36 | " . .. ", 37 | " "}; 38 | -------------------------------------------------------------------------------- /icons/xterm_48x48.xpm: -------------------------------------------------------------------------------- 1 | /* XPM */ 2 | static char * xterm_48x48_xpm[] = { 3 | "48 48 2 1", 4 | " c None", 5 | ". c #000000", 6 | " ", 7 | " .................................. ", 8 | " . .. ", 9 | " . ............................ . . ", 10 | " . . . . . ", 11 | " . . . . . ", 12 | " . . . . . ", 13 | " . . ... ... . . . ", 14 | " . . . . . . . ", 15 | " . . . . . . . ", 16 | " . . . . . . . ", 17 | " . . .. . . . ", 18 | " . . .. . . . ", 19 | " . . . . . . . ", 20 | " . . . . . . . ", 21 | " . . . . . . . ", 22 | " . . ... ... . . . ", 23 | " . . . . . ", 24 | " . . . . . ", 25 | " . . . . . ", 26 | " . . . . . ", 27 | " . . ..... ..... .... . . . . . ", 28 | " . . . . . . .. .. . . . ", 29 | " . . . . . . .. .. . . . ", 30 | " . . . ..... .... . . . . . . . ", 31 | " . . . . . . . ... . . . .. ", 32 | " . . . . . . . . . . . . ", 33 | " . . . ..... . . . . . . .. ", 34 | " . . . . . ", 35 | " . . . . .. ", 36 | " . . . . . ", 37 | " . ............................ ... ", 38 | " . .. ", 39 | " .................................. ", 40 | " ", 41 | " ", 42 | " .................................... ", 43 | " . .. ", 44 | " . . . . . . . . . . . . . . . . . ... ", 45 | " . . . ", 46 | " . . . . . . . . . . . . . . . . . .. . ", 47 | " . . . ", 48 | " .. . . . . . . . . . . . . . . . . .. . ", 49 | " . . . ", 50 | " .. .. .......................... .... . ", 51 | " . . . ", 52 | " ..................................... ", 53 | " "}; 54 | -------------------------------------------------------------------------------- /keysym2ucs.h: -------------------------------------------------------------------------------- 1 | /* $XFree86: xc/programs/xterm/keysym2ucs.h,v 1.1 1999/06/12 15:37:18 dawes Exp $ */ 2 | /* 3 | * This module converts keysym values into the corresponding ISO 10646-1 4 | * (UCS, Unicode) values. 5 | */ 6 | 7 | #include 8 | 9 | long keysym2ucs(KeySym keysym); 10 | -------------------------------------------------------------------------------- /koi8rxterm: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: koi8rxterm,v 1.7 2023/05/03 23:59:22 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2007-2021,2023 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # This is a wrapper script to set up xterm with a KOI8-R locale; based on 35 | # uxterm by Branden Robinson. 36 | 37 | whoami=koi8rxterm 38 | 39 | : "${XTERM_PROGRAM=xterm}" 40 | 41 | # Check if there is a workable locale program. If there is not, we will read 42 | # something via the standard error. Ignore whatever is written to the 43 | # standard output. 44 | locale=`sh -c "LC_ALL=C LC_CTYPE=C LANG=C locale >/dev/null" 2>&1` 45 | found=no 46 | 47 | # Check for -version and -help options, to provide a simple return without 48 | # requiring the program to create a window: 49 | if test $# = 1 50 | then 51 | case $1 in 52 | -v|-ver*|-h|-he*) 53 | $XTERM_PROGRAM "$@" 54 | exit $? 55 | ;; 56 | esac 57 | fi 58 | 59 | # Check environment variables that xterm does, in the same order: 60 | for name in LC_ALL LC_CTYPE LANG 61 | do 62 | eval 'value=$'$name 63 | if test -n "$value" ; then 64 | case $value in 65 | *.koi8r|*.KOI8R|*.koi8-r|*.KOI8-R) 66 | found=yes 67 | ;; 68 | *.koi8r@*|*.KOI8R@*|*.koi8-r@*|*.KOI8-R*) 69 | found=yes 70 | ;; 71 | *) 72 | # The user may not have configured his or her 73 | # locale; try to muddle through anyway. 74 | value=ru_RU.KOI8-R 75 | ;; 76 | esac 77 | break 78 | fi 79 | done 80 | 81 | # If we didn't find one that uses KOI8-R, modify the safest one. Not everyone 82 | # has a KOI8-R locale installed (and there appears to be no trivial/portable 83 | # way to determine whether it is, from a shell script). We could check if the 84 | # user's shell does not reset unknown locale specifiers, but not all shells do. 85 | if test $found != yes ; then 86 | if test -n "$value" ; then 87 | value=`echo ${value} |sed -e 's/[.@].*//'`.KOI8-R 88 | else 89 | name="LC_CTYPE" 90 | value="ru_RU.KOI8-R" 91 | fi 92 | eval save=\$${name} 93 | eval ${name}=${value} 94 | eval export ${name} 95 | if test -z "$locale" ; then 96 | # The 'locale' program tries to do a sanity check. 97 | check=`sh -c "locale >/dev/null" 2>&1` 98 | if test -n "$check" ; then 99 | eval ${name}="${save}" 100 | eval export ${name} 101 | 102 | echo "$whoami tried to use locale $value by setting \$$name" >&2 103 | xmessage -file - < 5 | Homepage: https://invisible-island.net/xterm/ 6 | Build-Depends: debhelper (>= 7), xorg-docs-core, libxft-dev, libxpm-dev, libxaw7-dev, libutempter-dev 7 | Standards-Version: 3.8.2 8 | 9 | Package: xterm-dev 10 | Architecture: any 11 | Depends: xbitmaps, libc6 (>= 2.7), libfontconfig1, libice6 (>= 1:1.0.0), libutempter0 (>= 1.1.5), libx11-6, libxaw7, libxft2 (>> 2.1.1), libxmu6, libxt6 12 | Provides: x-terminal-emulator 13 | Recommends: xfonts-75dpi, xfonts-base, x11-utils | luit | bluit 14 | Description: X terminal emulator (development version) 15 | xterm is the standard terminal emulator for the X Window System. 16 | It provides DEC VT102 and Tektronix 4014 compatible terminals for 17 | programs that cannot use the window system directly. This version 18 | implements ISO/ANSI colors, Unicode, and most of the control sequences 19 | used by DEC VT220 terminals. 20 | . 21 | This package contains a development version of xterm. It is 22 | configured to use "xterm-dev" and "XTermDev" for the program 23 | and its resource class, to avoid conflict with other packages. 24 | -------------------------------------------------------------------------------- /package/debian/postinst: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | echo "** postinst script for xterm: $*" 3 | 4 | set -e 5 | 6 | PRI=60 7 | ALT=x-terminal-emulator 8 | PKG=xterm-dev 9 | 10 | BINDIR=/usr/bin 11 | MANDIR=/usr/share/man/man1 12 | 13 | if [ $1 != "upgrade" ] 14 | then 15 | update-alternatives \ 16 | --install \ 17 | $BINDIR/$ALT $ALT \ 18 | $BINDIR/$PKG $PRI \ 19 | --slave $MANDIR/$ALT.1.gz $ALT.1.gz \ 20 | $MANDIR/$PKG.1.gz 21 | fi 22 | 23 | #DEBHELPER# 24 | 25 | exit 0 26 | -------------------------------------------------------------------------------- /package/debian/prerm: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | echo "** prerm script for xterm: $*" 3 | 4 | set -e 5 | 6 | if [ "x$1" != "xupgrade" ]; then 7 | update-alternatives --remove x-terminal-emulator /usr/bin/xterm-dev 8 | fi 9 | 10 | #DEBHELPER# 11 | 12 | exit 0 13 | -------------------------------------------------------------------------------- /package/debian/source/format: -------------------------------------------------------------------------------- 1 | 3.0 (native) 2 | -------------------------------------------------------------------------------- /package/debian/watch: -------------------------------------------------------------------------------- 1 | version=3 2 | 3 | opts=passive ftp://ftp.invisible-island.net/xterm/current/xterm\.tar.gz \ 4 | debian uupdate 5 | -------------------------------------------------------------------------------- /package/debian/xterm-dev.docs: -------------------------------------------------------------------------------- 1 | README.i18n 2 | THANKS 3 | ctlseqs.ms 4 | ctlseqs.txt 5 | termcap 6 | terminfo 7 | xterm.log.html 8 | -------------------------------------------------------------------------------- /package/debian/xterm-dev.lintian-overrides: -------------------------------------------------------------------------------- 1 | # Ignore this, but keep in mind: 2 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=741573 3 | # https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=707851 4 | xterm-dev: command-in-menu-file-and-desktop-file xterm-dev usr/share/menu/xterm-dev:7 5 | xterm-dev: command-in-menu-file-and-desktop-file uxterm-dev usr/share/menu/xterm-dev:14 6 | 7 | # vile: confmode 8 | -------------------------------------------------------------------------------- /package/debian/xterm-dev.menu: -------------------------------------------------------------------------------- 1 | ?package(xterm-dev):\ 2 | needs="x11"\ 3 | section="Applications/Terminal Emulators"\ 4 | longtitle="XTerm: terminal emulator for X (development)"\ 5 | title="XTermDev"\ 6 | icon="/usr/share/pixmaps/xterm-dev-color_32x32.xpm"\ 7 | command="xterm-dev" 8 | ?package(xterm-dev):\ 9 | needs="x11"\ 10 | section="Applications/Terminal Emulators"\ 11 | longtitle="XTerm: terminal emulator for X with Unicode support (development)"\ 12 | title="XTermDev (Unicode)"\ 13 | icon="/usr/share/pixmaps/xterm-dev-color_32x32.xpm"\ 14 | command="uxterm-dev" 15 | -------------------------------------------------------------------------------- /package/debian/xterm-xres.sed: -------------------------------------------------------------------------------- 1 | /\*tek4014\*fontSmall:[ ]*6x10/a\ 2 | \ 3 | ! Debian package customizations follow.\ 4 | *backarrowKeyIsErase: true\ 5 | *ptyInitialErase: true 6 | /!*allowWindowOps: false/a\ 7 | *allowWindowOps: true 8 | -------------------------------------------------------------------------------- /package/freebsd/Makefile: -------------------------------------------------------------------------------- 1 | # $XTermId: Makefile,v 1.121 2025/04/15 20:33:49 tom Exp $ 2 | 3 | # This is adapted from the FreeBSD port, installing as "xterm-dev" with 4 | # separate resource- and manpage files. 5 | # copy "xterm-${PORTVERSION}.tgz to the port's distfiles directory 6 | # and "make makesum". 7 | 8 | PORTNAME= xterm 9 | DISTVERSION= 399 10 | CATEGORIES= x11 11 | MASTER_SITES= https://invisible-island.net/archives/xterm/:src1 \ 12 | https://invisible-mirror.net/archives/xterm/:src1 13 | PKGNAMESUFFIX= -dev 14 | DISTFILES= ${DISTNAME}${EXTRACT_SUFX}:src1 15 | 16 | MAINTAINER= ehaupt@FreeBSD.org 17 | COMMENT= Terminal emulator for the X Window System 18 | WWW= https://invisible-island.net/xterm/ 19 | 20 | LICENSE= MIT 21 | LICENSE_FILE= ${WRKSRC}/COPYING 22 | 23 | LIB_DEPENDS+= libfontconfig.so:x11-fonts/fontconfig 24 | 25 | USES= cpe localbase ncurses tar:tgz xorg 26 | CPE_VENDOR= invisible-island 27 | USE_XORG= ice x11 xext xft xmu xpm xt 28 | GNU_CONFIGURE= yes 29 | CONFIGURE_ARGS+= --enable-narrowproto \ 30 | --with-utempter 31 | 32 | CPPFLAGS+= -DPIXMAP_ROOTDIR=${LOCALBASE}/share/pixmaps 33 | 34 | CONFLICTS= x11iraf 35 | 36 | OPTIONS_DEFINE= 256COLOR DABBREV DECTERM GNOME LOGGING LUIT PCRE2 REGIS \ 37 | SCRNDUMP SIXEL TOOLBAR WCHAR XINERAMA 38 | OPTIONS_DEFAULT= 256COLOR LUIT SIXEL WCHAR XAW 39 | OPTIONS_SINGLE= ATHENA 40 | OPTIONS_SINGLE_ATHENA= NEXTAW XAW XAW3D XAW3DXFT 41 | 42 | 256COLOR_DESC= Enable 256-color support 43 | DABBREV_DESC= Enable support for dabbrev-expand 44 | DECTERM_DESC= Enable DECterm Locator support 45 | LOGGING_DESC= Enable logging terminal I/O to a file 46 | LUIT_DESC= Use LUIT for locale convertion from/to UTF-8 47 | NEXTAW_DESC= Link with neXT Athena library 48 | PCRE2_DESC= ${PCRE_DESC} version 2 49 | REGIS_DESC= Enable ReGIS graphics support 50 | SCRNDUMP_DESC= Enable XHTML and SVG screen dumps 51 | SIXEL_DESC= Enable Sixel graphics support 52 | TOOLBAR_DESC= Enable pulldown menus with a toolbar 53 | WCHAR_DESC= Enable wide-character support 54 | XAW3DXFT_DESC= Link with Xaw 3d xft (extended fonts) library 55 | XAW3D_DESC= Link with Xaw 3d library 56 | XAW_DESC= Link with Xaw library 57 | 58 | 256COLOR_CONFIGURE_ENABLE= 256-color 59 | DABBREV_CONFIGURE_ENABLE= dabbrev 60 | DECTERM_CONFIGURE_ENABLE= dec-locator 61 | GNOME_USES= desktop-file-utils 62 | LOGGING_CONFIGURE_ENABLE= logging 63 | LUIT_IMPLIES= WCHAR 64 | LUIT_BUILD_DEPENDS= luit:x11/luit 65 | LUIT_RUN_DEPENDS= luit:x11/luit 66 | LUIT_CONFIGURE_ENABLE= luit 67 | NEXTAW_LIB_DEPENDS= libneXtaw.so:x11-toolkits/neXtaw 68 | NEXTAW_CONFIGURE_WITH= neXtaw 69 | PCRE2_LIB_DEPENDS= libpcre2-8.so:devel/pcre2 70 | PCRE2_CONFIGURE_WITH= pcre2 71 | REGIS_CONFIGURE_ENABLE= regis-graphics 72 | SCRNDUMP_CONFIGURE_ENABLE= screen-dumps 73 | SIXEL_CONFIGURE_ENABLE= sixel-graphics 74 | TOOLBAR_CONFIGURE_ENABLE= toolbar 75 | WCHAR_LIB_DEPENDS= libfreetype.so:print/freetype2 76 | WCHAR_CONFIGURE_ENABLE= wide-chars 77 | WCHAR_VARS= PKGMESSAGE="${PKGDIR}/pkg-message.wchar" 78 | XAW3DXFT_LIB_DEPENDS= libXaw3dxft.so:x11-toolkits/libxaw3dxft 79 | XAW3DXFT_CONFIGURE_WITH= Xaw3dxft 80 | XAW3D_LIB_DEPENDS= libXaw3d.so:x11-toolkits/Xaw3d 81 | XAW3D_CONFIGURE_WITH= Xaw3d 82 | XAW_USE= XORG=xaw 83 | XINERAMA_USE= XORG=xinerama,xorgproto 84 | XINERAMA_CONFIGURE_OFF= --without-xinerama 85 | 86 | PKG_CLASS= XTermDev 87 | 88 | .include 89 | 90 | CONFIGURE_ARGS+= --program-suffix=${PKGNAMESUFFIX} --with-app-class=${PKG_CLASS} --without-xterm-symlink 91 | 92 | .if ! ${PORT_OPTIONS:MXAW3D} && ! ${PORT_OPTIONS:MXAW3DXFT} && ! ${PORT_OPTIONS:MNEXTAW} 93 | USE_XORG+= xaw 94 | .endif 95 | 96 | #ICONVERSION= 1 97 | # 98 | #post-extract: 99 | # @${CP} ${WRKDIR}/bsd-xterm-icons-${ICONVERSION}/*.png \ 100 | # ${WRKDIR}/bsd-xterm-icons-${ICONVERSION}/*.xpm \ 101 | # ${WRKSRC}/icons/ 102 | 103 | post-install: 104 | .for f in koi8rxterm${PKGNAMESUFFIX} resize${PKGNAMESUFFIX} uxterm${PKGNAMESUFFIX} xterm${PKGNAMESUFFIX} 105 | @${CHMOD} ${BINMODE} ${STAGEDIR}${PREFIX}/bin/${f} 106 | .endfor 107 | ${INSTALL_DATA} ${WRKSRC}/xterm.desktop \ 108 | ${STAGEDIR}${PREFIX}/share/applications/xterm${PKGNAMESUFFIX}.desktop 109 | 110 | .include 111 | -------------------------------------------------------------------------------- /package/freebsd/distinfo: -------------------------------------------------------------------------------- 1 | TIMESTAMP = 1733129732 2 | SHA256 (xterm-396.tgz) = a1f6be14857a31c87722605ff7b4e7c8bb82ff4dce859abac85c085548e87153 3 | SIZE (xterm-396.tgz) = 1585022 4 | SHA256 (bsd-xterm-icons-1.tgz) = fcf51dce0e23e9911a16ed7f2ce835bb6ff2ada65f023c29fdd8abda2795bf7c 5 | SIZE (bsd-xterm-icons-1.tgz) = 22718 6 | -------------------------------------------------------------------------------- /package/freebsd/pkg-descr: -------------------------------------------------------------------------------- 1 | The xterm program is the standard terminal emulator for the X 2 | Window System. It provides DEC VT102/VT220 and Tektronix 4014 3 | compatible terminals for programs that can't use the window 4 | system directly. If the underlying operating system supports 5 | terminal resizing capabilities (for example, the SIGWINCH 6 | signal in systems derived from 4.3bsd), xterm will use the 7 | facilities to notify programs running in the window whenever it 8 | is resized. 9 | -------------------------------------------------------------------------------- /package/freebsd/pkg-message.wchar: -------------------------------------------------------------------------------- 1 | [ 2 | { type: install 3 | message: < xterm.1.tbl && mv xterm.1.tbl xterm.1 57 | 58 | .include "options.mk" 59 | 60 | .include "../../mk/curses.buildlink3.mk" 61 | .include "../../mk/termcap.buildlink3.mk" 62 | .include "../../sysutils/desktop-file-utils/desktopdb.mk" 63 | .include "../../mk/xaw.buildlink3.mk" 64 | .include "../../mk/bsd.pkg.mk" 65 | -------------------------------------------------------------------------------- /package/pkgsrc/PLIST: -------------------------------------------------------------------------------- 1 | @comment $NetBSD: PLIST,v 1.10 2023/06/05 15:52:19 wiz Exp $ 2 | bin/koi8rxterm 3 | bin/resize 4 | bin/uxterm 5 | bin/xterm 6 | lib/X11/app-defaults/KOI8RXTerm 7 | lib/X11/app-defaults/KOI8RXTerm-color 8 | lib/X11/app-defaults/UXTerm 9 | lib/X11/app-defaults/UXTerm-color 10 | lib/X11/app-defaults/XTerm 11 | lib/X11/app-defaults/XTerm-color 12 | man/man1/koi8rxterm.1 13 | man/man1/resize.1 14 | man/man1/uxterm.1 15 | man/man1/xterm.1 16 | share/applications/uxterm.desktop 17 | share/applications/xterm.desktop 18 | share/pixmaps/filled-xterm_16x16.xpm 19 | share/pixmaps/filled-xterm_32x32.xpm 20 | share/pixmaps/filled-xterm_48x48.xpm 21 | share/pixmaps/mini.xterm_16x16.xpm 22 | share/pixmaps/mini.xterm_32x32.xpm 23 | share/pixmaps/mini.xterm_48x48.xpm 24 | share/pixmaps/xterm-color_16x16.xpm 25 | share/pixmaps/xterm-color_32x32.xpm 26 | share/pixmaps/xterm-color_48x48.xpm 27 | share/pixmaps/xterm_16x16.xpm 28 | share/pixmaps/xterm_32x32.xpm 29 | share/pixmaps/xterm_48x48.xpm 30 | -------------------------------------------------------------------------------- /package/pkgsrc/distinfo: -------------------------------------------------------------------------------- 1 | $NetBSD: distinfo,v 1.115 2024/10/27 05:42:46 pin Exp $ 2 | 3 | BLAKE2s (xterm-397.tgz) = 184268b9344b10846f2ce8291286ad0e88dd3ea221962bff6248508922367587 4 | SHA512 (xterm-397.tgz) = eea89645bc772072e2313423441d104c9dfba584eb2f76adbb1e68e7a3bc27ba69cf9fbbfae6b35dcad51c089bcf31cdbaf4f391e753137d5f6ba8ef913f34e3 5 | Size (xterm-397.tgz) = 1588379 bytes 6 | -------------------------------------------------------------------------------- /package/pkgsrc/options.mk: -------------------------------------------------------------------------------- 1 | # $NetBSD: options.mk,v 1.15 2019/11/03 09:14:21 rillig Exp $ 2 | 3 | PKG_OPTIONS_VAR= PKG_OPTIONS.xterm 4 | PKG_SUPPORTED_OPTIONS= debug pcre freetype luit xpm xterm-toolbar 5 | PKG_SUGGESTED_OPTIONS= freetype luit xpm 6 | 7 | .include "../../mk/bsd.options.mk" 8 | 9 | .if !empty(PKG_OPTIONS:Mdebug) 10 | CONFIGURE_ARGS+= --enable-trace 11 | CONFIGURE_ARGS+= --enable-warnings 12 | .elif defined(PKG_DEVELOPER) && !empty(PKG_DEVELOPER:M[Yy][Ee][Ss]) 13 | CONFIGURE_ARGS+= --enable-warnings 14 | .endif 15 | 16 | .if !empty(PKG_OPTIONS:Mfreetype) 17 | CONFIGURE_ARGS+= --enable-freetype 18 | . include "../../x11/libXft/buildlink3.mk" 19 | .else 20 | CONFIGURE_ARGS+= --disable-freetype 21 | .endif 22 | ### 23 | ### XXX The configure test checks for pcreposix_regcomp in libpcreposix. 24 | ### However, there is no such function [insofar as I can tell]. 25 | ### Moreover, libc's regex(3) functions are weak-aliased to those 26 | ### within libc's namespace, so we should have no problems. 27 | ### 28 | .if !empty(PKG_OPTIONS:Mpcre) 29 | CONFIGURE_ARGS+= --with-pcre 30 | CONFIGURE_ENV+= ac_cv_lib_pcreposix_pcreposix_regcomp=yes 31 | . include "../../devel/pcre/buildlink3.mk" 32 | .endif 33 | 34 | .if !empty(PKG_OPTIONS:Mluit) 35 | DEPENDS+= luit-[0-9]*:../../x11/luit 36 | CONFIGURE_ARGS+= --enable-luit --enable-mini-luit 37 | .else 38 | CONFIGURE_ARGS+= --disable-luit --disable-mini-luit 39 | .endif 40 | 41 | .if !empty(PKG_OPTIONS:Mxpm) 42 | ### nothing 43 | .else 44 | CONFIGURE_ARGS+= --without-xpm 45 | .endif 46 | 47 | .if !empty(PKG_OPTIONS:Mxterm-toolbar) 48 | CONFIGURE_ARGS+= --enable-toolbar 49 | .else 50 | CONFIGURE_ARGS+= --disable-toolbar 51 | .endif 52 | -------------------------------------------------------------------------------- /plink.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: plink.sh,v 1.17 2022/03/13 18:27:29 Ryan.Schmidt Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2001-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # 35 | # Reduce the number of dynamic libraries used to link an executable. 36 | LINKIT= 37 | ASNEED=no 38 | NO_LTO= 39 | 40 | # gcc's link-time optimization is very slow - reduce usage of that. 41 | case "$*" in 42 | *-flto=*|-flto\ ) 43 | NO_LTO=-fno-lto 44 | ;; 45 | esac 46 | 47 | : "${TMPDIR=/tmp}" 48 | 49 | while [ $# != 0 ] 50 | do 51 | if [ $ASNEED = no ] && [ -n "$LINKIT" ] 52 | then 53 | ASNEED=yes 54 | OPT=-Wl,-as-needed 55 | warned=`mktemp "$TMPDIR/xterm.XXXXXXXX"` 56 | trap "rm -f $warned; exit 1" 1 2 3 15 57 | trap "rm -f $warned" 0 58 | if ( eval $LINKIT $OPT $NO_LTO "$@" >"$warned" 2>&1 ) 59 | then 60 | WARNED=`cat "$warned"` 61 | rm -f "$warned" 62 | case ".$WARNED" in 63 | *Warning*|*nsupported*|*nrecognized*|*nknown*) 64 | ;; 65 | *) 66 | LINKIT="$LINKIT $OPT $*" 67 | break 68 | ;; 69 | esac 70 | else 71 | rm -f "$warned" 72 | fi 73 | fi 74 | 75 | OPT="$1" 76 | shift 77 | case $OPT in 78 | -k*) 79 | OPT=`echo "$OPT" | sed -e 's/^-k/-l/'` 80 | echo "always use $OPT (cannot test if needed)" 81 | LINKIT="$LINKIT $OPT" 82 | ;; 83 | -l*) 84 | echo "testing if $OPT is needed" 85 | if ( eval $LINKIT $NO_LTO "$@" >/dev/null 2>&1 ) 86 | then 87 | : echo ...no 88 | else 89 | echo ...yes 90 | LINKIT="$LINKIT $OPT" 91 | fi 92 | ;; 93 | *) 94 | LINKIT="$LINKIT $OPT" 95 | ;; 96 | esac 97 | done 98 | eval $LINKIT 99 | -------------------------------------------------------------------------------- /precompose.h: -------------------------------------------------------------------------------- 1 | /* $XFree86: xc/programs/xterm/precompose.h,v 1.1 2000/08/26 04:33:54 dawes Exp $ */ 2 | 3 | #ifndef PRECOMPOSE_H 4 | #define PRECOMPOSE_H 5 | 6 | int do_precomposition(int base, int comb); 7 | 8 | /* returns unicode value if a canonical composition exists, 9 | otherwise -1 */ 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /tektests/imtest.tek: -------------------------------------------------------------------------------- 1 |  ` @ `?_ `?_8m?_8m?_8m @8m @ ` @!r#D(0,0) ` @8m?_ `?_8m @,p @ 2 | -------------------------------------------------------------------------------- /tektests/imtesth.tek: -------------------------------------------------------------------------------- 1 |  `` @ c`?_ c`?_8om?_8om?_8lm @8lm @ `` @!`r#D(0,0) `` @8om?_ c`?_8lm @,`p @ 2 | -------------------------------------------------------------------------------- /tektests/ocpred.tek: -------------------------------------------------------------------------------- 1 | +gd5U+fd6T+fi6T*f6T+fd6T+dd7S+di7S*d7S+dd7S+gd8Q+gi8Q*g8Q+gd8Q+ed9P+ei9P*e9P+ed9P+dd:O+di:O*d:O+dd:O+fd;M+fi;M*f;M+fd;M+edI+fi>I*f>I+fd>I+dd?H+di?H*d?H+dd?H+dd?H+gd5U,cc5U,cc5Z,cc5P,cc5U-ka5U-ka5Z-ka5P-ka5U.g`5U.g`5Z.g`5P.g`5U.o~5U.o~5Z.o~5P.o~5U/k}5U/k}5Z/k}5P/k}5U0c|5U0c|5Z0c|5P0c|5U1oz5U1oz5Z1oz5P1oz5U2gy5U2gy5Z2gy5P2gy5U3cx5U3cx5Z3cx5P3cx5U4kv5U4kv5Z4kv5P4kv5U4kv5U+gd5U+ed4W*e4W+ei4W+ed4W+fd3X*f3X+fi3X+fd3X+dd2Z*d2Z+di2Z+dd2Z+ed1[*e1[+ei1[+ed1[+gd0\*g0\+gi0\+gd0\+dd/^*d/^+di/^+dd/^+fd._*f._+fi._+fd._+gd.@*g.@+gi.@+gd.@+ed-B*e-B+ei-B+ed-B+fd,C*f,C+fi,C+fd,C+fd,C+gd5U*oe5U*oe5P*oe5Z*oe5U)cg5U)cg5P)cg5Z)cg5U(kh5U(kh5P(kh5Z(kh5U'oi5U'oi5P'oi5Z'oi5U&gk5U&gk5P&gk5Z&gk5U%kl5U%kl5P%kl5Z%kl5U$cn5U$cn5P$cn5Z$cn5U#go5U#go5P#go5Z#go5U"op5U"op5P"op5Z"op5U!cr5U!cr5P!cr5Z!cr5U!cr5U4kv5U4k{5PN+fd,C*hl,FE!cr5U cy5PS+dd?H*hl>YW%`o @,cc5U,nb5T,nb5S,mb5R,ib5Q,db5P,`b5O,oa5M,ka5L,fa5K,o`5J,k`5I,``5I+h5H+`5G+h~5F+a~5E+j}5D+c}5C+g|5B+h{5B+a{5A+fz5@+ky4_+lx4_+bx4^+gw4]+iv4]+ju4\+lt4\+bt4[+ds4[+fr4Z+dq4Z+fp4Y+eo4Y+kn4X+fm4X+el4X+`k4X+cj4W+nh4W+mg4W+if4W+ie4W+ed4W+ac4W+ab4W+m`4W*n4W*k~4W*h}4X*e|4X*f{4X*cz4X*ey4Y*fx4Y*hw4Z*jv4Z*hu4[*jt4[*ls4\*bs4\*dr4]*gq4]*jp4^*lo4_*co4_*fn5@*im5A*`m5B*gl5B*nk5C*bk5D*ij5E*`j5F*ki5F*ci5G*kh5H*ch5I*og5J*fg5K*cg5L*of5M*hf5O*df5P*af5Q*me5R*ne5S*ne5T*oe5U*le5W*le5X*me5Y*af5Z*ff5[*jf5\*of5]*cg5^*dg6@*og6@*og6@*ch6A*jh6B*bi6C*ji6D*bj6E*ij6F*`k6G*kk6G*gl6H*bm6I*im6J*dn6K*co6K*no6L*hp6M*gq6M*ar6N*`s6O*ns6O*ht6P*fu6P*dv6Q*fw6Q*dx6R*ey6R*cz6R*d{6S*e|6S*j}6S*k~6S*l6T+m`6T+ab6T+ac6T+fd6T+ie6T+if6T+mg6T+lh6T+cj6S+bk6S+el6S+dm6S+kn6R+eo6R+dp6R+bq6Q+`r6Q+bs6P+`t6P+nt6O+hu6O+fv6N+gw6M+`x6M+nx6L+ky6K+dz6K+a{6J+j{6I+g|6H+l|6H+h}6G+a~6F+j~6E+c6D+k6C,c`6B,k`6A,o`6@,da6@,ka5^,oa5],bb5\,fb5[,ib5Z,mb5Y,lb5X,lb5W,cc5U$`l?@$`l?J$`l?E%`u?E%`u?@%`u?J%`j9Y 0.1"$`t9Y 2148 km#`v9YStar position#``9Yin sky plane"`j9YFrom 2:40: 0!`t9YEach 0: 1: 0+fd,C+fi,RSUN->.ke7[.di7[.na7\.ke7[-k{8@SAA.ke7[.`b7L.me7K-g~7L.`b7L-h~6\.eb6[-oz6\-h~6\-lz6L-i~6K-cw6L-lz6L-dw5\-a{5[-ks5\-dw5\-ms5L-jw5K-`p5M-ms5L-ap4\-ns4[-dl4]-ap4\-il4L-fp4K-lh4M-il4L-ai3\-nl3[-de3]-ai3\-fe3L-ci3K-ia3M-fe3L-na2\-ke2[,a~2]-na2\,b~2L-oa2K,ez2M,b~2L,kz1\,d~1\,nv1],kz1\,cw1L,lz1L,fs1M,cw1L,ds0],aw0\,ko0],ds0],lo0M,is0L,cl0M,lo0M,dl/],ap/\,kh/],dl/],ih/M,fl/L,ld/N,ih/M,ae.],nh.\,da.^,ae.],fa.M,ce.L+i}.N,fa.M+n}-],ka-\+az-^+n}-]+gz-M+`~-M+jv-N+gz-M+kv,]+dz,]+nr,^+kv,]+`s,N+mv,M+go,N+`s,N7lv @May 4 1986 Occultation of nepklem 1026 by Triton (N1)7h` @Observed from SAAO Sutherland 74" Long= -20 48 44.3 Lat= -32 22 43.46dj @13.11-magnitude star at RA= 18h 24m 16.1231s Dec=-22d 13' 22.807" 2 | 5`t @ (1950) RA= 18h 22m 5.3070s Dec=-22d 14' 27.910" 3 | 4l} @Closest at 2:45:30 U.T. 4hg @ Radial= 4158.7 km = 0.19"3dq @ Planet= 1600.0 km = 0.07"2`{ @ ET - UT = 56.1709 sec DE-1182ld @ P.A.= 12.7 deg.1hn @ Phase = 1.5 deg = 100.0%0dx @ Alt= 75 d, Az= -36 d0`b @ Sun alt=-30 d, Az= 90 d/lk @ Sun:127.8 d, Moon: 11.9 d.hu @ V =0.0007 "/s = 14.22 km/s-d @ D = 29.619079 A.U.-`i @Doug Mink 16: 4 Nov 11 1985-`i @ 4 | -------------------------------------------------------------------------------- /unicode/README: -------------------------------------------------------------------------------- 1 | -- $XTermId: README,v 1.11 2016/05/22 20:01:53 tom Exp $ 2 | -- $XFree86: xc/programs/xterm/unicode/README,v 1.5 2004/12/01 01:27:49 dickey Exp $ 3 | -- Thomas E. Dickey 4 | 5 | These scripts and datafiles are used for generating tables used in the 6 | UTF-8 implementation in xterm. 7 | 8 | To run the convmap.pl script, you will need a copy of UnicodeData.txt 9 | which is currently available as 10 | 11 | ftp://ftp.unicode.org/Public/UNIDATA/UnicodeData.txt 12 | 13 | It is a large file (>1Mb), so it is not included in this distribution. 14 | 15 | convmap.pl is used to generate ../keysym2ucs.c, e.g., 16 | 17 | ./convmap.pl >../keysym2ucs.c 18 | 19 | keysym.map is input data for convmap.pl 20 | 21 | The make-precompose.sh script makes the precompose.c file, which is used to 22 | handle canonical composition. This also needs UnicodeData.txt. It uses 23 | precompose.c.head and precompose.c.tail as templates. 24 | -------------------------------------------------------------------------------- /unicode/keysym.map: -------------------------------------------------------------------------------- 1 | # $XTermId: keysym.map,v 1.12 2025/03/26 08:00:13 tom Exp $ 2 | # 3 | # This list can be used to convert X11 Keysyms to Unicode 2.1 character. 4 | # The list is not checked for correctness by Unicode officials. Use it 5 | # at your own risk and the creator is not responsible for any damage that 6 | # occurred due to using this list. 7 | # 8 | # The list is created by looking at the Keysym names and the Unicode data 9 | # file. Other mapping tables were used as a reference where needed. 10 | # Due to a lack of knowledge of the Hebrew, Thai and Hangul symbols, 11 | # expect errors in these sections. The mapping of the keypad keys 12 | # might also require some adjustments. 13 | # 14 | # The following fields are used: 15 | # 1 The X11 keysym numbers from the include file keysymdef.h 16 | # 2 The Unicode (2.1) position (U0000 means unknown Unicode position) 17 | # # 18 | # 3 the name of the X11 keysym (without XK_) 19 | # 20 | # Authors: Richard Verhoeven, TUE, 21 | # Markus Kuhn, University of Cambridge, 22 | # 23 | # You are free to use and modify this table. If you introduce errors 24 | # in the table, please remove the copyright line. If you remove errors, 25 | # please let me know, so I can update my version. 26 | # 27 | # $XFree86: xc/programs/xterm/unicode/keysym.map,v 1.1 1999/06/12 15:37:24 dawes Exp $ 28 | # 29 | 0x09df U2422 # blank 30 | 0x13a4 U20ac # Euro 31 | 0x20a0 U20a0 # EcuSign 32 | 0x20a1 U20a1 # ColonSign 33 | 0x20a2 U20a2 # CruzeiroSign 34 | 0x20a3 U20a3 # FFrancSign 35 | 0x20a4 U20a4 # LiraSign 36 | 0x20a5 U20a5 # MillSign 37 | 0x20a6 U20a6 # NairaSign 38 | 0x20a7 U20a7 # PesetaSign 39 | 0x20a8 U20a8 # RupeeSign 40 | 0x20a9 U20a9 # WonSign 41 | 0x20aa U20aa # NewSheqelSign 42 | 0x20ab U20ab # DongSign 43 | 0xfe50 U0300 # dead_grave 44 | 0xfe51 U0301 # dead_acute 45 | 0xfe52 U0302 # dead_circumflex 46 | 0xfe53 U0303 # dead_tilde 47 | 0xfe54 U0304 # dead_macron 48 | 0xfe55 U0306 # dead_breve 49 | 0xfe56 U0307 # dead_abovedot 50 | 0xfe57 U0308 # dead_diaeresis 51 | 0xfe58 U030a # dead_abovering 52 | 0xfe59 U030b # dead_doubleacute 53 | 0xfe5a U030c # dead_caron 54 | 0xfe5b U0327 # dead_cedilla 55 | 0xfe5c U0328 # dead_ogonek 56 | 0xfe5d U0345 # dead_iota 57 | 0xfe5e U3099 # dead_voiced_sound 58 | 0xfe5f U309a # dead_semivoiced_sound 59 | 0xff08 U0008 # BackSpace /* back space, back char */ 60 | 0xff09 U0009 # Tab 61 | 0xff0a U000a # Linefeed /* Linefeed, LF */ 62 | 0xff0b U000b # Clear 63 | 0xff0d U000d # Return /* Return, enter */ 64 | 0xff13 U0013 # Pause /* Pause, hold */ 65 | 0xff14 U0014 # Scroll_Lock 66 | 0xff15 U0015 # Sys_Req 67 | 0xff1b U001b # Escape 68 | -------------------------------------------------------------------------------- /unicode/make-precompose.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: make-precompose.sh,v 1.6 2007/02/05 01:06:36 Thomas.Wolff Exp $ 3 | # $XFree86: xc/programs/xterm/unicode/make-precompose.sh,v 1.4 2005/03/29 04:00:32 tsi Exp $ 4 | 5 | cat precompose.c.head | sed -e's/@/$/g' 6 | 7 | # extract canonical decomposition data from UnicodeData.txt, 8 | # pad hex values to 5 digits, 9 | # sort numerically on base character, then combining character, 10 | # then reduce to 4 digits again where possible 11 | cut UnicodeData.txt -d ";" -f 1,6 | 12 | grep ";[0-9,A-F]" | grep " " | 13 | sed -e "s/ /, 0x/;s/^/{ 0x/;s/;/, 0x/;s/$/},/" | 14 | sed -e "s,0x\(....\)\([^0-9A-Fa-f]\),0x0\1\2,g" | 15 | (sort -k 3 || sort +2) | 16 | sed -e "s,0x0\(...[0-9A-Fa-f]\),0x\1,g" 17 | 18 | cat precompose.c.tail 19 | -------------------------------------------------------------------------------- /unicode/precompose.c.head: -------------------------------------------------------------------------------- 1 | /* 2 | * Canonical Compositions 3 | * 4 | * DO NOT EDIT BY HAND! This is generated by the script 5 | * unicode/make-precompose.sh 6 | */ 7 | /* @XTermId@ */ 8 | 9 | #include 10 | 11 | static struct { 12 | int replacement; 13 | int base; 14 | int comb; 15 | } precompositions[] = { 16 | -------------------------------------------------------------------------------- /unicode/precompose.c.tail: -------------------------------------------------------------------------------- 1 | }; 2 | 3 | #define UNICODE_SHIFT 21 4 | 5 | int do_precomposition(int base, int comb) { 6 | int min = 0; 7 | int max = sizeof(precompositions) / sizeof(precompositions[0]) - 1; 8 | unsigned long sought = ((unsigned) base << UNICODE_SHIFT) | (unsigned) comb; 9 | 10 | /* binary search */ 11 | while (max >= min) { 12 | int mid = (min + max) / 2; 13 | unsigned long that = ((unsigned long) precompositions[mid].base << UNICODE_SHIFT) | ((unsigned) precompositions[mid].comb); 14 | if (that < sought) { 15 | min = mid + 1; 16 | } else if (that > sought) { 17 | max = mid - 1; 18 | } else { 19 | return precompositions[mid].replacement; 20 | } 21 | } 22 | /* no match */ 23 | return -1; 24 | } 25 | -------------------------------------------------------------------------------- /uxterm.desktop: -------------------------------------------------------------------------------- 1 | # $XTermId: uxterm.desktop,v 1.16 2022/09/06 21:09:42 tom Exp $ 2 | # ----------------------------------------------------------------------------- 3 | # this file is part of xterm 4 | # 5 | # Copyright 2006-2019,2022 by Thomas E. Dickey 6 | # 7 | # All Rights Reserved 8 | # 9 | # Permission is hereby granted, free of charge, to any person obtaining a 10 | # copy of this software and associated documentation files (the 11 | # "Software"), to deal in the Software without restriction, including 12 | # without limitation the rights to use, copy, modify, merge, publish, 13 | # distribute, sublicense, and/or sell copies of the Software, and to 14 | # permit persons to whom the Software is furnished to do so, subject to 15 | # the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included 18 | # in all copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | # 28 | # Except as contained in this notice, the name(s) of the above copyright 29 | # holders shall not be used in advertising or otherwise to promote the 30 | # sale, use or other dealings in this Software without prior written 31 | # authorization. 32 | # ----------------------------------------------------------------------------- 33 | [Desktop Entry] 34 | Name=UXTerm 35 | #GenericName=Terminal 36 | Comment=xterm wrapper for Unicode environments 37 | Exec=uxterm 38 | Terminal=false 39 | Type=Application 40 | Encoding=UTF-8 41 | Icon=xterm-color_48x48 42 | Categories=System;TerminalEmulator; 43 | Keywords=shell;prompt;command;commandline;cmd; 44 | StartupWMClass=UXTerm 45 | -------------------------------------------------------------------------------- /uxterm.man: -------------------------------------------------------------------------------- 1 | .\" $XTermId: uxterm.man,v 1.9 2024/01/11 22:10:29 tom Exp $ 2 | .\" 3 | .\" Copyright 2007-2018,2024 Thomas E. Dickey 4 | .\" Copyright 2001, 2004 Branden Robinson 5 | .\" 6 | .\" Permission is hereby granted, free of charge, to any person obtaining a 7 | .\" copy of this software and associated documentation files (the "Software"), 8 | .\" to deal in the Software without restriction, including without limitation 9 | .\" the rights to use, copy, modify, merge, publish, distribute, sublicense, 10 | .\" and/or sell copies of the Software, and to permit persons to whom the 11 | .\" Software is furnished to do so, subject to the following conditions: 12 | .\" 13 | .\" The above copyright notice and this permission notice shall be included in 14 | .\" all copies or substantial portions of the Software. 15 | .\" 16 | .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 | .\" SOFTWARE IN THE PUBLIC INTEREST, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | .\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | .\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 | .\" DEALINGS IN THE SOFTWARE. 23 | .\" 24 | .ds N Uxterm 25 | .ds n uxterm 26 | .TH UXTERM 1 "__app_date__" "__app_version__" "X Window System" 27 | . 28 | .ie \n(.g \{\ 29 | .ds `` \(lq 30 | .ds '' \(rq 31 | .ds ' \(aq 32 | .\} 33 | .el \{\ 34 | .ie t .ds `` `` 35 | .el .ds `` "" 36 | .ie t .ds '' '' 37 | .el .ds '' "" 38 | .ie t .ds ' \(aq 39 | .el .ds ' ' 40 | .\} 41 | . 42 | .SH NAME 43 | uxterm \- 44 | X terminal emulator for Unicode (UTF-8) environments 45 | .SH SYNOPSIS 46 | .B \*n 47 | [ 48 | .I xterm-options 49 | ] 50 | .SH DESCRIPTION 51 | .B \*n 52 | is a wrapper around the 53 | .B xterm(1) 54 | program that invokes the latter program 55 | with the \*(``U__default_class__\*('' X resource class set. 56 | All arguments to 57 | .B \*n 58 | are passed to 59 | .B xterm 60 | without processing; the 61 | .B \-class 62 | and 63 | .B \-u8 64 | options should not be specified because they are used by the wrapper. 65 | See the 66 | .B xterm 67 | manual page for more information on 68 | .IR xterm-options . 69 | .PP 70 | The environment's locale settings (see \*(``ENVIRONMENT\*('' below) are 71 | used to discern the locale's character set. 72 | If no current locale can be determined, the locale \*(``en_US\*('' (the 73 | English language as used in the territory of the United States) is assumed. 74 | The 75 | .B locale(1) 76 | utility is used to determine whether the system supports the selected 77 | locale. 78 | If it does not, 79 | .B \*n 80 | will exit with an error and report the output of 81 | .BR locale . 82 | .PP 83 | .B Note: \*n 84 | may produce unexpected results if the current locale is set to one in which 85 | the UTF-8 character encoding is not supported, or if fonts using the ISO 86 | 10646-1 character set are not available. 87 | In the Debian system, the \*(``xfonts\-base\*('' package provides the fonts 88 | that 89 | .B \*n 90 | uses by default. 91 | To change the fonts 92 | .B \*n 93 | uses, edit the 94 | .I __apploaddir__/U__default_class__ 95 | file. 96 | .PP 97 | A similar wrapper, 98 | .B koi8rxterm(1), 99 | is available for KOI8-R environments. 100 | .SH ENVIRONMENT 101 | .TP 102 | .B LC_ALL\fR, \fBLC_CTYPE\fR, \fBLANG 103 | The values of these variables are checked, in order, to determine the 104 | character set used by the current locale. 105 | .SH AUTHORS 106 | Thomas Dickey 107 | .SH "SEE ALSO" 108 | .B locale(1), 109 | .B locale(7), 110 | .B koi8rxterm(1), 111 | .B xterm(1) 112 | -------------------------------------------------------------------------------- /version.c: -------------------------------------------------------------------------------- 1 | /* $XTermId: version.c,v 1.8 2024/12/01 20:27:00 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2013-2020,2024 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | */ 32 | 33 | #include 34 | #include 35 | #include 36 | 37 | /* 38 | * Returns the version-string used in the "-v' message as well as a few other 39 | * places. It is derived (when possible) from the __vendorversion__ symbol 40 | * that some newer imake configurations define. 41 | */ 42 | const char * 43 | xtermVersion(void) 44 | { 45 | static const char vendor_version[] = __vendorversion__; 46 | static char *buffer; 47 | const char *result; 48 | 49 | if (buffer == NULL) { 50 | const char *vendor = vendor_version; 51 | 52 | buffer = malloc(sizeof(vendor_version) + 256); 53 | if (buffer == NULL) { 54 | result = vendor; 55 | } else { 56 | char first[sizeof(vendor_version)]; 57 | char second[sizeof(vendor_version)]; 58 | 59 | /* some vendors leave trash in this string */ 60 | for (;;) { 61 | if (!strncmp(vendor, "Version ", (size_t) 8)) 62 | vendor += 8; 63 | else if (isspace(CharOf(*vendor))) 64 | ++vendor; 65 | else 66 | break; 67 | } 68 | if (strlen(vendor) < BUFSIZ && 69 | sscanf(vendor, "%[0-9.] %[A-Za-z_0-9.]", first, second) == 2) { 70 | sprintf(buffer, "%.80s %.80s(%d)", second, first, XTERM_PATCH); 71 | } else { 72 | sprintf(buffer, "%.80s(%d)", vendor, XTERM_PATCH); 73 | } 74 | result = buffer; 75 | } 76 | } else { 77 | result = buffer; 78 | } 79 | return result; 80 | } 81 | -------------------------------------------------------------------------------- /version.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: version.h,v 1.577 2025/05/18 23:47:49 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 1998-2024,2025 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | */ 32 | 33 | #ifndef included_version_h 34 | #define included_version_h 35 | /* 36 | * These definitions are used to build the string that's printed in response to 37 | * "xterm -version", or embedded in "xterm -help". It usually indicates the 38 | * version of X to which this version of xterm has been built. The resulting 39 | * number in parentheses is my patch number (Thomas E. Dickey). 40 | */ 41 | #define XTERM_PATCH 399 42 | #define XTERM_DATE 2025-05-18 43 | 44 | #ifndef __vendorversion__ 45 | #define __vendorversion__ "XTerm" 46 | #endif 47 | 48 | extern const char *xtermVersion(void); 49 | 50 | #endif /* included_version_h */ 51 | -------------------------------------------------------------------------------- /vttests/16colors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: 16colors.sh,v 1.22 2022/04/24 23:36:20 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Show a simple 16-color test pattern. It is a little more confusing than 35 | # 8colors.sh, since everything is abbreviated to fit on an 80-column line. 36 | # The high (8-15) combinations for foreground or background are marked with 37 | # a '+' sign. 38 | 39 | ESC="" 40 | CSI="${ESC}[" 41 | CMD='/bin/echo' 42 | OPT='-n' 43 | SUF='' 44 | : "${TMPDIR=/tmp}" 45 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 46 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 47 | { test ! -f "$TMP" || test -s "$TMP"; } && 48 | for verb in "printf" "print" ; do 49 | rm -f "$TMP" 50 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 51 | if test -f "$TMP" ; then 52 | if test ! -s "$TMP" ; then 53 | CMD="$verb" 54 | OPT= 55 | SUF='\c' 56 | break 57 | fi 58 | fi 59 | done 60 | rm -f "$TMP" 61 | 62 | trap '$CMD "${CSI}0m"; exit 1' 1 2 3 15 63 | trap '$CMD "${CSI}0m"' 0 64 | 65 | echo "${CSI}0m" 66 | while true 67 | do 68 | for AT in 0 1 4 7 69 | do 70 | case $AT in 71 | 0) attr=" ";; 72 | 1) attr="BO ";; 73 | 4) attr="UN ";; 74 | 7) attr="RV ";; 75 | esac 76 | for FG in 0 1 2 3 4 5 6 7 77 | do 78 | case $FG in 79 | 0) fcolor="BLK ";; 80 | 1) fcolor="RED ";; 81 | 2) fcolor="GRN ";; 82 | 3) fcolor="YEL ";; 83 | 4) fcolor="BLU ";; 84 | 5) fcolor="MAG ";; 85 | 6) fcolor="CYN ";; 86 | 7) fcolor="WHT ";; 87 | esac 88 | for HI in 3 9 89 | do 90 | if test $HI = 3 ; then 91 | color=" $fcolor" 92 | else 93 | color="+$fcolor" 94 | fi 95 | $CMD $OPT "${CSI}0;${AT}m$attr$SUF" 96 | $CMD $OPT "${CSI}${HI}${FG}m$color$SUF" 97 | for BG in 1 2 3 4 5 6 7 98 | do 99 | case $BG in 100 | 0) bcolor="BLK ";; 101 | 1) bcolor="RED ";; 102 | 2) bcolor="GRN ";; 103 | 3) bcolor="YEL ";; 104 | 4) bcolor="BLU ";; 105 | 5) bcolor="MAG ";; 106 | 6) bcolor="CYN ";; 107 | 7) bcolor="WHT ";; 108 | esac 109 | $CMD $OPT "${CSI}4${BG}m$bcolor$SUF" 110 | $CMD $OPT "${CSI}10${BG}m+$bcolor$SUF" 111 | done 112 | echo "${CSI}0m" 113 | done 114 | done 115 | sleep 1 116 | done 117 | done 118 | -------------------------------------------------------------------------------- /vttests/256colors.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: 256colors.pl,v 1.6 2017/01/22 18:34:06 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2014,2017 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | 35 | use strict; 36 | use warnings; 37 | 38 | # This uses 33 print-lines on an 80-column display. Printing the numbers in 39 | # hexadecimal would make it compact enough for 24x80, but less readable. 40 | 41 | our ( $bg, $fg ); 42 | 43 | for ( $bg = 0 ; $bg < 256 ; $bg++ ) { 44 | 45 | # print "\x1b[9;1H\x1b[2J"; 46 | for ( $fg = 0 ; $fg < 256 ; $fg++ ) { 47 | print "\x1b[48;5;${bg}m\x1b[38;5;${fg}m"; 48 | printf "%03.3d/%03.3d ", $fg, $bg; 49 | } 50 | print "\n"; 51 | sleep 1; 52 | } 53 | -------------------------------------------------------------------------------- /vttests/88colors.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: 88colors.pl,v 1.5 2017/01/22 18:34:06 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2014,2017 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Made from 256colors.pl 35 | 36 | use strict; 37 | use warnings; 38 | 39 | our ( $bg, $fg ); 40 | 41 | for ( $bg = 0 ; $bg < 88 ; $bg++ ) { 42 | print "\x1b[9;1H\x1b[48;5;${bg}m\x1b[2J"; 43 | for ( $fg = 0 ; $fg < 88 ; $fg++ ) { 44 | print "\x1b[38;5;${fg}m"; 45 | printf "%03.3d/%03.3d ", $fg, $bg; 46 | } 47 | sleep 1; 48 | print "\n"; 49 | } 50 | -------------------------------------------------------------------------------- /vttests/8colors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: 8colors.sh,v 1.23 2022/04/24 23:36:20 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Show a simple 8-color test pattern 35 | 36 | ESC="" 37 | CSI="${ESC}[" 38 | CMD='/bin/echo' 39 | OPT='-n' 40 | SUF='' 41 | : "${TMPDIR=/tmp}" 42 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 43 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 44 | { test ! -f "$TMP" || test -s "$TMP"; } && 45 | for verb in "printf" "print" ; do 46 | rm -f "$TMP" 47 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 48 | if test -f "$TMP" ; then 49 | if test ! -s "$TMP" ; then 50 | CMD="$verb" 51 | OPT= 52 | SUF='\c' 53 | break 54 | fi 55 | fi 56 | done 57 | rm -f "$TMP" 58 | 59 | trap '$CMD $OPT "${CSI}0m"; exit 1' 1 2 3 15 60 | trap '$CMD $OPT "${CSI}0m"' 0 61 | 62 | echo "${CSI}0m" 63 | while true 64 | do 65 | for AT in 0 1 4 7 66 | do 67 | case $AT in 68 | 0) attr="normal ";; 69 | 1) attr="bold ";; 70 | 4) attr="under ";; 71 | 7) attr="reverse ";; 72 | esac 73 | for FG in 0 1 2 3 4 5 6 7 74 | do 75 | case $FG in 76 | 0) fcolor="black ";; 77 | 1) fcolor="red ";; 78 | 2) fcolor="green ";; 79 | 3) fcolor="yellow ";; 80 | 4) fcolor="blue ";; 81 | 5) fcolor="magenta ";; 82 | 6) fcolor="cyan ";; 83 | 7) fcolor="white ";; 84 | esac 85 | $CMD $OPT "${CSI}0;${AT}m$attr${SUF}" 86 | $CMD $OPT "${CSI}3${FG}m$fcolor${SUF}" 87 | for BG in 1 2 3 4 5 6 7 88 | do 89 | case $BG in 90 | 0) bcolor="black ";; 91 | 1) bcolor="red ";; 92 | 2) bcolor="green ";; 93 | 3) bcolor="yellow ";; 94 | 4) bcolor="blue ";; 95 | 5) bcolor="magenta ";; 96 | 6) bcolor="cyan ";; 97 | 7) bcolor="white ";; 98 | esac 99 | $CMD $OPT "${CSI}4${BG}m$bcolor${SUF}" 100 | done 101 | echo "${CSI}0m" 102 | done 103 | sleep 1 104 | done 105 | done 106 | -------------------------------------------------------------------------------- /vttests/acolors.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: acolors.sh,v 1.16 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2002-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Demonstrate the use of the control sequence for changing ANSI colors. 35 | 36 | ESC="" 37 | CSI="${ESC}[" 38 | CMD='/bin/echo' 39 | OPT='-n' 40 | SUF='' 41 | : "${TMPDIR=/tmp}" 42 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 43 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 44 | { test ! -f "$TMP" || test -s "$TMP"; } && 45 | for verb in "printf" "print" ; do 46 | rm -f "$TMP" 47 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 48 | if test -f "$TMP" ; then 49 | if test ! -s "$TMP" ; then 50 | CMD="$verb" 51 | OPT= 52 | SUF='\c' 53 | break 54 | fi 55 | fi 56 | done 57 | rm -f "$TMP" 58 | 59 | LIST="00 30 80 d0 ff" 60 | 61 | exec /dev/tty 66 | read -r original 67 | stty $old 68 | original=${original}${SUF} 69 | 70 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 71 | trap '$CMD $OPT "$original" >/dev/tty' 0 72 | 73 | echo "${CSI}0;1;34mThis message is BLUE" 74 | echo "${CSI}0;1;31mThis message is RED ${CSI}0;31m(sometimes)" 75 | echo "${CSI}0;1;32mThis message is GREEN${CSI}0m" 76 | while true 77 | do 78 | for R in $LIST 79 | do 80 | for G in $LIST 81 | do 82 | for B in $LIST 83 | do 84 | # color "9" is bold-red 85 | test "$R" != 00 && test "$G" = 00 && test "$B" = 00 && $CMD $OPT "" >/dev/tty 86 | $CMD $OPT "${ESC}]4;9;rgb:$R/$G/$B${SUF}" >/dev/tty 87 | sleep 1 88 | done 89 | done 90 | done 91 | done 92 | -------------------------------------------------------------------------------- /vttests/acs.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: acs.pl,v 1.3 2018/04/22 15:14:45 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2018 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Assuming at least 24x80, print an array of the printable characters and their 35 | # mapping to alternate character-set. This also requires cursor-addressing. 36 | 37 | use strict; 38 | use warnings; 39 | use diagnostics; 40 | 41 | sub failed() { 42 | my $args = shift; 43 | printf STDERR "? %s\n", $args; 44 | exit 1; 45 | } 46 | 47 | sub need() { 48 | my $cap = shift; 49 | my $check = `tput $cap 0 0`; 50 | chomp $check; 51 | &failed("missing capability: $cap") if ( $check eq "" ); 52 | } 53 | 54 | &need("cup"); 55 | &need("clear"); 56 | &need("smacs"); 57 | &need("rmacs"); 58 | 59 | system("tput clear"); 60 | system("tput enacs"); 61 | my $smacs = `tput smacs`; 62 | my $rmacs = `tput rmacs`; 63 | 64 | for my $row ( 0 .. 15 ) { 65 | for my $col ( 0 .. 5 ) { 66 | my $ch = 32 + $row + $col * 16; 67 | last if ( $ch >= 127 ); 68 | system( sprintf( "tput cup %d %d", $row, 4 + $col * 12 ) ); 69 | my $xx = chr($ch); 70 | printf '%2x:%s{%s%s%s}', $ch, $xx, $smacs, $xx . $xx . $xx . $xx, 71 | $rmacs; 72 | } 73 | } 74 | 75 | printf "\n"; 76 | 77 | 1; 78 | -------------------------------------------------------------------------------- /vttests/altchars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: altchars.sh,v 1.4 2020/10/29 00:32:02 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2020 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | echo 35 | tput enacs 36 | tput smacs 37 | #define ACS_ULCORNER NCURSES_ACS('l') /* upper left corner */ 38 | #define ACS_LLCORNER NCURSES_ACS('m') /* lower left corner */ 39 | #define ACS_URCORNER NCURSES_ACS('k') /* upper right corner */ 40 | #define ACS_LRCORNER NCURSES_ACS('j') /* lower right corner */ 41 | #define ACS_LTEE NCURSES_ACS('t') /* tee pointing right */ 42 | #define ACS_RTEE NCURSES_ACS('u') /* tee pointing left */ 43 | #define ACS_BTEE NCURSES_ACS('v') /* tee pointing up */ 44 | #define ACS_TTEE NCURSES_ACS('w') /* tee pointing down */ 45 | #define ACS_HLINE NCURSES_ACS('q') /* horizontal line */ 46 | #define ACS_VLINE NCURSES_ACS('x') /* vertical line */ 47 | #define ACS_PLUS NCURSES_ACS('n') /* large plus or crossover */ 48 | cat <<'EOF' 49 | XlqqqqwqqqqwqqqqwqqqqkX 50 | XxaaaaxaaaaxaaaaxaaaaxX 51 | XtqqqqnqqqqnqqqqnqqqquX 52 | XxaaaaxaaaaxaaaaxaaaaxX 53 | XmqqqqvqqqqvqqqqvqqqqjX 54 | 55 | X _`abcdefghijklmn X 56 | X opqrstuvwxyz{|}~ X 57 | X ................ X 58 | EOF 59 | tput rmacs 60 | cat <<'EOF' 61 | +----+----+----+----+ 62 | EOF 63 | -------------------------------------------------------------------------------- /vttests/bold-italics.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: bold-italics.pl,v 1.1 2019/09/22 19:44:57 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2019 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Test bold-italics for single- and double-width characters. 35 | 36 | use strict; 37 | use warnings; 38 | 39 | use I18N::Langinfo qw(langinfo CODESET); 40 | 41 | our $encoding = lc( langinfo( CODESET() ) ); 42 | our $single_text = "ABCDEFGH"; 43 | our $double_text = ""; 44 | 45 | sub showcase($$) { 46 | my $testcase = shift; 47 | my $sgr_code = shift; 48 | printf "\033[%sm", $sgr_code; 49 | printf "%-8s%s\n", $testcase, $single_text; 50 | printf "%-8s%s\n", " ", $double_text if ( $encoding eq "utf-8" ); 51 | printf "\033[%sm", "0"; 52 | } 53 | 54 | sub doit() { 55 | my $bold = "1"; 56 | my $italics = "3"; 57 | &showcase( "Normal", "0" ); 58 | &showcase( "Bold", $bold ); 59 | &showcase( "Italics", $italics ); 60 | &showcase( "Both:BI", "$bold;$italics" ); 61 | } 62 | 63 | if ( $encoding eq "utf-8" ) { 64 | binmode( STDOUT, ":utf8" ); 65 | for my $n ( 0 .. length($single_text) - 1 ) { 66 | my $chr = substr( $single_text, $n, 1 ); 67 | $double_text .= chr( 0xff00 + ord($chr) - 32 ); 68 | } 69 | } 70 | &doit; 71 | 72 | 1; 73 | -------------------------------------------------------------------------------- /vttests/bounce.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: bounce.sh,v 1.3 2020/01/12 22:51:16 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2020 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # iconify/deiconify, recording the window properties 35 | LOG=1 36 | logit() { 37 | sleep 2 38 | [ -n "$WINDOWID" ] && xprop -id $WINDOWID >bounce${LOG}.log 39 | LOG=`expr $LOG + 1` 40 | } 41 | 42 | [ -n "$WINDOWID" ] && rm -f bounce*.log 43 | 44 | printf 'Hello ...\n' 45 | logit 46 | 47 | printf '\033[2t' 48 | logit 49 | 50 | printf '\033[1t' 51 | logit 52 | 53 | printf 'World!\n' 54 | logit 55 | 56 | [ -n "$WINDOWID" ] && ls -l bounce*.log 57 | -------------------------------------------------------------------------------- /vttests/ctlpix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: ctlpix.sh,v 1.6 2022/04/25 08:03:21 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2019,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | PATH="$(dirname "$(readlink -f "$0")"):$PATH" 35 | export PATH 36 | clear 37 | lo=9216 38 | hi=9232 39 | for n in `seq $lo $hi` 40 | do 41 | utf8.pl "$n" 42 | done 43 | altchars.sh 44 | -------------------------------------------------------------------------------- /vttests/dl.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $XTermId: dl.sh,v 1.4 2022/04/25 08:25:37 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2019,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | start_test() { 35 | printf '\033[H\033[2J' 36 | printf 'First line\nSecond line\nThird line\nLast line!\n' 37 | } 38 | 39 | actual_test() { 40 | printf '\033[2;8H' 41 | printf '\033[1M' 42 | printf '*' 43 | } 44 | 45 | set_margins() { 46 | printf '\033[?69h' 47 | printf '\033[4;40s' 48 | } 49 | 50 | reset_margins() { 51 | printf '\033[?69l' 52 | } 53 | 54 | finish_test() { 55 | printf '\033[10;1H' 56 | read -r -p "$*" 57 | } 58 | 59 | start_test 60 | actual_test 61 | finish_test NEXT 62 | 63 | start_test 64 | set_margins 65 | actual_test 66 | reset_margins 67 | finish_test DONE 68 | -------------------------------------------------------------------------------- /vttests/doublechars.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: doublechars.sh,v 1.26 2022/04/25 23:25:41 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Illustrate the use of double-size characters by drawing successive lines in 35 | # the commonly used video attributes. 36 | # 37 | # Use the -w option to force the output to wrap. It will look ugly, because 38 | # the double-high lines will be split. 39 | 40 | ESC="" 41 | CSI="${ESC}[" 42 | CMD='/bin/echo' 43 | OPT='-n' 44 | SUF='' 45 | : "${TMPDIR=/tmp}" 46 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 47 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 48 | { test ! -f "$TMP" || test -s "$TMP"; } && 49 | for verb in "printf" "print" ; do 50 | rm -f "$TMP" 51 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 52 | if test -f "$TMP" ; then 53 | if test ! -s "$TMP" ; then 54 | CMD="$verb" 55 | OPT= 56 | SUF='\c' 57 | break 58 | fi 59 | fi 60 | done 61 | rm -f "$TMP" 62 | 63 | ITAL=no 64 | SAVE=yes 65 | WRAP=no 66 | if test $# != 0 ; then 67 | while test $# != 0 68 | do 69 | case $1 in 70 | -i) ITAL=yes ;; 71 | -n) SAVE=no ;; 72 | -w) WRAP=yes ;; 73 | *) 74 | echo "usage: $0 [-i] [-n] [-w]" 75 | exit 1 76 | esac 77 | shift 78 | done 79 | fi 80 | 81 | if test $SAVE = yes ; then 82 | exec /dev/tty 87 | IFS=';' read -r junk high wide 88 | 89 | stty $old 90 | 91 | wide=`echo "$wide"|sed -e 's/t.*//'` 92 | original=${CSI}8\;${high}\;${wide}t${SUF} 93 | 94 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 95 | trap '$CMD $OPT "$original" >/dev/tty' 0 96 | 97 | fi 98 | 99 | if test $WRAP = yes ; then 100 | # turn on wrapping and force the screen to 80 columns 101 | $CMD $OPT "${CSI}?7h" >/dev/tty 102 | $CMD $OPT "${CSI}?40l" >/dev/tty 103 | else 104 | # force the screen to 132 columns 105 | $CMD $OPT "${CSI}?40h" >/dev/tty 106 | $CMD $OPT "${CSI}?3h" >/dev/tty 107 | fi 108 | 109 | for SGR in 0 1 4 5 7 110 | do 111 | $CMD $OPT "${CSI}0;${SGR}m" >/dev/tty 112 | test "$ITAL" = yes && $CMD $OPT "${CSI}3m" >/dev/tty 113 | for DBL in 5 3 4 6 5 114 | do 115 | $CMD $OPT "${ESC}#${DBL}" >/dev/tty 116 | echo "The quick brown fox jumps over the lazy dog" >/dev/tty 117 | done 118 | echo 119 | done 120 | $CMD $OPT "${CSI}0m" >/dev/tty 121 | -------------------------------------------------------------------------------- /vttests/dynamic.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: dynamic.pl,v 1.5 2018/08/10 15:01:35 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2011-2017,2018 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Test the dynamic-color query option of xterm. 35 | # The programs xtermcontrol and xtermset provide more options. 36 | 37 | use strict; 38 | use warnings; 39 | 40 | use Getopt::Std; 41 | use IO::Handle; 42 | 43 | our @color_names = ( 44 | "VT100 text foreground", 45 | "VT100 text background", 46 | "text cursor", 47 | "mouse foreground", 48 | "mouse background", 49 | "Tektronix foreground", 50 | "Tektronix background", 51 | "highlight background", 52 | "Tektronix cursor", 53 | "highlight foreground" 54 | ); 55 | 56 | our ( $opt_c, $opt_r ); 57 | 58 | $Getopt::Std::STANDARD_HELP_VERSION = 1; 59 | &getopts('c:r') || die( 60 | "Usage: $0 [options]\n 61 | Options:\n 62 | -c XXX set cursor-color 63 | -r reset colors 64 | " 65 | ); 66 | 67 | sub no_reply($) { 68 | open TTY, "+; 86 | close TTY; 87 | system "stty $old"; 88 | if ( defined $reply ) { 89 | die("^C received\n") if ( "$reply" eq "\003" ); 90 | } 91 | return $reply; 92 | } 93 | 94 | sub query_color($) { 95 | my $code = $_[0]; 96 | my $param1 = $code + 10; 97 | my $reply; 98 | 99 | $reply = get_reply("\x1b]$param1;?\007"); 100 | 101 | return unless defined $reply; 102 | if ( $reply =~ /\x1b]$param1;.*\007/ ) { 103 | my $value = $reply; 104 | 105 | $value =~ s/^\x1b]$param1;//; 106 | $value =~ s/\007//; 107 | 108 | printf "%24s = %s\n", $color_names[$code], $value; 109 | } 110 | } 111 | 112 | sub query_colors() { 113 | my $n; 114 | 115 | for ( $n = 0 ; $n <= 9 ; ++$n ) { 116 | &query_color($n); 117 | } 118 | } 119 | 120 | sub reset_colors() { 121 | my $n; 122 | 123 | for ( $n = 0 ; $n <= 9 ; ++$n ) { 124 | my $code = 110 + $n; 125 | &no_reply("\x1b]$code\007"); 126 | } 127 | } 128 | 129 | if ( defined($opt_c) ) { 130 | &no_reply("\x1b]12;$opt_c\007"); 131 | } 132 | if ( defined($opt_r) ) { 133 | &reset_colors(); 134 | } 135 | 136 | &query_colors(); 137 | -------------------------------------------------------------------------------- /vttests/dynamic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: dynamic.sh,v 1.25 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Demonstrate the use of dynamic colors by setting the background successively 35 | # to different values. 36 | 37 | ESC="" 38 | OSC="${ESC}]" 39 | CMD='/bin/echo' 40 | OPT='-n' 41 | SUF='' 42 | : "${TMPDIR=/tmp}" 43 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 44 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 45 | { test ! -f "$TMP" || test -s "$TMP"; } && 46 | for verb in "printf" "print" ; do 47 | rm -f "$TMP" 48 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 49 | if test -f "$TMP" ; then 50 | if test ! -s "$TMP" ; then 51 | CMD="$verb" 52 | OPT= 53 | SUF='\c' 54 | break 55 | fi 56 | fi 57 | done 58 | rm -f "$TMP" 59 | 60 | LIST="00 30 80 d0 ff" 61 | 62 | exec /dev/tty 67 | read -r original 68 | stty $old 69 | original=${original}${SUF} 70 | 71 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 72 | trap '$CMD $OPT "$original" >/dev/tty' 0 73 | 74 | while true 75 | do 76 | for R in $LIST 77 | do 78 | for G in $LIST 79 | do 80 | for B in $LIST 81 | do 82 | $CMD $OPT "${OSC}11;rgb:$R/$G/$B${SUF}" >/dev/tty 83 | sleep 1 84 | done 85 | done 86 | done 87 | done 88 | -------------------------------------------------------------------------------- /vttests/dynamic2.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: dynamic2.sh,v 1.11 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2006-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Demonstrate the use of dynamic colors by setting each dynamic color 35 | # successively to different values. 36 | 37 | ESC="" 38 | OSC="${ESC}]" 39 | CMD='/bin/echo' 40 | OPT='-n' 41 | SUF='' 42 | : "${TMPDIR=/tmp}" 43 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 44 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 45 | { test ! -f "$TMP" || test -s "$TMP"; } && 46 | for verb in "printf" "print" ; do 47 | rm -f "$TMP" 48 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 49 | if test -f "$TMP" ; then 50 | if test ! -s "$TMP" ; then 51 | CMD="$verb" 52 | OPT= 53 | SUF='\c' 54 | break 55 | fi 56 | fi 57 | done 58 | rm -f "$TMP" 59 | 60 | LIST="00 30 80 d0 ff" 61 | FULL="10 11 12 13 14 15 16 17 18" 62 | 63 | echo "reading current color settings" 64 | 65 | exec /dev/tty 73 | read -r reply 74 | eval original"$N"='${reply}${SUF}' 75 | original=${original}${reply}${SUF} 76 | done 77 | stty $old 78 | 79 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 80 | trap '$CMD $OPT "$original" >/dev/tty' 0 81 | 82 | while true 83 | do 84 | for N in $FULL 85 | do 86 | case $N in 87 | 10) echo "coloring text foreground";; 88 | 11) echo "coloring text background";; 89 | 12) echo "coloring text cursor";; 90 | 13) echo "coloring mouse foreground";; 91 | 14) echo "coloring mouse background";; 92 | 15) echo "coloring tektronix foreground";; 93 | 16) echo "coloring tektronix background";; 94 | 17) echo "coloring highlight background";; 95 | 18) echo "coloring tektronix cursor";; 96 | esac 97 | for R in $LIST 98 | do 99 | for G in $LIST 100 | do 101 | for B in $LIST 102 | do 103 | $CMD $OPT "${OSC}$N;rgb:$R/$G/$B${SUF}" >/dev/tty 104 | sleep 1 105 | done 106 | done 107 | done 108 | eval restore=\$original"$N" 109 | $CMD $OPT "$restore" >/dev/tty 110 | sleep 1 111 | done 112 | done 113 | -------------------------------------------------------------------------------- /vttests/fonts.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: fonts.sh,v 1.20 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Demonstrate control sequence which sets relative fonts. 35 | 36 | ESC="" 37 | CSI="${ESC}[" 38 | CMD='/bin/echo' 39 | OPT='-n' 40 | SUF='' 41 | : "${TMPDIR=/tmp}" 42 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 43 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 44 | { test ! -f "$TMP" || test -s "$TMP"; } && 45 | for verb in "printf" "print" ; do 46 | rm -f "$TMP" 47 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 48 | if test -f "$TMP" ; then 49 | if test ! -s "$TMP" ; then 50 | CMD="$verb" 51 | OPT= 52 | SUF='\c' 53 | break 54 | fi 55 | fi 56 | done 57 | rm -f "$TMP" 58 | 59 | exec /dev/tty 64 | read -r original 65 | 66 | stty $old 67 | original="${original}${SUF}" 68 | 69 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 70 | trap '$CMD $OPT "$original" >/dev/tty' 0 71 | 72 | F=1 73 | D=1 74 | T=6 75 | while true 76 | do 77 | $CMD $OPT "${ESC}]50;#$F${SUF}" >/dev/tty 78 | sleep 1 79 | if test .$D = .1 ; then 80 | test $F = $T && D=-1 81 | else 82 | test $F = 1 && D=1 83 | fi 84 | F=`expr $F + $D` 85 | done 86 | -------------------------------------------------------------------------------- /vttests/il.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $XTermId: il.sh,v 1.3 2022/04/25 08:26:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2019,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | start_test() { 35 | printf '\033[H\033[2J' 36 | printf 'First line\nSecond line\nThird line\nLast line!\n' 37 | } 38 | 39 | actual_test() { 40 | printf '\033[2;8H' 41 | printf '\033[1L' 42 | printf '*' 43 | } 44 | 45 | set_margins() { 46 | printf '\033[?69h' 47 | printf '\033[4;40s' 48 | } 49 | 50 | reset_margins() { 51 | printf '\033[?69l' 52 | } 53 | 54 | finish_test() { 55 | printf '\033[10;1H' 56 | read -r -p "$*" 57 | } 58 | 59 | start_test 60 | actual_test 61 | finish_test NEXT 62 | 63 | start_test 64 | set_margins 65 | actual_test 66 | reset_margins 67 | finish_test DONE 68 | -------------------------------------------------------------------------------- /vttests/iso2022.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: iso2022.pl,v 1.5 2021/02/13 01:24:32 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # Copyright 2021 by Thomas E. Dickey 5 | # 6 | # All Rights Reserved 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a 9 | # copy of this software and associated documentation files (the 10 | # "Software"), to deal in the Software without restriction, including 11 | # without limitation the rights to use, copy, modify, merge, publish, 12 | # distribute, sublicense, and/or sell copies of the Software, and to 13 | # permit persons to whom the Software is furnished to do so, subject to 14 | # the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included 17 | # in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | # 27 | # Except as contained in this notice, the name(s) of the above copyright 28 | # holders shall not be used in advertising or otherwise to promote the 29 | # sale, use or other dealings in this Software without prior written 30 | # authorization. 31 | # ----------------------------------------------------------------------------- 32 | # show ISO-2022 characters, by default GL and GR, optionally G1/G2/G3 33 | 34 | use strict; 35 | use warnings; 36 | 37 | use Getopt::Std; 38 | 39 | $| = 1; 40 | 41 | our ( $opt_k, $opt_n, $opt_q, $opt_s ); 42 | 43 | sub doit() { 44 | my $GL = ""; 45 | printf "-- vile: fk=8bit\n"; 46 | my $lo = 0; 47 | if ($opt_q) { 48 | $GL = 49 | "`1234567890-=\n" 50 | . "qwertyuiop[]\\\n" 51 | . "asdfghjkl;'\n" 52 | . "zxcvbnm,./\n" 53 | . "~!@#$%^&*()_+\n" 54 | . "QWERTYUIOP{}|\n" 55 | . "ASDFGHJKL:\"\n" 56 | . "ZXCVBNM<>?"; 57 | } 58 | else { 59 | $lo = $opt_k ? 0 : 32; 60 | for my $n ( $lo .. 127 ) { 61 | $GL .= chr($n); 62 | $GL .= "\n" if ( ( ( $n - 31 ) % 16 ) == 0 ); 63 | } 64 | } 65 | my $GR = ""; 66 | for my $n ( 0 .. ( length($GL) - 1 ) ) { 67 | my $c = substr( $GL, $n, 1 ); 68 | if ( ord($c) == 10 and ( not $opt_k or $n != 10 ) ) { 69 | $GR .= $c; 70 | } 71 | else { 72 | $GR .= chr( ord($c) + 128 ); 73 | } 74 | } 75 | if ($opt_s) { 76 | $GL =~ s/([^\n])/ $1/g; 77 | $GR =~ s/([^\n])/ $1/g; 78 | } 79 | printf "GL:\n%s\n", $GL; 80 | printf "GR:\n%s\n", $GR; 81 | } 82 | 83 | sub main::HELP_MESSAGE() { 84 | printf STDERR <; 57 | close TTY; 58 | system "stty $old"; 59 | return $reply; 60 | } 61 | 62 | sub csi_field { 63 | my $first = $_[0]; 64 | my $second = $_[1]; 65 | $first =~ s/^[^0-9]+//; 66 | while ( --$second > 0 ) { 67 | $first =~ s/^[\d]+//; 68 | $first =~ s/^[^\d]+//; 69 | } 70 | $first =~ s/[^\d]+.*$//; 71 | return $first; 72 | } 73 | 74 | our $original = get_reply("\x1b[18t"); 75 | our $high; 76 | our $wide; 77 | 78 | if ( defined($original) and ( $original =~ /\x1b\[8;\d+;\d+t/ ) ) { 79 | $high = csi_field( $original, 2 ); 80 | $wide = csi_field( $original, 3 ); 81 | printf "parsed terminal size $high,$wide\n"; 82 | } 83 | else { 84 | die "Cannot get current terminal size via escape sequence\n"; 85 | } 86 | 87 | # 88 | our $maximize = get_reply("\x1b[19t"); 89 | our $maxhigh; 90 | our $maxwide; 91 | 92 | if ( defined($maximize) and ( $maximize =~ /^\x1b\[9;\d+;\d+t/ ) ) { 93 | $maxhigh = csi_field( $maximize, 2 ); 94 | $maxwide = csi_field( $maximize, 3 ); 95 | $maxhigh != 0 or $maxhigh = $high * 2; 96 | $maxwide != 0 or $maxwide = $wide * 2; 97 | printf "parsed terminal maxsize $maxhigh,$maxwide\n"; 98 | } 99 | else { 100 | die "Cannot get maximum terminal size via escape sequence\n"; 101 | } 102 | 103 | our $zapped; 104 | our ( $w, $h, $a ); 105 | 106 | sub catch_zap { 107 | $zapped++; 108 | } 109 | $SIG{INT} = \&catch_zap; 110 | $SIG{QUIT} = \&catch_zap; 111 | $SIG{KILL} = \&catch_zap; 112 | $SIG{HUP} = \&catch_zap; 113 | $SIG{TERM} = \&catch_zap; 114 | 115 | $w = $wide; 116 | $h = $high; 117 | $a = 1; 118 | $zapped = 0; 119 | while ( $zapped == 0 ) { 120 | 121 | # sleep 1 122 | printf "resizing to $h by $w\n"; 123 | write_tty( "\x1b[8;$h;$w" . "t" ); 124 | if ( $a == 1 ) { 125 | if ( $w == $maxwide ) { 126 | $h += $a; 127 | if ( $h = $maxhigh ) { 128 | $a = -1; 129 | } 130 | } 131 | else { 132 | $w += $a; 133 | } 134 | } 135 | else { 136 | if ( $w == $wide ) { 137 | $h += $a; 138 | if ( $h = $high ) { 139 | $a = 1; 140 | } 141 | } 142 | else { 143 | $w += $a; 144 | } 145 | } 146 | } 147 | write_tty($original); 148 | -------------------------------------------------------------------------------- /vttests/resize.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: resize.sh,v 1.25 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Obtain the current screen size, then resize the terminal to the nominal 35 | # screen width/height, and restore the size. 36 | 37 | ESC="" 38 | CSI="${ESC}[" 39 | CMD='/bin/echo' 40 | OPT='-n' 41 | SUF='' 42 | : "${TMPDIR=/tmp}" 43 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 44 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 45 | { test ! -f "$TMP" || test -s "$TMP"; } && 46 | for verb in "printf" "print" ; do 47 | rm -f "$TMP" 48 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 49 | if test -f "$TMP" ; then 50 | if test ! -s "$TMP" ; then 51 | CMD="$verb" 52 | OPT= 53 | SUF='\c' 54 | break 55 | fi 56 | fi 57 | done 58 | rm -f "$TMP" 59 | 60 | exec /dev/tty 65 | IFS=';' read -r junk high wide 66 | 67 | $CMD $OPT "${CSI}19t${SUF}" > /dev/tty 68 | IFS=';' read -r junk maxhigh maxwide 69 | 70 | stty $old 71 | 72 | wide=`echo "$wide"|sed -e 's/t.*//'` 73 | maxwide=`echo "$maxwide"|sed -e 's/t.*//'` 74 | original=${CSI}8\;${high}\;${wide}t${SUF} 75 | 76 | test "$maxwide" = 0 && maxwide=`expr "$wide" \* 2` 77 | test "$maxhigh" = 0 && maxhigh=`expr "$high" \* 2` 78 | 79 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 80 | trap '$CMD $OPT "$original" >/dev/tty' 0 81 | 82 | w=$wide 83 | h=$high 84 | a=1 85 | while true 86 | do 87 | # sleep 1 88 | echo "resizing to $h by $w" 89 | $CMD $OPT "${CSI}8;${h};${w}t" >/dev/tty 90 | if test $a = 1 ; then 91 | if test "$w" = "$maxwide" ; then 92 | h=`expr "$h" + "$a"` 93 | if test "$h" = "$maxhigh" ; then 94 | a=-1 95 | fi 96 | else 97 | w=`expr "$w" + "$a"` 98 | fi 99 | else 100 | if test "$w" = "$wide" ; then 101 | h=`expr "$h" + "$a"` 102 | if test "$h" = "$high" ; then 103 | a=1 104 | fi 105 | else 106 | w=`expr "$w" + "$a"` 107 | fi 108 | fi 109 | done 110 | -------------------------------------------------------------------------------- /vttests/sgrPushPop.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: sgrPushPop.pl,v 1.10 2018/08/02 21:09:46 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm, contributed by Dan Thompson 5 | # 6 | # Copyright 2018 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | 35 | use strict; 36 | use warnings; 37 | 38 | # This script demonstrates the utility of the [non-standard] SGR push/pop 39 | # control sequences. The ability to save (on a stack) the current SGR 40 | # attributes (fg/bg color, bold, etc.) and then later restore them allows 41 | # [SGR-containing] text from independent sources to be easily composed 42 | # together, without requiring any sort of global coordination. 43 | 44 | our ( 45 | $pushSgr, $popSgr, $lib1Fmt, 46 | $lib2Fmt, $redOnBlack, $blackOnYellow, 47 | $blueOnGreen, $bg, $fg 48 | ); 49 | 50 | $pushSgr = "\x1b[#{"; 51 | $popSgr = "\x1b[#}"; 52 | 53 | # lib1Fmt represents a "top-level" program, and controls the current "ambient" 54 | # fg/bg colors. 55 | $lib1Fmt = "\x1b[48;5;%sm\x1b[38;5;%sm%03.3d/%03.3d "; 56 | 57 | # lib2Fmt represents some intermediate library. Note that it contains no SGR 58 | # control sequences at all. 59 | $lib2Fmt = "Test stack: %s, %s, %s"; 60 | 61 | # The following represent individual bits of colorized data that come from 62 | # other, "leaf-level" libraries. 63 | $redOnBlack = $pushSgr . "\x1b[1;31m\x1b[40m" . "redOnBlack" . $popSgr; 64 | $blackOnYellow = $pushSgr . "\x1b[30m\x1b[4;43m" . "blackOnYellow" . $popSgr; 65 | $blueOnGreen = $pushSgr . "\x1b[34m\x1b[42m" . "blueOnGreen" . $popSgr; 66 | 67 | printf $pushSgr; 68 | printf "\x1b[40;37mSetting ambient colors to white-on-black\n"; 69 | printf $pushSgr; 70 | 71 | for ( $bg = 0 ; $bg < 16 ; $bg++ ) { 72 | for ( $fg = 0 ; $fg < 16 ; $fg++ ) { 73 | printf $pushSgr; 74 | printf $lib1Fmt, $fg, $bg, $fg, $bg; 75 | printf $lib2Fmt, $redOnBlack, $blackOnYellow, $blueOnGreen; 76 | print " something else"; 77 | printf $popSgr; # keep the newline from bleeding color 78 | print "\n"; 79 | } 80 | print "\n"; 81 | } 82 | printf $popSgr; 83 | printf "The ambient colors should still be white-on-black.\n"; 84 | printf $popSgr; 85 | printf "Now we should be back to whatever it was before we got here.\n"; 86 | 87 | 1; 88 | -------------------------------------------------------------------------------- /vttests/tab0.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: tab0.sh,v 1.6 2022/04/25 22:49:46 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # Copyright 2019,2022 by Thomas E. Dickey 5 | # 6 | # All Rights Reserved 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a 9 | # copy of this software and associated documentation files (the 10 | # "Software"), to deal in the Software without restriction, including 11 | # without limitation the rights to use, copy, modify, merge, publish, 12 | # distribute, sublicense, and/or sell copies of the Software, and to 13 | # permit persons to whom the Software is furnished to do so, subject to 14 | # the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included 17 | # in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | # 27 | # Except as contained in this notice, the name(s) of the above copyright 28 | # holders shall not be used in advertising or otherwise to promote the 29 | # sale, use or other dealings in this Software without prior written 30 | # authorization. 31 | # ----------------------------------------------------------------------------- 32 | # Demonstrate hard-tabs. 33 | 34 | : "${TABS:=tabs}" 35 | : "${TPUT:=tput}" 36 | 37 | show() { 38 | printf "Tabs %s:" "$1" 39 | read -r ignore 40 | p=0 41 | while [ "$p" -lt "$wide" ] 42 | do 43 | printf "%s+----%d" "----" "`expr 1 + \( "$p" / 10 \)`" 44 | p=`expr $p + 10` 45 | done 46 | printf '\n' 47 | p=1 48 | printf " " 49 | while [ "$p" -lt "$wide" ] 50 | do 51 | printf "%*s" "$1" "*" 52 | p=`expr "$p" + "$1"` 53 | done 54 | printf '\n' 55 | p=0 56 | while [ "$p" -lt "$wide" ] 57 | do 58 | printf '\t+' 59 | p=`expr "$p" + "$1"` 60 | done 61 | printf '\n' 62 | printf "...done" 63 | read -r ignore 64 | } 65 | 66 | # enable hard tabs, disable autowrap. 67 | initialize() { 68 | "$TPUT" "$1" 69 | clear 70 | stty tabs 71 | printf '\033[?7l' 72 | } 73 | 74 | setup() { 75 | initialize reset 76 | } 77 | 78 | # Turn hard tabs off, reenable autowrap. 79 | restore() { 80 | stty -tabs 81 | printf '\033[?7h' 82 | } 83 | 84 | wide=`$TPUT cols` 85 | 86 | # If the terminal honors VT100 RIS, try that as a "hard reset" to get the 87 | # power-on behavior. 88 | for name in rs1 rs2 89 | do 90 | value=`$TPUT $name | sed -e 's//ESC:/g'` 91 | case "$value" in 92 | *ESC:c*) 93 | ;; 94 | *) 95 | value= 96 | ;; 97 | esac 98 | if [ -n "$value" ] 99 | then 100 | initialize $name 101 | printf 'Testing after tput %s\r\n' "$name" 102 | show 8 103 | break 104 | fi 105 | done 106 | 107 | # The following tests use the normal "reset" behavior. 108 | setup 109 | $TABS -8 110 | show 8 111 | $TABS -4 112 | show 4 113 | 114 | # Some terminal emulators are known to be buggy, and "reset" does not get them 115 | # to reset the tab-stops. 116 | setup 117 | show 8 118 | restore 119 | -------------------------------------------------------------------------------- /vttests/title.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: title.sh,v 1.26 2022/04/25 08:19:38 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 1999-2021,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Obtain the current title of the window, set up a simple clock which runs 35 | # until this script is interrupted, then restore the title. 36 | 37 | ESC="" 38 | CSI="${ESC}[" 39 | CMD='/bin/echo' 40 | OPT='-n' 41 | SUF='' 42 | : "${TMPDIR=/tmp}" 43 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 44 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 45 | { test ! -f "$TMP" || test -s "$TMP"; } && 46 | for verb in "printf" "print" ; do 47 | rm -f "$TMP" 48 | eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null 49 | if test -f "$TMP" ; then 50 | if test ! -s "$TMP" ; then 51 | CMD="$verb" 52 | OPT= 53 | SUF='\c' 54 | break 55 | fi 56 | fi 57 | done 58 | rm -f "$TMP" 59 | 60 | exec /dev/tty 65 | read -r original 66 | 67 | stty $old 68 | 69 | # We actually get this terminated by an backslash, but the backslash 70 | # is lost. We may lose doublequote characters when restoring the title, 71 | # depending on the shell. 72 | original=`echo "$original" |sed -e 's/^...//' -e 's/.$//'` 73 | original=${ESC}]2\;"${original}"${SUF} 74 | 75 | trap '$CMD $OPT "$original" >/dev/tty; exit 1' 1 2 3 15 76 | trap '$CMD $OPT "$original" >/dev/tty' 0 77 | 78 | while true 79 | do 80 | sleep 1 81 | $CMD $OPT "${ESC}]2;`date`" >/dev/tty 82 | done 83 | -------------------------------------------------------------------------------- /vttests/unascii.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # $XTermId: unascii.sh,v 1.4 2022/04/25 07:58:15 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2013,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # display the characters recognized by xterm in AsciiEquivs 35 | PATH="$(dirname "$(readlink -f "$0")"):$PATH" 36 | export PATH 37 | utf8.pl 0x2010 38 | utf8.pl 0x2011 39 | utf8.pl 0x2012 40 | utf8.pl 0x2013 41 | utf8.pl 0x2014 42 | utf8.pl 0x2015 43 | utf8.pl 0x2212 44 | utf8.pl 0x2018 45 | utf8.pl 0x2019 46 | utf8.pl 0x201C 47 | utf8.pl 0x201D 48 | utf8.pl 0x2329 49 | utf8.pl 0x232a 50 | -------------------------------------------------------------------------------- /vttests/under-latin.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: under-latin.pl,v 1.6 2020/01/31 00:16:52 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2020 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Print a text-test pattern using Latin-1 characters that have these features: 35 | # a) accents 36 | # b) descenders 37 | # c) underlining 38 | 39 | use strict; 40 | use warnings; 41 | 42 | use Getopt::Std; 43 | use Term::ReadKey; 44 | 45 | $| = 1; 46 | 47 | our ( $opt_b, $opt_i, $opt_u ); 48 | 49 | our $ROWS = 24; 50 | our $COLS = 4; 51 | 52 | our @sample; 53 | 54 | sub underlined($$) { 55 | my $text = shift; 56 | my $code = shift; 57 | $text = sprintf "\033[4m%s\033[24m", $text if ($code); 58 | return $text; 59 | } 60 | 61 | sub print_row($) { 62 | my $y = shift; 63 | my $cells = $y * 5; 64 | for my $x ( 0 .. $COLS ) { 65 | printf "%s", 66 | &underlined( $sample[ $cells % 2 ], ( $cells % 4 ) > 1 ? 1 : 0 ); 67 | ++$cells; 68 | } 69 | } 70 | 71 | sub main::HELP_MESSAGE() { 72 | printf STDERR <= $ROWS ); 117 | } 118 | 119 | if ( -t 1 ) { 120 | printf "\033[m"; 121 | ReadMode 'cbreak'; 122 | my $key = ReadKey(30); 123 | ReadMode 'normal'; 124 | } 125 | printf "\n"; 126 | 127 | 1; 128 | -------------------------------------------------------------------------------- /vttests/utf8.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: utf8.pl,v 1.12 2022/07/08 18:32:43 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2012-2018,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # display the given Unicode characters, given their hex or decimal values. 35 | 36 | use warnings FATAL => "overflow"; 37 | no warnings "portable"; 38 | use strict; 39 | use Encode 'encode_utf8'; 40 | use Text::CharWidth qw(mbswidth); 41 | 42 | $| = 1; 43 | 44 | sub num_bytes($) { 45 | my $char = shift; 46 | my $value = length( Encode::encode_utf8($char) ); 47 | my $result = 48 | ( $value <= 0 49 | ? "no bytes" 50 | : ( $value > 1 ? sprintf( "%d bytes", $value ) : "1 bytes" ) ); 51 | return $result; 52 | } 53 | 54 | sub num_cells($) { 55 | my $char = shift; 56 | my $value = mbswidth($char); 57 | my $result = 58 | ( $value <= 0 59 | ? "no cells" 60 | : ( $value > 1 ? sprintf( "%d cells", $value ) : "1 cell" ) ); 61 | return $result; 62 | } 63 | 64 | sub pad_column($) { 65 | my $char = shift; 66 | my $value = mbswidth($char); 67 | $value = 0 if ( $value < 0); 68 | my $result = sprintf( "%.*s", 3 - $value, " "); 69 | return $result; 70 | } 71 | 72 | sub vxt_utf8($) { 73 | my $arg = $_[0]; 74 | my $hex = $arg; 75 | my $dec = $arg; 76 | if ( $arg =~ /^u\+[[:xdigit:]]+$/i ) { 77 | $hex =~ s/^../0x/; 78 | $dec = hex($hex); 79 | } 80 | elsif ( $arg =~ /^0x[[:xdigit:]]+$/i ) { 81 | $dec = hex($hex); 82 | } 83 | elsif ( $arg =~ /^[[:xdigit:]]+$/i ) { 84 | $dec = hex($hex); 85 | } 86 | else { 87 | printf STDERR "? not a codepoint: $dec\n"; 88 | return; 89 | } 90 | my $chr = chr($dec); 91 | my $type = ( 92 | $chr =~ /\p{isPrint}/ 93 | ? ( 94 | $chr =~ /\p{isAlpha}/ 95 | ? "alpha" 96 | : ( 97 | $chr =~ /\p{isPunct}/ 98 | ? "punct" 99 | : ( 100 | $chr =~ /\p{isDigit}/ 101 | ? "digit" 102 | : "printing" 103 | ) 104 | ) 105 | ) 106 | : ( 107 | $chr =~ /\p{isCntrl}/ 108 | ? "cntrl" 109 | : "nonprinting" 110 | ) 111 | ); 112 | printf "%d ->%#x ->{%s}%s(%s %s %s)\n", $dec, $dec, $chr, 113 | &pad_column($chr), 114 | &num_bytes($chr), 115 | &num_cells($chr), 116 | $type; 117 | } 118 | 119 | binmode( STDOUT, ":utf8" ); 120 | while ( $#ARGV >= 0 ) { 121 | vxt_utf8( shift @ARGV ); 122 | } 123 | 124 | 1; 125 | -------------------------------------------------------------------------------- /vttests/version.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # $XTermId: version.sh,v 1.6 2022/04/25 22:47:07 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # this file is part of xterm 5 | # 6 | # Copyright 2020,2022 by Thomas E. Dickey 7 | # 8 | # All Rights Reserved 9 | # 10 | # Permission is hereby granted, free of charge, to any person obtaining a 11 | # copy of this software and associated documentation files (the 12 | # "Software"), to deal in the Software without restriction, including 13 | # without limitation the rights to use, copy, modify, merge, publish, 14 | # distribute, sublicense, and/or sell copies of the Software, and to 15 | # permit persons to whom the Software is furnished to do so, subject to 16 | # the following conditions: 17 | # 18 | # The above copyright notice and this permission notice shall be included 19 | # in all copies or substantial portions of the Software. 20 | # 21 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | # 29 | # Except as contained in this notice, the name(s) of the above copyright 30 | # holders shall not be used in advertising or otherwise to promote the 31 | # sale, use or other dealings in this Software without prior written 32 | # authorization. 33 | # ----------------------------------------------------------------------------- 34 | # Demonstrate version-string from xterm #354 35 | 36 | ESC="" 37 | CMD='/bin/echo' 38 | OPT='-n' 39 | SUF='' 40 | TMP=`(mktemp "$TMPDIR/xterm.XXXXXXXX") 2>/dev/null` || TMP="$TMPDIR/xterm$$" 41 | eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null 42 | ( test ! -f "$TMP" || test -s "$TMP" ) && 43 | for verb in printf print ; do 44 | rm -f "$TMP" 45 | eval '$verb "\c" >"$TMP" || echo fail >"$TMP"' 2>/dev/null 46 | if test -f "$TMP" ; then 47 | if test ! -s "$TMP" ; then 48 | CMD="$verb" 49 | OPT= 50 | SUF='\c' 51 | break 52 | fi 53 | fi 54 | done 55 | rm -f "$TMP" 56 | 57 | exec 0q${SUF}" > /dev/tty 62 | read -r version 63 | 64 | stty $old 65 | echo "$version" |cat -v 66 | -------------------------------------------------------------------------------- /vttests/vt52chars.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env perl 2 | # $XTermId: vt52chars.pl,v 1.1 2019/07/08 20:27:21 tom Exp $ 3 | # ----------------------------------------------------------------------------- 4 | # Copyright 2019 by Thomas E. Dickey 5 | # 6 | # All Rights Reserved 7 | # 8 | # Permission is hereby granted, free of charge, to any person obtaining a 9 | # copy of this software and associated documentation files (the 10 | # "Software"), to deal in the Software without restriction, including 11 | # without limitation the rights to use, copy, modify, merge, publish, 12 | # distribute, sublicense, and/or sell copies of the Software, and to 13 | # permit persons to whom the Software is furnished to do so, subject to 14 | # the following conditions: 15 | # 16 | # The above copyright notice and this permission notice shall be included 17 | # in all copies or substantial portions of the Software. 18 | # 19 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | # 27 | # Except as contained in this notice, the name(s) of the above copyright 28 | # holders shall not be used in advertising or otherwise to promote the 29 | # sale, use or other dealings in this Software without prior written 30 | # authorization. 31 | # ----------------------------------------------------------------------------- 32 | # show the vt52 graphic characters, annotatated in a table. 33 | 34 | sub clear() { 35 | printf "\033H"; # home 36 | printf "\033J"; # erase 37 | } 38 | 39 | sub move($$) { 40 | my $y = shift; 41 | my $x = shift; 42 | printf "\033Y%c%c", $y + 32, $x + 32; 43 | } 44 | 45 | sub start_vt52() { 46 | printf "\033[?2l"; 47 | } 48 | 49 | sub stop_vt52() { 50 | printf "\033<"; 51 | } 52 | 53 | sub show_char() { 54 | my $value = shift; 55 | my $string = shift; 56 | my $chr = $value - 0140; 57 | return if ( $chr < 0 ); # not supported by xterm 58 | $value &= 0xff; 59 | my $y = 2 + int( $chr % 16 ); 60 | my $x = 6 + int( $chr / 16 ) * 40; 61 | &move( $y, $x ); 62 | printf "%03o \033F%s\033G %s", $value, chr($value), $string; 63 | } 64 | 65 | sub show_table() { 66 | &clear; 67 | &move( 0, 28 ); 68 | printf "VT52 graphic characters"; 69 | &show_char( 0140, "reserved" ); 70 | &show_char( 0141, "solid rectangle" ); 71 | &show_char( 0142, "1/" ); 72 | &show_char( 0143, "3/" ); 73 | &show_char( 0144, "5/" ); 74 | &show_char( 0145, "7/" ); 75 | &show_char( 0146, "degrees" ); 76 | &show_char( 0147, "plus or minus" ); 77 | &show_char( 0150, "right arrow" ); 78 | &show_char( 0151, "ellipsis" ); 79 | &show_char( 0152, "divide by" ); 80 | &show_char( 0153, "down arrow" ); 81 | &show_char( 0154, "bar at scan 0" ); 82 | &show_char( 0155, "bar at scan 1" ); 83 | &show_char( 0156, "bar at scan 2" ); 84 | &show_char( 0157, "bar at scan 3" ); 85 | &show_char( 0160, "bar at scan 4" ); 86 | &show_char( 0161, "bar at scan 5" ); 87 | &show_char( 0162, "bar at scan 6" ); 88 | &show_char( 0163, "bar at scan 7" ); 89 | &show_char( 0164, "subscript 0" ); 90 | &show_char( 0165, "subscript 1" ); 91 | &show_char( 0166, "subscript 2" ); 92 | &show_char( 0167, "subscript 3" ); 93 | &show_char( 0170, "subscript 4" ); 94 | &show_char( 0171, "subscript 5" ); 95 | &show_char( 0172, "subscript 6" ); 96 | &show_char( 0173, "subscript 7" ); 97 | &show_char( 0174, "subscript 8" ); 98 | &show_char( 0175, "subscript 9" ); 99 | &show_char( 0176, "paragraph" ); 100 | &move( 19, 6 ); 101 | printf "BAR[\033F\154\155\156\157\160\161\162\163\033G]"; 102 | &move( 23, 0 ); 103 | } 104 | 105 | &start_vt52; 106 | &show_table; 107 | &stop_vt52; 108 | 109 | 1; 110 | -------------------------------------------------------------------------------- /wcwidth.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: wcwidth.h,v 1.14 2017/06/18 17:56:35 tom Exp $ */ 2 | 3 | /* $XFree86: xc/programs/xterm/wcwidth.h,v 1.5 2005/05/03 00:38:25 dickey Exp $ */ 4 | 5 | /* 6 | * Copyright 2000-2005,2017 by Thomas E. Dickey 7 | * 8 | * All Rights Reserved 9 | * 10 | * Permission is hereby granted, free of charge, to any person obtaining a 11 | * copy of this software and associated documentation files (the 12 | * "Software"), to deal in the Software without restriction, including 13 | * without limitation the rights to use, copy, modify, merge, publish, 14 | * distribute, sublicense, and/or sell copies of the Software, and to 15 | * permit persons to whom the Software is furnished to do so, subject to 16 | * the following conditions: 17 | * 18 | * The above copyright notice and this permission notice shall be included 19 | * in all copies or substantial portions of the Software. 20 | * 21 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 22 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 23 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 24 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 25 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 26 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 27 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 28 | * 29 | * Except as contained in this notice, the name(s) of the above copyright 30 | * holders shall not be used in advertising or otherwise to promote the 31 | * sale, use or other dealings in this Software without prior written 32 | * authorization. 33 | */ 34 | #ifndef included_wcwidth_h 35 | #define included_wcwidth_h 1 36 | 37 | #include 38 | 39 | extern void mk_wcwidth_init(int mode); 40 | 41 | extern int mk_wcswidth(const wchar_t * pwcs, size_t n); 42 | extern int mk_wcswidth_cjk(const wchar_t * pwcs, size_t n); 43 | extern int mk_wcwidth(wchar_t ucs); 44 | extern int mk_wcwidth_cjk(wchar_t ucs); 45 | extern int wcswidth_cjk(const wchar_t * pwcs, size_t n); 46 | 47 | #endif /* included_wcwidth_h */ 48 | -------------------------------------------------------------------------------- /xcharmouse.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: xcharmouse.h,v 1.19 2020/08/03 23:14:06 tom Exp $ */ 2 | 3 | /************************************************************ 4 | 5 | Copyright 1997-2012,2020 by Thomas E. Dickey 6 | Copyright 1998 by Jason Bacon 7 | 8 | All Rights Reserved 9 | 10 | Permission to use, copy, modify, and distribute this software and its 11 | documentation for any purpose and without fee is hereby granted, 12 | provided that the above copyright notice appear in all copies and that 13 | both that copyright notice and this permission notice appear in 14 | supporting documentation, and that the name of the above listed 15 | copyright holder(s) not be used in advertising or publicity pertaining 16 | to distribution of the software without specific, written prior 17 | permission. 18 | 19 | THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD 20 | TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY 21 | AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE 22 | LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 23 | WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 24 | ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 25 | OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 26 | 27 | ********************************************************/ 28 | 29 | #ifndef included_xcharmouse_h 30 | #define included_xcharmouse_h 31 | /* *INDENT-OFF* */ 32 | 33 | /* 34 | * Macros for dpmodes (Thomas Dickey and others): 35 | * J. Bacon, acadix@execpc.com, June 1998 36 | * Steve Wall, September 1999 37 | * Ilya Zakharevich, August 2002 38 | * Ryan Johnson, August 2010 39 | * Egmont Koblinger, December 2011 40 | */ 41 | 42 | /* DECSET arguments for turning on mouse reporting modes */ 43 | #define SET_X10_MOUSE 9 44 | #define SET_VT200_MOUSE 1000 45 | #define SET_VT200_HIGHLIGHT_MOUSE 1001 46 | #define SET_BTN_EVENT_MOUSE 1002 47 | #define SET_ANY_EVENT_MOUSE 1003 48 | 49 | #if OPT_FOCUS_EVENT 50 | #define SET_FOCUS_EVENT_MOUSE 1004 /* can be combined with above */ 51 | #endif 52 | 53 | #define SET_ALTERNATE_SCROLL 1007 /* wheel mouse may send cursor-keys */ 54 | 55 | /* Extend mouse tracking for terminals wider(taller) than 223 cols(rows) */ 56 | #define SET_EXT_MODE_MOUSE 1005 /* compatible with above */ 57 | #define SET_SGR_EXT_MODE_MOUSE 1006 58 | #define SET_URXVT_EXT_MODE_MOUSE 1015 59 | 60 | #define SET_PIXEL_POSITION_MOUSE 1016 /* like 1006, but pixels not chars */ 61 | 62 | #define SET_BUTTON1_MOVE_POINT 2001 /* click1 emit Esc seq to move point*/ 63 | #define SET_BUTTON2_MOVE_POINT 2002 /* press2 emit Esc seq to move point*/ 64 | #define SET_DBUTTON3_DELETE 2003 /* Double click-3 deletes */ 65 | #define SET_PASTE_IN_BRACKET 2004 /* Surround paste by escapes */ 66 | #define SET_PASTE_QUOTE 2005 /* Quote each char during paste */ 67 | #define SET_PASTE_LITERAL_NL 2006 /* Paste "\n" as C-j */ 68 | 69 | #if OPT_DEC_LOCATOR 70 | 71 | /* Bit fields for screen->locator_events */ 72 | #define LOC_BTNS_DN 0x1 73 | #define LOC_BTNS_UP 0x2 74 | 75 | /* Special values for screen->loc_filter_* */ 76 | #define LOC_FILTER_POS -1 77 | 78 | #endif /* OPT_DEC_LOCATOR */ 79 | 80 | /* Values for screen->send_mouse_pos */ 81 | typedef enum { 82 | MOUSE_OFF 83 | ,X10_MOUSE 84 | ,VT200_MOUSE 85 | ,VT200_HIGHLIGHT_MOUSE 86 | ,BTN_EVENT_MOUSE 87 | ,ANY_EVENT_MOUSE 88 | ,DEC_LOCATOR 89 | } XtermMouseModes; 90 | 91 | /* *INDENT-ON* */ 92 | 93 | #endif /* included_xcharmouse_h */ 94 | -------------------------------------------------------------------------------- /xstrings.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: xstrings.h,v 1.31 2024/12/01 20:27:00 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2000-2016,2024 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | */ 32 | 33 | #ifndef included_xstrings_h 34 | #define included_xstrings_h 1 35 | /* *INDENT-OFF* */ 36 | 37 | #include 38 | #include 39 | 40 | #define OkPasswd(p) ((p)->pw_name != NULL && (p)->pw_name[0] != 0) 41 | 42 | extern Boolean x_getpwnam(const char * /* name */, struct passwd * /* result */); 43 | extern Boolean x_getpwuid(uid_t /* uid */, struct passwd * /* result */); 44 | extern String x_nonempty(String /* s */); 45 | extern String x_skip_blanks(String /* s */); 46 | extern String x_skip_nonblanks(String /* s */); 47 | extern char **x_splitargs(const char * /* command */); 48 | extern char *x_basename(char * /* name */); 49 | extern char *x_decode_hex(const char * /* source */, const char ** /* next */); 50 | extern char *x_encode_hex(const char * /* source */); 51 | extern char *x_getenv(const char * /* name */); 52 | extern char *x_getlogin(uid_t /* uid */, struct passwd * /* in_out */); 53 | extern char *x_strdup(const char * /* s */); 54 | extern char *x_strindex(char * /* s1 */, const char * /* s2 */); 55 | extern char *x_strtrim(const char * /* s */); 56 | extern char *x_strrtrim(const char * /* s */); 57 | extern char x_toupper(int /* ch */); 58 | extern int x_hex2int(int /* ch */); 59 | extern int x_strcasecmp(const char * /* s1 */, const char * /* s2 */); 60 | extern int x_strncasecmp(const char * /* s1 */, const char * /* s2 */, unsigned /* n */); 61 | extern int x_wildstrcmp(const char * /* pattern */, const char * /* actual */); 62 | extern unsigned x_countargv(char ** /* argv */); 63 | extern void x_appendargv(char ** /* target */, char ** /* source */); 64 | extern void x_freeargs(char ** /* argv */); 65 | 66 | /* *INDENT-ON* */ 67 | 68 | #endif /* included_xstrings_h */ 69 | -------------------------------------------------------------------------------- /xterm.appdata.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | xterm.desktop 5 | CC-BY-3.0 6 | 7 | X11 8 | XTerm 9 | Terminal emulator for the X Window System 10 | 11 |

12 | XTerm is the standard terminal emulator for the X Window System. 13 | It provides DEC VT102/VT220 and selected features from higher-level 14 | terminals such as VT320/VT420/VT520 (VTxxx). It also provides Tektronix 15 | 4014 emulation for programs that cannot use the window system directly. 16 |

17 |

18 | You would use xterm to get a shell prompt, to run command-line programs. 19 |

20 |
21 | 22 | 23 | 24 | https://invisible-island.net/xterm/images/merged-xterm-menus-16x9.png 25 | 26 | XTerm with its popup menus superimposed 27 | 28 | 29 | 30 | shell 31 | prompt 32 | command 33 | commandline 34 | cmd 35 | terminal 36 | 37 | 38 | 39 | 40 | https://invisible-island.net/xterm/ 41 | dickey@invisible-island.net 42 | Thomas E. Dickey 43 | https://invisible-island.net/xterm/xterm.faq.html#report_bugs 44 | 45 | https://invisible-island.net/xterm/xterm.faq.html 46 | 47 |
48 | -------------------------------------------------------------------------------- /xterm.desktop: -------------------------------------------------------------------------------- 1 | # $XTermId: xterm.desktop,v 1.16 2022/09/06 21:10:14 tom Exp $ 2 | # ----------------------------------------------------------------------------- 3 | # this file is part of xterm 4 | # 5 | # Copyright 2006-2016,2022 by Thomas E. Dickey 6 | # 7 | # All Rights Reserved 8 | # 9 | # Permission is hereby granted, free of charge, to any person obtaining a 10 | # copy of this software and associated documentation files (the 11 | # "Software"), to deal in the Software without restriction, including 12 | # without limitation the rights to use, copy, modify, merge, publish, 13 | # distribute, sublicense, and/or sell copies of the Software, and to 14 | # permit persons to whom the Software is furnished to do so, subject to 15 | # the following conditions: 16 | # 17 | # The above copyright notice and this permission notice shall be included 18 | # in all copies or substantial portions of the Software. 19 | # 20 | # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 21 | # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 22 | # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 23 | # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 24 | # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 25 | # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 26 | # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 27 | # 28 | # Except as contained in this notice, the name(s) of the above copyright 29 | # holders shall not be used in advertising or otherwise to promote the 30 | # sale, use or other dealings in this Software without prior written 31 | # authorization. 32 | # ----------------------------------------------------------------------------- 33 | [Desktop Entry] 34 | Name=XTerm 35 | #GenericName=Terminal 36 | Comment=standard terminal emulator for the X window system 37 | Exec=xterm 38 | Terminal=false 39 | Type=Application 40 | Encoding=UTF-8 41 | Icon=xterm-color_48x48 42 | Categories=System;TerminalEmulator; 43 | Keywords=shell;prompt;command;commandline;cmd; 44 | StartupWMClass=XTerm 45 | -------------------------------------------------------------------------------- /xtermcap.h: -------------------------------------------------------------------------------- 1 | /* $XTermId: xtermcap.h,v 1.20 2013/06/23 15:34:37 tom Exp $ */ 2 | 3 | /* 4 | * Copyright 2007-2011,2013 by Thomas E. Dickey 5 | * 6 | * All Rights Reserved 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the 10 | * "Software"), to deal in the Software without restriction, including 11 | * without limitation the rights to use, copy, modify, merge, publish, 12 | * distribute, sublicense, and/or sell copies of the Software, and to 13 | * permit persons to whom the Software is furnished to do so, subject to 14 | * the following conditions: 15 | * 16 | * The above copyright notice and this permission notice shall be included 17 | * in all copies or substantial portions of the Software. 18 | * 19 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 21 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 22 | * IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY 23 | * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 24 | * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 25 | * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 26 | * 27 | * Except as contained in this notice, the name(s) of the above copyright 28 | * holders shall not be used in advertising or otherwise to promote the 29 | * sale, use or other dealings in this Software without prior written 30 | * authorization. 31 | */ 32 | 33 | /* 34 | * Common/useful definitions for XTERM termcap interface. 35 | */ 36 | #ifndef included_xtermcap_h 37 | #define included_xtermcap_h 38 | /* *INDENT-OFF* */ 39 | 40 | #include 41 | 42 | #include 43 | 44 | #ifndef HAVE_TIGETSTR 45 | #undef USE_TERMINFO 46 | #endif 47 | 48 | #ifndef USE_TERMINFO 49 | #define USE_TERMINFO 0 50 | #endif 51 | 52 | #if !USE_TERMINFO 53 | #undef HAVE_TIGETSTR 54 | #ifndef USE_TERMCAP 55 | #define USE_TERMCAP 1 56 | #endif 57 | #endif 58 | 59 | #undef ERR /* workaround for glibc 2.1.3 */ 60 | 61 | #ifdef HAVE_NCURSES_CURSES_H 62 | #include 63 | #else 64 | #include 65 | #endif 66 | 67 | #ifndef NCURSES_VERSION 68 | #ifdef HAVE_TERMCAP_H 69 | #include 70 | #endif 71 | #endif 72 | 73 | #ifdef HAVE_NCURSES_TERM_H 74 | #include 75 | #elif defined(HAVE_TERM_H) 76 | #include /* tgetent() */ 77 | #endif 78 | 79 | /* 80 | * Get rid of conflicting symbols from term.h 81 | */ 82 | #undef bell 83 | 84 | /***====================================================================***/ 85 | 86 | #ifdef __cplusplus 87 | extern "C" { 88 | #endif 89 | 90 | #define MOD_NONE 1 91 | #define MOD_SHIFT 1 92 | #define MOD_ALT 2 93 | #define MOD_CTRL 4 94 | #define MOD_META 8 95 | 96 | #define MODIFIER_NAME(parm, name) \ 97 | (((parm > MOD_NONE) && ((parm - MOD_NONE) & name)) ? " "#name : "") 98 | 99 | /* xtermcap.c */ 100 | extern Bool get_termcap(XtermWidget /* xw */, char * /* name */); 101 | extern void set_termcap(XtermWidget /* xw */, const char * /* name */); 102 | extern void free_termcap(XtermWidget /* xw */); 103 | 104 | extern char *get_tcap_buffer(XtermWidget /* xw */); 105 | extern char *get_tcap_erase(XtermWidget /* xw */); 106 | 107 | #if OPT_TCAP_FKEYS 108 | extern int xtermcapString(XtermWidget /* xw */, int /* keycode */, unsigned /* mask */); 109 | #endif 110 | 111 | #if OPT_TCAP_QUERY 112 | extern int xtermcapKeycode(XtermWidget /* xw */, const char ** /* params */, unsigned * /* state */, Bool * /* fkey */); 113 | #endif 114 | 115 | #ifdef __cplusplus 116 | } 117 | #endif 118 | 119 | /* *INDENT-ON* */ 120 | #endif /* included_xtermcap_h */ 121 | -------------------------------------------------------------------------------- /xutf8.h: -------------------------------------------------------------------------------- 1 | /* 2 | * $XTermId: xutf8.h,v 1.4 2010/10/10 14:10:12 Jeremy.Huddleston Exp $ 3 | */ 4 | /* 5 | Copyright (c) 2001 by Juliusz Chroboczek 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in 15 | all copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 23 | THE SOFTWARE. 24 | */ 25 | 26 | #include 27 | 28 | #ifndef X_HAVE_UTF8_STRING 29 | 30 | #undef XA_UTF8_STRING 31 | Atom _xa_utf8_string(Display*); 32 | #define XA_UTF8_STRING(dpy) _xa_utf8_string(dpy) 33 | 34 | #undef XUTF8StringStyle 35 | #define XUTF8StringStyle 4 36 | 37 | int Xutf8TextPropertyToTextList( 38 | Display *, 39 | const XTextProperty *, 40 | char ***, 41 | int * 42 | ); 43 | int 44 | Xutf8TextListToTextProperty( 45 | Display *, 46 | char **, 47 | int, 48 | XICCEncodingStyle, 49 | XTextProperty * 50 | ); 51 | int Xutf8LookupString( 52 | XIC, 53 | XKeyPressedEvent *, 54 | char *, 55 | int, 56 | KeySym *, 57 | Status * 58 | ); 59 | #else 60 | void xutf8_dummy(void); 61 | #endif 62 | --------------------------------------------------------------------------------