xterm-297/ 0000755 0001751 0000144 00000000000 12213740123 011246 5 ustar tom users xterm-297/config.guess 0000755 0001751 0000144 00000127607 12034016005 013577 0 ustar tom users #! /bin/sh
# Attempt to guess a canonical system name.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
# 2011, 2012 Free Software Foundation, Inc.
timestamp='2012-09-25'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Originally written by Per Bothner. Please send patches (context
# diff format) to and include a ChangeLog
# entry.
#
# This script attempts to guess a canonical system name similar to
# config.sub. If it succeeds, it prints the system name on stdout, and
# exits with 0. Otherwise, it exits with 1.
#
# You can get the latest version of this script from:
# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
Output the configuration name of the system \`$me' is run on.
Operation modes:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to ."
version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit ;;
--version | -v )
echo "$version" ; exit ;;
--help | --h* | -h )
echo "$usage"; exit ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help" >&2
exit 1 ;;
* )
break ;;
esac
done
if test $# != 0; then
echo "$me: too many arguments$help" >&2
exit 1
fi
trap 'exit 1' 1 2 15
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
# use `HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
set_cc_for_build='
trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
: ${TMPDIR=/tmp} ;
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
dummy=$tmp/dummy ;
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
case $CC_FOR_BUILD,$HOST_CC,$CC in
,,) echo "int x;" > $dummy.c ;
for c in cc gcc c89 c99 ; do
if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
CC_FOR_BUILD="$c"; break ;
fi ;
done ;
if test x"$CC_FOR_BUILD" = x ; then
CC_FOR_BUILD=no_compiler_found ;
fi
;;
,,*) CC_FOR_BUILD=$CC ;;
,*,*) CC_FOR_BUILD=$HOST_CC ;;
esac ; set_cc_for_build= ;'
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
# Note: order is significant - the case branches are not exclusive.
case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
# *-*-netbsdecoff* and *-*-netbsd*. For targets that recently
# switched to ELF, *-*-netbsd* would select the old
# object file format. This provides both forward
# compatibility and a consistent mechanism for selecting the
# object file format.
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
sysctl="sysctl -n hw.machine_arch"
UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
/usr/sbin/$sysctl 2>/dev/null || echo unknown)`
case "${UNAME_MACHINE_ARCH}" in
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
*) machine=${UNAME_MACHINE_ARCH}-unknown ;;
esac
# The Operating System including object format, if it has switched
# to ELF recently, or will in the future.
case "${UNAME_MACHINE_ARCH}" in
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
eval $set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
# Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
# Return netbsd for either. FIX?
os=netbsd
else
os=netbsdelf
fi
;;
*)
os=netbsd
;;
esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
case "${UNAME_VERSION}" in
Debian*)
release='-gnu'
;;
*)
release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
echo "${machine}-${os}${release}"
exit ;;
*:Bitrig:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
exit ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
exit ;;
*:ekkoBSD:*:*)
echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
exit ;;
*:SolidBSD:*:*)
echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
exit ;;
macppc:MirBSD:*:*)
echo powerpc-unknown-mirbsd${UNAME_RELEASE}
exit ;;
*:MirBSD:*:*)
echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
exit ;;
alpha:OSF1:*:*)
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
;;
*5.*)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
;;
esac
# According to Compaq, /usr/sbin/psrinfo has been available on
# OSF/1 and Tru64 systems produced since 1995. I hope that
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
case "$ALPHA_CPU_TYPE" in
"EV4 (21064)")
UNAME_MACHINE="alpha" ;;
"EV4.5 (21064)")
UNAME_MACHINE="alpha" ;;
"LCA4 (21066/21068)")
UNAME_MACHINE="alpha" ;;
"EV5 (21164)")
UNAME_MACHINE="alphaev5" ;;
"EV5.6 (21164A)")
UNAME_MACHINE="alphaev56" ;;
"EV5.6 (21164PC)")
UNAME_MACHINE="alphapca56" ;;
"EV5.7 (21164PC)")
UNAME_MACHINE="alphapca57" ;;
"EV6 (21264)")
UNAME_MACHINE="alphaev6" ;;
"EV6.7 (21264A)")
UNAME_MACHINE="alphaev67" ;;
"EV6.8CB (21264C)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8AL (21264B)")
UNAME_MACHINE="alphaev68" ;;
"EV6.8CX (21264D)")
UNAME_MACHINE="alphaev68" ;;
"EV6.9A (21264/EV69A)")
UNAME_MACHINE="alphaev69" ;;
"EV7 (21364)")
UNAME_MACHINE="alphaev7" ;;
"EV7.9 (21364A)")
UNAME_MACHINE="alphaev79" ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
# Reset EXIT trap before exiting to avoid spurious non-zero exit code.
exitcode=$?
trap '' 0
exit $exitcode ;;
Alpha\ *:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# Should we change UNAME_MACHINE based on the output of uname instead
# of the specific Alpha model?
echo alpha-pc-interix
exit ;;
21064:Windows_NT:50:3)
echo alpha-dec-winnt3.5
exit ;;
Amiga*:UNIX_System_V:4.0:*)
echo m68k-unknown-sysv4
exit ;;
*:[Aa]miga[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-amigaos
exit ;;
*:[Mm]orph[Oo][Ss]:*:*)
echo ${UNAME_MACHINE}-unknown-morphos
exit ;;
*:OS/390:*:*)
echo i370-ibm-openedition
exit ;;
*:z/VM:*:*)
echo s390-ibm-zvmoe
exit ;;
*:OS400:*:*)
echo powerpc-ibm-os400
exit ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
echo arm-acorn-riscix${UNAME_RELEASE}
exit ;;
arm*:riscos:*:*|arm*:RISCOS:*:*)
echo arm-unknown-riscos
exit ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
echo hppa1.1-hitachi-hiuxmpp
exit ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
if test "`(/bin/universe) 2>/dev/null`" = att ; then
echo pyramid-pyramid-sysv3
else
echo pyramid-pyramid-bsd
fi
exit ;;
NILE*:*:*:dcosx)
echo pyramid-pyramid-svr4
exit ;;
DRS?6000:unix:4.0:6*)
echo sparc-icl-nx6
exit ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
sparc) echo sparc-icl-nx7; exit ;;
esac ;;
s390x:SunOS:*:*)
echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4H:SunOS:5.*:*)
echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
echo i386-pc-auroraux${UNAME_RELEASE}
exit ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
eval $set_cc_for_build
SUN_ARCH="i386"
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
SUN_ARCH="x86_64"
fi
fi
echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
sun4*:SunOS:*:*)
case "`/usr/bin/arch -k`" in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
# Japanese Language versions have a version number like `4.1.3-JL'.
echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
exit ;;
sun3*:SunOS:*:*)
echo m68k-sun-sunos${UNAME_RELEASE}
exit ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
case "`/bin/arch`" in
sun3)
echo m68k-sun-sunos${UNAME_RELEASE}
;;
sun4)
echo sparc-sun-sunos${UNAME_RELEASE}
;;
esac
exit ;;
aushp:SunOS:*:*)
echo sparc-auspex-sunos${UNAME_RELEASE}
exit ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
# > m68000). The system name ranges from "MiNT" over "FreeMiNT"
# to the lowercase version "mint" (or "freemint"). Finally
# the system name "TOS" denotes a system which is actually not
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
echo m68k-atari-mint${UNAME_RELEASE}
exit ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
echo m68k-milan-mint${UNAME_RELEASE}
exit ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
echo m68k-hades-mint${UNAME_RELEASE}
exit ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
echo m68k-unknown-mint${UNAME_RELEASE}
exit ;;
m68k:machten:*:*)
echo m68k-apple-machten${UNAME_RELEASE}
exit ;;
powerpc:machten:*:*)
echo powerpc-apple-machten${UNAME_RELEASE}
exit ;;
RISC*:Mach:*:*)
echo mips-dec-mach_bsd4.3
exit ;;
RISC*:ULTRIX:*:*)
echo mips-dec-ultrix${UNAME_RELEASE}
exit ;;
VAX*:ULTRIX*:*:*)
echo vax-dec-ultrix${UNAME_RELEASE}
exit ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
echo clipper-intergraph-clix${UNAME_RELEASE}
exit ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
#else
int main (argc, argv) int argc; char *argv[]; {
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c &&
dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
SYSTEM_NAME=`$dummy $dummyarg` &&
{ echo "$SYSTEM_NAME"; exit; }
echo mips-mips-riscos${UNAME_RELEASE}
exit ;;
Motorola:PowerMAX_OS:*:*)
echo powerpc-motorola-powermax
exit ;;
Motorola:*:4.3:PL8-*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
echo powerpc-harris-powermax
exit ;;
Night_Hawk:Power_UNIX:*:*)
echo powerpc-harris-powerunix
exit ;;
m88k:CX/UX:7*:*)
echo m88k-harris-cxux7
exit ;;
m88k:*:4*:R4*)
echo m88k-motorola-sysv4
exit ;;
m88k:*:3*:R3*)
echo m88k-motorola-sysv3
exit ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
then
if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
[ ${TARGET_BINARY_INTERFACE}x = x ]
then
echo m88k-dg-dgux${UNAME_RELEASE}
else
echo m88k-dg-dguxbcs${UNAME_RELEASE}
fi
else
echo i586-dg-dgux${UNAME_RELEASE}
fi
exit ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
echo m88k-dolphin-sysv3
exit ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
echo m88k-motorola-sysv3
exit ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
echo m88k-tektronix-sysv3
exit ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
echo m68k-tektronix-bsd
exit ;;
*:IRIX*:*:*)
echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
exit ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
echo i386-ibm-aix
exit ;;
ia64:AIX:*:*)
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
exit ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
main()
{
if (!__power_pc())
exit(1);
puts("powerpc-ibm-aix3.2.5");
exit(0);
}
EOF
if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
then
echo "$SYSTEM_NAME"
else
echo rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
echo rs6000-ibm-aix3.2.4
else
echo rs6000-ibm-aix3.2
fi
exit ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
if [ -x /usr/bin/oslevel ] ; then
IBM_REV=`/usr/bin/oslevel`
else
IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
fi
echo ${IBM_ARCH}-ibm-aix${IBM_REV}
exit ;;
*:AIX:*:*)
echo rs6000-ibm-aix
exit ;;
ibmrt:4.4BSD:*|romp-ibm:BSD:*)
echo romp-ibm-bsd4.4
exit ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
exit ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
echo rs6000-bull-bosx
exit ;;
DPX/2?00:B.O.S.:*:*)
echo m68k-bull-sysv3
exit ;;
9000/[34]??:4.3bsd:1.*:*)
echo m68k-hp-bsd
exit ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
echo m68k-hp-bsd4.4
exit ;;
9000/[34678]??:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
case "${UNAME_MACHINE}" in
9000/31? ) HP_ARCH=m68000 ;;
9000/[34]?? ) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
if [ -x /usr/bin/getconf ]; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
case "${sc_cpu_version}" in
523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
case "${sc_kernel_bits}" in
32) HP_ARCH="hppa2.0n" ;;
64) HP_ARCH="hppa2.0w" ;;
'') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
esac ;;
esac
fi
if [ "${HP_ARCH}" = "" ]; then
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#define _HPUX_SOURCE
#include
#include
int main ()
{
#if defined(_SC_KERNEL_BITS)
long bits = sysconf(_SC_KERNEL_BITS);
#endif
long cpu = sysconf (_SC_CPU_VERSION);
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
case CPU_PA_RISC2_0:
#if defined(_SC_KERNEL_BITS)
switch (bits)
{
case 64: puts ("hppa2.0w"); break;
case 32: puts ("hppa2.0n"); break;
default: puts ("hppa2.0"); break;
} break;
#else /* !defined(_SC_KERNEL_BITS) */
puts ("hppa2.0"); break;
#endif
default: puts ("hppa1.0"); break;
}
exit (0);
}
EOF
(CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
if [ ${HP_ARCH} = "hppa2.0w" ]
then
eval $set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
# generating 64-bit code. GNU and HP use different nomenclature:
#
# $ CC_FOR_BUILD=cc ./config.guess
# => hppa2.0w-hp-hpux11.23
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
HP_ARCH="hppa2.0w"
else
HP_ARCH="hppa64"
fi
fi
echo ${HP_ARCH}-hp-hpux${HPUX_REV}
exit ;;
ia64:HP-UX:*:*)
HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
echo ia64-hp-hpux${HPUX_REV}
exit ;;
3050*:HI-UX:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#include
int
main ()
{
long cpu = sysconf (_SC_CPU_VERSION);
/* The order matters, because CPU_IS_HP_MC68K erroneously returns
true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
results, however. */
if (CPU_IS_PA_RISC (cpu))
{
switch (cpu)
{
case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
default: puts ("hppa-hitachi-hiuxwe2"); break;
}
}
else if (CPU_IS_HP_MC68K (cpu))
puts ("m68k-hitachi-hiuxwe2");
else puts ("unknown-hitachi-hiuxwe2");
exit (0);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
echo unknown-hitachi-hiuxwe2
exit ;;
9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
echo hppa1.1-hp-bsd
exit ;;
9000/8??:4.3bsd:*:*)
echo hppa1.0-hp-bsd
exit ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
echo hppa1.0-hp-mpeix
exit ;;
hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
echo hppa1.1-hp-osf
exit ;;
hp8??:OSF1:*:*)
echo hppa1.0-hp-osf
exit ;;
i*86:OSF1:*:*)
if [ -x /usr/sbin/sysversion ] ; then
echo ${UNAME_MACHINE}-unknown-osf1mk
else
echo ${UNAME_MACHINE}-unknown-osf1
fi
exit ;;
parisc*:Lites*:*:*)
echo hppa1.1-hp-lites
exit ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
echo c1-convex-bsd
exit ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
echo c34-convex-bsd
exit ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
echo c38-convex-bsd
exit ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
echo c4-convex-bsd
exit ;;
CRAY*Y-MP:*:*:*)
echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*[A-Z]90:*:*:*)
echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*T3E:*:*:*)
echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
CRAY*SV1:*:*:*)
echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
*:UNICOS/mp:*:*)
echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
exit ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
5000:UNIX_System_V:4.*:*)
FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
exit ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
exit ;;
sparc*:BSD/OS:*:*)
echo sparc-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:BSD/OS:*:*)
echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
exit ;;
*:FreeBSD:*:*)
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
*)
echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
esac
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
exit ;;
*:MINGW64*:*)
echo ${UNAME_MACHINE}-pc-mingw64
exit ;;
*:MINGW*:*)
echo ${UNAME_MACHINE}-pc-mingw32
exit ;;
i*:MSYS*:*)
echo ${UNAME_MACHINE}-pc-msys
exit ;;
i*:windows32*:*)
# uname -m includes "-pc" on this system.
echo ${UNAME_MACHINE}-mingw32
exit ;;
i*:PW*:*)
echo ${UNAME_MACHINE}-pc-pw32
exit ;;
*:Interix*:*)
case ${UNAME_MACHINE} in
x86)
echo i586-pc-interix${UNAME_RELEASE}
exit ;;
authenticamd | genuineintel | EM64T)
echo x86_64-unknown-interix${UNAME_RELEASE}
exit ;;
IA64)
echo ia64-unknown-interix${UNAME_RELEASE}
exit ;;
esac ;;
[345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
echo i${UNAME_MACHINE}-pc-mks
exit ;;
8664:Windows_NT:*)
echo x86_64-pc-mks
exit ;;
i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
# How do we know it's Interix rather than the generic POSIX subsystem?
# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
# UNAME_MACHINE based on the output of uname instead of i386?
echo i586-pc-interix
exit ;;
i*:UWIN*:*)
echo ${UNAME_MACHINE}-pc-uwin
exit ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
echo x86_64-unknown-cygwin
exit ;;
p*:CYGWIN*:*)
echo powerpcle-unknown-cygwin
exit ;;
prep*:SunOS:5.*:*)
echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
exit ;;
*:GNU:*:*)
# the GNU system
echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
exit ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
exit ;;
i*86:Minix:*:*)
echo ${UNAME_MACHINE}-pc-minix
exit ;;
aarch64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
alpha:Linux:*:*)
case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
PCA57) UNAME_MACHINE=alphapca56 ;;
EV6) UNAME_MACHINE=alphaev6 ;;
EV67) UNAME_MACHINE=alphaev67 ;;
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
exit ;;
arm*:Linux:*:*)
eval $set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
echo ${UNAME_MACHINE}-unknown-linux-gnu
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
echo ${UNAME_MACHINE}-unknown-linux-gnueabi
else
echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
fi
fi
exit ;;
avr32*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
cris:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
crisv32:Linux:*:*)
echo ${UNAME_MACHINE}-axis-linux-gnu
exit ;;
frv:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
hexagon:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:Linux:*:*)
LIBC=gnu
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#ifdef __dietlibc__
LIBC=dietlibc
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
exit ;;
ia64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m32r*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
m68*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
mips:Linux:*:* | mips64:Linux:*:*)
eval $set_cc_for_build
sed 's/^ //' << EOF >$dummy.c
#undef CPU
#undef ${UNAME_MACHINE}
#undef ${UNAME_MACHINE}el
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
CPU=${UNAME_MACHINE}el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
CPU=${UNAME_MACHINE}
#else
CPU=
#endif
#endif
EOF
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
;;
or32:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
padre:Linux:*:*)
echo sparc-unknown-linux-gnu
exit ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
echo hppa64-unknown-linux-gnu
exit ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
PA7*) echo hppa1.1-unknown-linux-gnu ;;
PA8*) echo hppa2.0-unknown-linux-gnu ;;
*) echo hppa-unknown-linux-gnu ;;
esac
exit ;;
ppc64:Linux:*:*)
echo powerpc64-unknown-linux-gnu
exit ;;
ppc:Linux:*:*)
echo powerpc-unknown-linux-gnu
exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux
exit ;;
sh64*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sh*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
tile*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
vax:Linux:*:*)
echo ${UNAME_MACHINE}-dec-linux-gnu
exit ;;
x86_64:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
xtensa*:Linux:*:*)
echo ${UNAME_MACHINE}-unknown-linux-gnu
exit ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
echo i386-sequent-sysv4
exit ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
exit ;;
i*86:OS/2:*:*)
# If we were able to find `uname', then EMX Unix compatibility
# is probably installed.
echo ${UNAME_MACHINE}-pc-os2-emx
exit ;;
i*86:XTS-300:*:STOP)
echo ${UNAME_MACHINE}-unknown-stop
exit ;;
i*86:atheos:*:*)
echo ${UNAME_MACHINE}-unknown-atheos
exit ;;
i*86:syllable:*:*)
echo ${UNAME_MACHINE}-pc-syllable
exit ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
echo i386-unknown-lynxos${UNAME_RELEASE}
exit ;;
i*86:*DOS:*:*)
echo ${UNAME_MACHINE}-pc-msdosdjgpp
exit ;;
i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
else
echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
fi
exit ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
*486*) UNAME_MACHINE=i486 ;;
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
exit ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
&& UNAME_MACHINE=i586
(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
else
echo ${UNAME_MACHINE}-pc-sysv32
fi
exit ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
# prints for the "djgpp" host, or else GDB configury will decide that
# this is a cross-build.
echo i586-pc-msdosdjgpp
exit ;;
Intel:Mach:3*:*)
echo i386-pc-mach3
exit ;;
paragon:*:*:*)
echo i860-intel-osf1
exit ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
fi
exit ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
echo m68010-convergent-sysv
exit ;;
mc68k:UNIX:SYSTEM5:3.51m)
echo m68k-convergent-sysv
exit ;;
M680?0:D-NIX:5.3:*)
echo m68k-diab-dnix
exit ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
OS_REL=''
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
NCR*:*:4.2:* | MPRAS*:*:4.2:*)
OS_REL='.3'
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
&& { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
echo m68k-unknown-lynxos${UNAME_RELEASE}
exit ;;
mc68030:UNIX_System_V:4.*:*)
echo m68k-atari-sysv4
exit ;;
TSUNAMI:LynxOS:2.*:*)
echo sparc-unknown-lynxos${UNAME_RELEASE}
exit ;;
rs6000:LynxOS:2.*:*)
echo rs6000-unknown-lynxos${UNAME_RELEASE}
exit ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
echo powerpc-unknown-lynxos${UNAME_RELEASE}
exit ;;
SM[BE]S:UNIX_SV:*:*)
echo mips-dde-sysv${UNAME_RELEASE}
exit ;;
RM*:ReliantUNIX-*:*:*)
echo mips-sni-sysv4
exit ;;
RM*:SINIX-*:*:*)
echo mips-sni-sysv4
exit ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
echo ${UNAME_MACHINE}-sni-sysv4
else
echo ns32k-sni-sysv
fi
exit ;;
PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
# says
echo i586-unisys-sysv4
exit ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
echo hppa1.1-stratus-sysv4
exit ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
echo i860-stratus-sysv4
exit ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
echo ${UNAME_MACHINE}-stratus-vos
exit ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
echo hppa1.1-stratus-vos
exit ;;
mc68*:A/UX:*:*)
echo m68k-apple-aux${UNAME_RELEASE}
exit ;;
news*:NEWS-OS:6*:*)
echo mips-sony-newsos6
exit ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
if [ -d /usr/nec ]; then
echo mips-nec-sysv${UNAME_RELEASE}
else
echo mips-unknown-sysv${UNAME_RELEASE}
fi
exit ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
echo powerpc-be-beos
exit ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
echo powerpc-apple-beos
exit ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
echo i586-pc-beos
exit ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
echo i586-pc-haiku
exit ;;
x86_64:Haiku:*:*)
echo x86_64-unknown-haiku
exit ;;
SX-4:SUPER-UX:*:*)
echo sx4-nec-superux${UNAME_RELEASE}
exit ;;
SX-5:SUPER-UX:*:*)
echo sx5-nec-superux${UNAME_RELEASE}
exit ;;
SX-6:SUPER-UX:*:*)
echo sx6-nec-superux${UNAME_RELEASE}
exit ;;
SX-7:SUPER-UX:*:*)
echo sx7-nec-superux${UNAME_RELEASE}
exit ;;
SX-8:SUPER-UX:*:*)
echo sx8-nec-superux${UNAME_RELEASE}
exit ;;
SX-8R:SUPER-UX:*:*)
echo sx8r-nec-superux${UNAME_RELEASE}
exit ;;
Power*:Rhapsody:*:*)
echo powerpc-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Rhapsody:*:*)
echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
exit ;;
*:Darwin:*:*)
UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
case $UNAME_PROCESSOR in
i386)
eval $set_cc_for_build
if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
UNAME_PROCESSOR="x86_64"
fi
fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
exit ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
if test "$UNAME_PROCESSOR" = "x86"; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
exit ;;
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
NEO-?:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
NSR-?:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
BS2000:POSIX*:*:*)
echo bs2000-siemens-sysv
exit ;;
DS/*:UNIX_System_V:*:*)
echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
exit ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
if test "$cputype" = "386"; then
UNAME_MACHINE=i386
else
UNAME_MACHINE="$cputype"
fi
echo ${UNAME_MACHINE}-unknown-plan9
exit ;;
*:TOPS-10:*:*)
echo pdp10-unknown-tops10
exit ;;
*:TENEX:*:*)
echo pdp10-unknown-tenex
exit ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
echo pdp10-dec-tops20
exit ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
echo pdp10-xkl-tops20
exit ;;
*:TOPS-20:*:*)
echo pdp10-unknown-tops20
exit ;;
*:ITS:*:*)
echo pdp10-unknown-its
exit ;;
SEI:*:*:SEIUX)
echo mips-sei-seiux${UNAME_RELEASE}
exit ;;
*:DragonFly:*:*)
echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
case "${UNAME_MACHINE}" in
A*) echo alpha-dec-vms ; exit ;;
I*) echo ia64-dec-vms ; exit ;;
V*) echo vax-dec-vms ; exit ;;
esac ;;
*:XENIX:*:SysV)
echo i386-pc-xenix
exit ;;
i*86:skyos:*:*)
echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
exit ;;
i*86:rdos:*:*)
echo ${UNAME_MACHINE}-pc-rdos
exit ;;
i*86:AROS:*:*)
echo ${UNAME_MACHINE}-pc-aros
exit ;;
x86_64:VMkernel:*:*)
echo ${UNAME_MACHINE}-unknown-esx
exit ;;
esac
eval $set_cc_for_build
cat >$dummy.c <
# include
#endif
main ()
{
#if defined (sony)
#if defined (MIPSEB)
/* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
I don't know.... */
printf ("mips-sony-bsd\n"); exit (0);
#else
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
"4"
#else
""
#endif
); exit (0);
#endif
#endif
#if defined (__arm) && defined (__acorn) && defined (__unix)
printf ("arm-acorn-riscix\n"); exit (0);
#endif
#if defined (hp300) && !defined (hpux)
printf ("m68k-hp-bsd\n"); exit (0);
#endif
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
#endif
int version;
version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
if (version < 4)
printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
else
printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
exit (0);
#endif
#if defined (MULTIMAX) || defined (n16)
#if defined (UMAXV)
printf ("ns32k-encore-sysv\n"); exit (0);
#else
#if defined (CMU)
printf ("ns32k-encore-mach\n"); exit (0);
#else
printf ("ns32k-encore-bsd\n"); exit (0);
#endif
#endif
#endif
#if defined (__386BSD__)
printf ("i386-pc-bsd\n"); exit (0);
#endif
#if defined (sequent)
#if defined (i386)
printf ("i386-sequent-dynix\n"); exit (0);
#endif
#if defined (ns32000)
printf ("ns32k-sequent-dynix\n"); exit (0);
#endif
#endif
#if defined (_SEQUENT_)
struct utsname un;
uname(&un);
if (strncmp(un.version, "V2", 2) == 0) {
printf ("i386-sequent-ptx2\n"); exit (0);
}
if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
printf ("i386-sequent-ptx1\n"); exit (0);
}
printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
# if !defined (ultrix)
# include
# if defined (BSD)
# if BSD == 43
printf ("vax-dec-bsd4.3\n"); exit (0);
# else
# if BSD == 199006
printf ("vax-dec-bsd4.3reno\n"); exit (0);
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# endif
# else
printf ("vax-dec-bsd\n"); exit (0);
# endif
# else
printf ("vax-dec-ultrix\n"); exit (0);
# endif
#endif
#if defined (alliant) && defined (i860)
printf ("i860-alliant-bsd\n"); exit (0);
#endif
exit (1);
}
EOF
$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
# Convex versions that predate uname can use getsysinfo(1)
if [ -x /usr/convex/getsysinfo ]
then
case `getsysinfo -f cpu_type` in
c1*)
echo c1-convex-bsd
exit ;;
c2*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
else echo c2-convex-bsd
fi
exit ;;
c34*)
echo c34-convex-bsd
exit ;;
c38*)
echo c38-convex-bsd
exit ;;
c4*)
echo c4-convex-bsd
exit ;;
esac
fi
cat >&2 < in order to provide the needed
information to handle your system.
config.guess timestamp = $timestamp
uname -m = `(uname -m) 2>/dev/null || echo unknown`
uname -r = `(uname -r) 2>/dev/null || echo unknown`
uname -s = `(uname -s) 2>/dev/null || echo unknown`
uname -v = `(uname -v) 2>/dev/null || echo unknown`
/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
/bin/uname -X = `(/bin/uname -X) 2>/dev/null`
hostinfo = `(hostinfo) 2>/dev/null`
/bin/universe = `(/bin/universe) 2>/dev/null`
/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null`
/bin/arch = `(/bin/arch) 2>/dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
UNAME_MACHINE = ${UNAME_MACHINE}
UNAME_RELEASE = ${UNAME_RELEASE}
UNAME_SYSTEM = ${UNAME_SYSTEM}
UNAME_VERSION = ${UNAME_VERSION}
EOF
exit 1
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End:
xterm-297/version.c 0000644 0001751 0000144 00000004723 12070551104 013105 0 ustar tom users /* $XTermId: version.c,v 1.1 2013/01/01 12:10:44 tom Exp $ */
/*
* Copyright 2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
#include
#include
#include
/*
* Returns the version-string used in the "-v' message as well as a few other
* places. It is derived (when possible) from the __vendorversion__ symbol
* that some newer imake configurations define.
*/
char *
xtermVersion(void)
{
static char vendor_version[] = __vendorversion__;
static char *result;
if (result == 0) {
char *vendor = vendor_version;
char first[BUFSIZ];
char second[BUFSIZ];
result = CastMallocN(char, strlen(vendor) + 9);
if (result == 0)
result = vendor;
else {
/* some vendors leave trash in this string */
for (;;) {
if (!strncmp(vendor, "Version ", (size_t) 8))
vendor += 8;
else if (isspace(CharOf(*vendor)))
++vendor;
else
break;
}
if (strlen(vendor) < BUFSIZ &&
sscanf(vendor, "%[0-9.] %[A-Za-z_0-9.]", first, second) == 2)
sprintf(result, "%s %s(%d)", second, first, XTERM_PATCH);
else
sprintf(result, "%s(%d)", vendor, XTERM_PATCH);
}
}
return result;
}
xterm-297/terminfo 0000644 0001751 0000144 00000124514 12021515650 013025 0 ustar tom users # $XTermId: terminfo,v 1.161 2012/09/05 00:24:08 tom Exp $
#
# Updates/notes/new entries (e.g., xterm-8bit, xterm-16color, xterm-256color)
# - Thomas E. Dickey
#
#------------------------------------------------------------------------------
# Copyright 1996-2011,2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
#------------------------------------------------------------------------------
#
# Special Capabilities:
# --------------------
# ich has a corresponding capability that inserts a single blank. We could
# have used ich1=\E[@, which works with ncurses, but that is not standard
# behavior. If it is set, then SVr4 vi (e.g., Solaris 2.6) emits both
# smir/rmir and ich1.
# meml locks memory above the cursor; memu unlocks (ala HP terminals). This
# is not recognized by some older (e.g., SVr3) tic programs, but none
# do more than warn about it. Ignore the warning.
# smcup clears memory before switching to the alternate screen. The older
# (deprecated) \E[?47h did not do this, requiring applications to
# embed a \E[2J in the rmcup string. However, that behavior cannot
# be disabled via titeInhibit, making that resource not function as
# intended on systems with terminfo.
# rs2/is2 are shorter with XFree86 xterm because it supports DECSTR. We
# use the shorter sequence for compatibility with the termcap, which
# is trimmed to keep it shorter than 1023 characters. It (escape \E[!p)
# replaces these in the conventional vt100 reset-string:
# \E7 - save cursor (fixes origin-mode side-effect)
# \E[r - reset scrolling margins
# \E[m - reset SGR (including color)
# \E[?7h - reset wraparound mode (DECAWM)
# \E[?1l - reset application cursor keys (DECCKM)
# \E[?6l - reset origin mode (DECOM)
# \E8 - restore cursor
# DECSTR is recognized by XFree86 xterm even in vt52 mode.
#
# Editing Keypad:
# --------------
# XFree86 xterm emulates vt220 if the decTerminalID resource is set to 200 or
# higher. Otherwise it emulates a vt100 or vt52 depending on the value of the
# resource. When emulating a vt220, we support the editing keypad. Sun and PC
# keyboards have an editing keypad which is similar to the vt220:
#
# VT220 editing keypad
# ----------------------------
# Find Insert Remove
# Select Prev Next
# ----------------------------
#
# Sun/PC editing keypad
# ----------------------------
# Insert Home PageUp
# Delete End PageDn
# ----------------------------
#
# If the sunKeyboard resource is true, we map it this way (adjusting the values
# of Home, End and Delete):
# VT220 Sun/PC
# ----------------------------
# Find Home
# Select End
# Insert Insert
# Remove Delete
# Prev PageUp
# Next PageDn
# ----------------------------
#
# Note that all of the keys on the editing keypad transmit escape sequences. A
# vt220 does this only when in vt220 mode; when emulating a vt100 the editing
# keypad is inactive.
#
# Alternative keycodes:
# --------------------
# Several of the function keys have alternative names, depending on the type of
# host which your xterm is connected to. DEC (i.e., the VMS system) uses F15
# as the HELP key, F16 as the DO key. Unix applications generally do not do
# this. Curses applications in particular, assign a unique keycode to each
# capability string. These terminal descriptions do not have conflicting
# definitions, to ensure that Unix curses applications use a consistent set of
# keycodes. To get a VMS-bias, make these substitutions:
# 1. change khome to kfnd
# 2. change kend to kslt
# The original xterm-r6 entry does in fact have a VMS bias.
#
# Some legacy applications using the termcap emulation may expect kll where
# we have specified kend.
#
# Function keys with modifiers (Sun/PC):
# -------------------------------------
# Shift-Fx - kf{12+x}
# Control-Fx - kf{24+x}
# Shift-Control-Fx - kf{36+x}
#
# The terminfo defines some special keys which are documented as "shifted",
# e.g., kDC is shifted-delete-character.
#
# Note however, that even though the terminfo says a key might be sent, there
# may be conflicts which prevent this. For example, it is common to use
# shifted pageup and pagedown for window manager functions. The default
# translation for xterm since X11R4 has overridden shifted Insert, Select,
# PageUp and PageDown, which correspond to terminfo kIC, kEND, kPRV and kNXT
# respectively.
#
xterm-new|modern xterm terminal emulator,
npc,
indn=\E[%p1%dS,
kb2=\EOE,
kcbt=\E[Z,
kent=\EOM,
rin=\E[%p1%dT,
use=xterm+pcfkeys,
use=xterm+tmux,
use=xterm-basic,
#
# Encode modifiers using parameters (see "Xterm Control Sequences" ctlseqs.ms).
# Note that this is unrelated to PCTERM.
#
# Some names are extensions allowed by ncurses, e.g.,
# kDN, kDN5, kDN6, kLFT5, kLFT6, kRIT5, kRIT6, kUP, kUP5, kUP6
#
# The uppercase names are made up, since there are no standards that apply.
# If they were limited to two characters, they could in principle be translated
# to termcap. However, termcap sizes are limited to 1023 bytes, so there is
# little point in ensuring that extended key names can be translated to
# termcap. A terminfo file can be up to 4096 bytes; using all extended keys
# that xterm can generate would in fact exceed that limit.
#
# The numbers correspond to the modifier parameters documented in Xterm
# Control Sequences:
#
# 2 Shift
# 3 Alt
# 4 Shift + Alt
# 5 Control
# 6 Shift + Control
# 7 Alt + Control
# 8 Shift + Alt + Control
#
# X/Open Curses defines some shift combinations, which are also used here
# where applicable. Since it does define some shift combinations, no number
# (2) is used for suffixing the made-up names. Some combinations are not
# useful, e.g., they may reboot your computer, or they may require too many
# fingers. I stopped at modifier 7, just to keep things simple -TD
#
# XTerm resources:
# ---------------
# The xterm+pcfn, xterm+pcf0, xterm+pcf1, xterm+pcf2 and xterm+pcf3 fragments
# correspond to default resource settings for xterm on a 104-key PC keyboard
# with 12 function-keys:
#
# *sunKeyboard:false
# *oldXtermFKeys:false
# *modifyCursorKeys:2
# *modifyFunctionKeys:2
# *ctrlFKeys:10
#
# The key numbers are computed based on the modifiers:
#
# kf1-kf12 are F1-F12
# kf13-kf24 are shift F1-F12
# kf25-kf36 are control F1-F12
# kf37-kf48 are control+shift F1-F12
# kf49-kf60 are alt F1-F12
# kf61-kf63 are shift-alt F1-F3
#
# Note that ncurses would allow definition of kf64 and beyond, if there were
# an application that required it.
#
xterm+pcfkeys|fragment for PC-style keys,
use=xterm+app,
use=xterm+pcf2,
use=xterm+pce2,
use=xterm+pcc2,
# This chunk is based on suggestions by Ailin Nemui and Nicholas Marriott, who
# asked for some of xterm's advanced features to be added to its terminfo
# entry. It defines extended capabilities not found in standard terminfo or
# termcap. These are useful in tmux, for instance, hence the name.
#
# One caveat in adding extended capabilities in ncurses is that if the names
# are longer than two characters, then they will not be visible through the
# termcap interface.
#
# Ms modifies the selection/clipboard. Its parameters are
# p1 = the storage unit (clipboard, selection or cut buffer)
# p2 = the base64-encoded clipboard content.
#
# Ss is used to set the cursor style as described by the DECSCUSR
# function to a block or underline.
# Se resets the cursor style to the terminal power-on default.
#
# Cs and Ce set and reset the cursor colour.
xterm+tmux|advanced xterm features used in tmux,
Cr=\E]112\007,
Cs=\E]12;%p1%s\007,
Ms=\E]52;%p1%s;%p2%s\007,
Se=\E[2 q,
Ss=\E[%p1%d q,
#
# The ctrlFKeys resource is only relevant to the xterm+pcfn and xterm+pcfN
# entries, since the modifyFunctionKeys resource overrides ctrlFKeys when it is
# positive. A different choice of ctrlFKeys would give a different set of
# function-key strings.
xterm+pcfn|fragment with modifyFunctionKeys:-1 and ctrlFKeys:10,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[25~,
kf14=\E[26~,
kf15=\E[28~,
kf16=\E[29~,
kf17=\E[31~,
kf18=\E[32~,
kf19=\E[33~,
kf2=\EOQ,
kf20=\E[34~,
kf21=\E[42~,
kf22=\E[43~,
kf23=\E[44~,
kf24=\E[45~,
kf25=\E[46~,
kf26=\E[47~,
kf27=\E[48~,
kf28=\E[49~,
kf29=\E[50~,
kf3=\EOR,
kf30=\E[51~,
kf31=\E[52~,
kf32=\E[53~,
kf33=\E[54~,
kf34=\E[55~,
kf35=\E[56~,
kf36=\E[57~,
kf37=\E[58~,
kf38=\E[59~,
kf39=\E[60~,
kf4=\EOS,
kf40=\E[61~,
kf41=\E[62~,
kf42=\E[63~,
kf43=\E[64~,
kf44=\E[65~,
kf45=\E[66~,
kf46=\E[67~,
kf47=\E[68~,
kf48=\E[69~,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
# Changing ctrlFKeys to 12 would let us number the keys using just shift- and
# control- modifiers:
# kf1-kf12 are F1-F12
# kf13-kf24 are shift F1-F12
# kf25-kf36 are control F1-F12
# kf37-kf48 are control+shift F1-F12
xterm+pcfN|fragment with modifyFunctionKeys:-1 and ctrlFKeys:12,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[25~,
kf14=\E[26~,
kf15=\E[28~,
kf16=\E[29~,
kf17=\E[31~,
kf18=\E[32~,
kf19=\E[33~,
kf2=\EOQ,
kf20=\E[34~,
kf21=\E[42~,
kf22=\E[43~,
kf23=\E[44~,
kf24=\E[45~,
kf25=\E[46~,
kf26=\E[47~,
kf27=\E[48~,
kf28=\E[49~,
kf29=\E[50~,
kf3=\EOR,
kf30=\E[51~,
kf31=\E[52~,
kf32=\E[53~,
kf33=\E[54~,
kf34=\E[55~,
kf35=\E[56~,
kf36=\E[57~,
kf37=\E[58~,
kf38=\E[59~,
kf39=\E[60~,
kf4=\EOS,
kf40=\E[61~,
kf41=\E[62~,
kf42=\E[63~,
kf43=\E[64~,
kf44=\E[65~,
kf45=\E[66~,
kf46=\E[67~,
kf47=\E[68~,
kf48=\E[69~,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
xterm+pcf0|fragment with modifyFunctionKeys:0,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\EO2P,
kf14=\EO2Q,
kf15=\EO2R,
kf16=\EO2S,
kf17=\E[15;2~,
kf18=\E[17;2~,
kf19=\E[18;2~,
kf2=\EOQ,
kf20=\E[19;2~,
kf21=\E[20;2~,
kf22=\E[21;2~,
kf23=\E[23;2~,
kf24=\E[24;2~,
kf25=\EO5P,
kf26=\EO5Q,
kf27=\EO5R,
kf28=\EO5S,
kf29=\E[15;5~,
kf3=\EOR,
kf30=\E[17;5~,
kf31=\E[18;5~,
kf32=\E[19;5~,
kf33=\E[20;5~,
kf34=\E[21;5~,
kf35=\E[23;5~,
kf36=\E[24;5~,
kf37=\EO6P,
kf38=\EO6Q,
kf39=\EO6R,
kf4=\EOS,
kf40=\EO6S,
kf41=\E[15;6~,
kf42=\E[17;6~,
kf43=\E[18;6~,
kf44=\E[19;6~,
kf45=\E[20;6~,
kf46=\E[21;6~,
kf47=\E[23;6~,
kf48=\E[24;6~,
kf49=\EO3P,
kf5=\E[15~,
kf50=\EO3Q,
kf51=\EO3R,
kf52=\EO3S,
kf53=\E[15;3~,
kf54=\E[17;3~,
kf55=\E[18;3~,
kf56=\E[19;3~,
kf57=\E[20;3~,
kf58=\E[21;3~,
kf59=\E[23;3~,
kf6=\E[17~,
kf60=\E[24;3~,
kf61=\EO4P,
kf62=\EO4Q,
kf63=\EO4R,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
# This is almost the same as xterm+pcf2 because the unmodified keys all happen
# to have a pattern that forces the modifier to the same position.
xterm+pcf1|fragment with modifyFunctionKeys:1,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[2P,
kf14=\E[2Q,
kf15=\E[2R,
kf16=\E[2S,
kf17=\E[15;2~,
kf18=\E[17;2~,
kf19=\E[18;2~,
kf2=\EOQ,
kf20=\E[19;2~,
kf21=\E[20;2~,
kf22=\E[21;2~,
kf23=\E[23;2~,
kf24=\E[24;2~,
kf25=\E[5P,
kf26=\E[5Q,
kf27=\E[5R,
kf28=\E[5S,
kf29=\E[15;5~,
kf3=\EOR,
kf30=\E[17;5~,
kf31=\E[18;5~,
kf32=\E[19;5~,
kf33=\E[20;5~,
kf34=\E[21;5~,
kf35=\E[23;5~,
kf36=\E[24;5~,
kf37=\E[6P,
kf38=\E[6Q,
kf39=\E[6R,
kf4=\EOS,
kf40=\E[6S,
kf41=\E[15;6~,
kf42=\E[17;6~,
kf43=\E[18;6~,
kf44=\E[19;6~,
kf45=\E[20;6~,
kf46=\E[21;6~,
kf47=\E[23;6~,
kf48=\E[24;6~,
kf49=\E[3P,
kf5=\E[15~,
kf50=\E[3Q,
kf51=\E[3R,
kf52=\E[3S,
kf53=\E[15;3~,
kf54=\E[17;3~,
kf55=\E[18;3~,
kf56=\E[19;3~,
kf57=\E[20;3~,
kf58=\E[21;3~,
kf59=\E[23;3~,
kf6=\E[17~,
kf60=\E[24;3~,
kf61=\E[4P,
kf62=\E[4Q,
kf63=\E[4R,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
xterm+pcf2|fragment with modifyFunctionKeys:2,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[1;2P,
kf14=\E[1;2Q,
kf15=\E[1;2R,
kf16=\E[1;2S,
kf17=\E[15;2~,
kf18=\E[17;2~,
kf19=\E[18;2~,
kf2=\EOQ,
kf20=\E[19;2~,
kf21=\E[20;2~,
kf22=\E[21;2~,
kf23=\E[23;2~,
kf24=\E[24;2~,
kf25=\E[1;5P,
kf26=\E[1;5Q,
kf27=\E[1;5R,
kf28=\E[1;5S,
kf29=\E[15;5~,
kf3=\EOR,
kf30=\E[17;5~,
kf31=\E[18;5~,
kf32=\E[19;5~,
kf33=\E[20;5~,
kf34=\E[21;5~,
kf35=\E[23;5~,
kf36=\E[24;5~,
kf37=\E[1;6P,
kf38=\E[1;6Q,
kf39=\E[1;6R,
kf4=\EOS,
kf40=\E[1;6S,
kf41=\E[15;6~,
kf42=\E[17;6~,
kf43=\E[18;6~,
kf44=\E[19;6~,
kf45=\E[20;6~,
kf46=\E[21;6~,
kf47=\E[23;6~,
kf48=\E[24;6~,
kf49=\E[1;3P,
kf5=\E[15~,
kf50=\E[1;3Q,
kf51=\E[1;3R,
kf52=\E[1;3S,
kf53=\E[15;3~,
kf54=\E[17;3~,
kf55=\E[18;3~,
kf56=\E[19;3~,
kf57=\E[20;3~,
kf58=\E[21;3~,
kf59=\E[23;3~,
kf6=\E[17~,
kf60=\E[24;3~,
kf61=\E[1;4P,
kf62=\E[1;4Q,
kf63=\E[1;4R,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
xterm+pcf3|fragment with modifyFunctionKeys:3,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[>1;2P,
kf14=\E[>1;2Q,
kf15=\E[>1;2R,
kf16=\E[>1;2S,
kf17=\E[>15;2~,
kf18=\E[>17;2~,
kf19=\E[>18;2~,
kf2=\EOQ,
kf20=\E[>19;2~,
kf21=\E[>20;2~,
kf22=\E[>21;2~,
kf23=\E[>23;2~,
kf24=\E[>24;2~,
kf25=\E[>1;5P,
kf26=\E[>1;5Q,
kf27=\E[>1;5R,
kf28=\E[>1;5S,
kf29=\E[>15;5~,
kf3=\EOR,
kf30=\E[>17;5~,
kf31=\E[>18;5~,
kf32=\E[>19;5~,
kf33=\E[>20;5~,
kf34=\E[>21;5~,
kf35=\E[>23;5~,
kf36=\E[>24;5~,
kf37=\E[>1;6P,
kf38=\E[>1;6Q,
kf39=\E[>1;6R,
kf4=\EOS,
kf40=\E[>1;6S,
kf41=\E[>15;6~,
kf42=\E[>17;6~,
kf43=\E[>18;6~,
kf44=\E[>19;6~,
kf45=\E[>20;6~,
kf46=\E[>21;6~,
kf47=\E[>23;6~,
kf48=\E[>24;6~,
kf49=\E[>1;3P,
kf5=\E[15~,
kf50=\E[>1;3Q,
kf51=\E[>1;3R,
kf52=\E[>1;3S,
kf53=\E[>15;3~,
kf54=\E[>17;3~,
kf55=\E[>18;3~,
kf56=\E[>19;3~,
kf57=\E[>20;3~,
kf58=\E[>21;3~,
kf59=\E[>23;3~,
kf6=\E[17~,
kf60=\E[>24;3~,
kf61=\E[>1;4P,
kf62=\E[>1;4Q,
kf63=\E[>1;4R,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
#
# The "PC-style" modifier scheme was introduced in xterm patch #94 (1999/3/27)
# and revised in patch #167 (2002/8/24).
#
# The original assignments from patch #94 for cursor-keys had some technical
# issues:
#
# A parameter for a function-key to represent a modifier is just more
# bits. But for a cursor-key it may change the behavior of the
# application. For instance, emacs decodes the first parameter of a
# cursor-key as a repeat count.
#
# A parameterized string should (really) not begin with SS3 (\EO).
# Rather, CSI (\E[) should be used.
#
# For these reasons, the original assignments were deprecated. For
# compatibility reasons, they are still available as a setting of xterm's
# modifyCursorKeys resource. These fragments list the modified cursor-keys
# that might apply to xterm+pcfkeys with different values of that resource.
xterm+pcc3|fragment with modifyCursorKeys:3,
kLFT=\E[>1;2D,
kRIT=\E[>1;2C,
kind=\E[>1;2B,
kri=\E[>1;2A,
kDN=\E[>1;2B,
kDN3=\E[>1;3B,
kDN4=\E[>1;4B,
kDN5=\E[>1;5B,
kDN6=\E[>1;6B,
kDN7=\E[>1;7B,
kLFT3=\E[>1;3D,
kLFT4=\E[>1;4D,
kLFT5=\E[>1;5D,
kLFT6=\E[>1;6D,
kLFT7=\E[>1;7D,
kRIT3=\E[>1;3C,
kRIT4=\E[>1;4C,
kRIT5=\E[>1;5C,
kRIT6=\E[>1;6C,
kRIT7=\E[>1;7C,
kUP=\E[>1;2A,
kUP3=\E[>1;3A,
kUP4=\E[>1;4A,
kUP5=\E[>1;5A,
kUP6=\E[>1;6A,
kUP7=\E[>1;7A,
xterm+pcc2|fragment with modifyCursorKeys:2,
kLFT=\E[1;2D,
kRIT=\E[1;2C,
kind=\E[1;2B,
kri=\E[1;2A,
kDN=\E[1;2B,
kDN3=\E[1;3B,
kDN4=\E[1;4B,
kDN5=\E[1;5B,
kDN6=\E[1;6B,
kDN7=\E[1;7B,
kLFT3=\E[1;3D,
kLFT4=\E[1;4D,
kLFT5=\E[1;5D,
kLFT6=\E[1;6D,
kLFT7=\E[1;7D,
kRIT3=\E[1;3C,
kRIT4=\E[1;4C,
kRIT5=\E[1;5C,
kRIT6=\E[1;6C,
kRIT7=\E[1;7C,
kUP=\E[1;2A,
kUP3=\E[1;3A,
kUP4=\E[1;4A,
kUP5=\E[1;5A,
kUP6=\E[1;6A,
kUP7=\E[1;7A,
xterm+pcc1|fragment with modifyCursorKeys:1,
kLFT=\E[2D,
kRIT=\E[2C,
kind=\E[2B,
kri=\E[2A,
kDN=\E[2B,
kDN3=\E[3B,
kDN4=\E[4B,
kDN5=\E[5B,
kDN6=\E[6B,
kDN7=\E[7B,
kLFT3=\E[3D,
kLFT4=\E[4D,
kLFT5=\E[5D,
kLFT6=\E[6D,
kLFT7=\E[7D,
kRIT3=\E[3C,
kRIT4=\E[4C,
kRIT5=\E[5C,
kRIT6=\E[6C,
kRIT7=\E[7C,
kUP=\E[2A,
kUP3=\E[3A,
kUP4=\E[4A,
kUP5=\E[5A,
kUP6=\E[6A,
kUP7=\E[7A,
xterm+pcc0|fragment with modifyCursorKeys:0,
kLFT=\EO2D,
kRIT=\EO2C,
kind=\EO2B,
kri=\EO2A,
kDN=\EO2B,
kDN3=\EO3B,
kDN4=\EO4B,
kDN5=\EO5B,
kDN6=\EO6B,
kDN7=\EO7B,
kLFT3=\EO3D,
kLFT4=\EO4D,
kLFT5=\EO5D,
kLFT6=\EO6D,
kLFT7=\EO7D,
kRIT3=\EO3C,
kRIT4=\EO4C,
kRIT5=\EO5C,
kRIT6=\EO6C,
kRIT7=\EO7C,
kUP=\EO2A,
kUP3=\EO3A,
kUP4=\EO4A,
kUP5=\EO5A,
kUP6=\EO6A,
kUP7=\EO7A,
# The home/end keys on the editing keypad are also treated as cursor keys.
xterm+pce3|fragment with modifyCursorKeys:3,
kDC=\E[>3;2~,
kEND=\E[>1;2F,
kHOM=\E[>1;2H,
kIC=\E[>2;2~,
kNXT=\E[>6;2~,
kPRV=\E[>5;2~,
kDC3=\E[>3;3~,
kDC4=\E[>3;4~,
kDC5=\E[>3;5~,
kDC6=\E[>3;6~,
kDC7=\E[>3;7~,
kEND3=\E[>1;3F,
kEND4=\E[>1;4F,
kEND5=\E[>1;5F,
kEND6=\E[>1;6F,
kEND7=\E[>1;7F,
kHOM3=\E[>1;3H,
kHOM4=\E[>1;4H,
kHOM5=\E[>1;5H,
kHOM6=\E[>1;6H,
kHOM7=\E[>1;7H,
kIC3=\E[>2;3~,
kIC4=\E[>2;4~,
kIC5=\E[>2;5~,
kIC6=\E[>2;6~,
kIC7=\E[>2;7~,
kNXT3=\E[>6;3~,
kNXT4=\E[>6;4~,
kNXT5=\E[>6;5~,
kNXT6=\E[>6;6~,
kNXT7=\E[>6;7~,
kPRV3=\E[>5;3~,
kPRV4=\E[>5;4~,
kPRV5=\E[>5;5~,
kPRV6=\E[>5;6~,
kPRV7=\E[>5;7~,
use=xterm+pce0,
xterm+pce2|fragment with modifyCursorKeys:2,
kDC=\E[3;2~,
kEND=\E[1;2F,
kHOM=\E[1;2H,
kIC=\E[2;2~,
kNXT=\E[6;2~,
kPRV=\E[5;2~,
kDC3=\E[3;3~,
kDC4=\E[3;4~,
kDC5=\E[3;5~,
kDC6=\E[3;6~,
kDC7=\E[3;7~,
kEND3=\E[1;3F,
kEND4=\E[1;4F,
kEND5=\E[1;5F,
kEND6=\E[1;6F,
kEND7=\E[1;7F,
kHOM3=\E[1;3H,
kHOM4=\E[1;4H,
kHOM5=\E[1;5H,
kHOM6=\E[1;6H,
kHOM7=\E[1;7H,
kIC3=\E[2;3~,
kIC4=\E[2;4~,
kIC5=\E[2;5~,
kIC6=\E[2;6~,
kIC7=\E[2;7~,
kNXT3=\E[6;3~,
kNXT4=\E[6;4~,
kNXT5=\E[6;5~,
kNXT6=\E[6;6~,
kNXT7=\E[6;7~,
kPRV3=\E[5;3~,
kPRV4=\E[5;4~,
kPRV5=\E[5;5~,
kPRV6=\E[5;6~,
kPRV7=\E[5;7~,
use=xterm+pce0,
xterm+pce1|fragment with modifyCursorKeys:1,
kDC=\E[3;2~,
kEND=\E[2F,
kHOM=\E[2H,
kIC=\E[2;2~,
kNXT=\E[6;2~,
kPRV=\E[5;2~,
kDC3=\E[3;3~,
kDC4=\E[3;4~,
kDC5=\E[3;5~,
kDC6=\E[3;6~,
kDC7=\E[3;7~,
kEND3=\E[3F,
kEND4=\E[4F,
kEND5=\E[5F,
kEND6=\E[6F,
kEND7=\E[7F,
kHOM3=\E[3H,
kHOM4=\E[4H,
kHOM5=\E[5H,
kHOM6=\E[6H,
kHOM7=\E[7H,
kIC3=\E[2;3~,
kIC4=\E[2;4~,
kIC5=\E[2;5~,
kIC6=\E[2;6~,
kIC7=\E[2;7~,
kNXT3=\E[6;3~,
kNXT4=\E[6;4~,
kNXT5=\E[6;5~,
kNXT6=\E[6;6~,
kNXT7=\E[6;7~,
kPRV3=\E[5;3~,
kPRV4=\E[5;4~,
kPRV5=\E[5;5~,
kPRV6=\E[5;6~,
kPRV7=\E[5;7~,
use=xterm+pce0,
xterm+pce0|fragment with modifyCursorKeys:0,
kDC=\E[3;2~,
kEND=\EO2F,
kHOM=\EO2H,
kIC=\E[2;2~,
kNXT=\E[6;2~,
kPRV=\E[5;2~,
kDC3=\E[3;3~,
kDC4=\E[3;4~,
kDC5=\E[3;5~,
kDC6=\E[3;6~,
kDC7=\E[3;7~,
kEND3=\EO3F,
kEND4=\EO4F,
kEND5=\EO5F,
kEND6=\EO6F,
kEND7=\EO7F,
kHOM3=\EO3H,
kHOM4=\EO4H,
kHOM5=\EO5H,
kHOM6=\EO6H,
kHOM7=\EO7H,
kIC3=\E[2;3~,
kIC4=\E[2;4~,
kIC5=\E[2;5~,
kIC6=\E[2;6~,
kIC7=\E[2;7~,
kNXT3=\E[6;3~,
kNXT4=\E[6;4~,
kNXT5=\E[6;5~,
kNXT6=\E[6;6~,
kNXT7=\E[6;7~,
kPRV3=\E[5;3~,
kPRV4=\E[5;4~,
kPRV5=\E[5;5~,
kPRV6=\E[5;6~,
kPRV7=\E[5;7~,
use=xterm+edit,
#
# This chunk is used for building the VT220/Sun/PC keyboard variants.
xterm-basic|modern xterm terminal emulator - common,
OTbs,
am,
bce,
km,
mc5i,
mir,
msgr,
xenl,
AX,
XT,
colors#8,
cols#80,
it#8,
lines#24,
pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G,
blink=\E[5m,
bold=\E[1m,
cbt=\E[Z,
civis=\E[?25l,
clear=\E[H\E[2J,
cnorm=\E[?12l\E[?25h,
cr=^M,
csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD,
cub1=^H,
cud=\E[%p1%dB,
cud1=^J,
cuf=\E[%p1%dC,
cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA,
cuu1=\E[A,
cvvis=\E[?12;25h,
dch=\E[%p1%dP,
dch1=\E[P,
dl=\E[%p1%dM,
dl1=\E[M,
ech=\E[%p1%dX,
ed=\E[J,
el=\E[K,
el1=\E[1K,
flash=\E[?5h$<100/>\E[?5l,
home=\E[H,
hpa=\E[%i%p1%dG,
ht=^I,
hts=\EH,
ich=\E[%p1%d@,
il=\E[%p1%dL,
il1=\E[L,
ind=^J,
invis=\E[8m,
is2=\E[!p\E[?3;4l\E[4l\E>,
kmous=\E[M,
mc0=\E[i,
mc4=\E[4i,
mc5=\E[5i,
meml=\El,
memu=\Em,
op=\E[39;49m,
rc=\E8,
rev=\E[7m,
ri=\EM,
rmacs=\E(B,
rmam=\E[?7l,
rmcup=\E[?1049l,
rmir=\E[4l,
rmkx=\E[?1l\E>,
rmm=\E[?1034l,
rmso=\E[27m,
rmul=\E[24m,
rs1=\Ec,
rs2=\E[!p\E[?3;4l\E[4l\E>,
sc=\E7,
setab=\E[4%p1%dm,
setaf=\E[3%p1%dm,
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr=%?%p9%t\E(0%e\E(B%;\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m,
sgr0=\E(B\E[m,
smacs=\E(0,
smam=\E[?7h,
smcup=\E[?1049h,
smir=\E[4h,
smkx=\E[?1h\E=,
smm=\E[?1034h,
smso=\E[7m,
smul=\E[4m,
tbc=\E[3g,
u6=\E[%i%d;%dR,
u7=\E[6n,
u8=\E[?1;2c,
u9=\E[c,
vpa=\E[%i%p1%dd,
E3=\E[3;J,
use=xterm+kbs,
#
# The xterm-new description has all of the features, but is not completely
# compatible with vt220. If you are using a Sun or PC keyboard, set the
# sunKeyboard resource to true:
# + maps the editing keypad
# + interprets control-function-key as a second array of keys, so a
# 12-fkey keyboard can support vt220's 20-fkeys.
# + maps numeric keypad "+" to ",".
# + uses DEC-style control sequences for the application keypad.
#
# Some packagers modify xterm's resource definitions to provide extra function
# keys by using the shift-modifier in the translations resource. However, that
# interferes with the DECUDK functionality.
#
xterm-vt220|xterm emulating vt220,
ka1=\EOw,
ka3=\EOy,
kb2=\EOu,
kc1=\EOq,
kc3=\EOs,
kcbt=\E[Z,
kend=\E[4~,
kent=\EOM,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[25~,
kf14=\E[26~,
kf15=\E[28~,
kf16=\E[29~,
kf17=\E[31~,
kf18=\E[32~,
kf19=\E[33~,
kf2=\EOQ,
kf20=\E[34~,
kf3=\EOR,
kf4=\EOS,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
khome=\E[1~,
kich1=\E[2~,
knp=\E[6~,
kpp=\E[5~,
ka2=\EOx,
kb1=\EOt,
kb3=\EOv,
kc2=\EOr,
use=xterm+app,
use=xterm+edit,
use=xterm-basic,
#
xterm-vt52|xterm emulating dec vt52,
cols#80,
it#8,
lines#24,
acsc=``aaffggjjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G,
clear=\EH\EJ,
cr=^M,
cub1=\ED,
cud1=\EB,
cuf1=\EC,
cup=\EY%p1%' '%+%c%p2%' '%+%c,
cuu1=\EA,
ed=\EJ,
el=\EK,
home=\EH,
ht=^I,
ind=^J,
kcub1=\ED,
kcud1=\EB,
kcuf1=\EC,
kcuu1=\EA,
nel=^M^J,
ri=\EI,
rmacs=\EG,
smacs=\EF,
use=xterm+kbs,
#
# Sun does not number the function keys this way in their sparse termcap; their
# terminal descriptions ignore the keypads. kb(7M) states that there are codes
# reserved for 64 function keys, 16 each in left, right, top and bottom. Each
# keyboard type has a different number of function keys in different
# arrangements. Using xkeycaps for reference:
#
# Type 3: left 10, top 9, right 15
# ------
# kf1-kf9 are XK_F1-XK_F9
# There is no kf10 on this keyboard type.
# kf11-kf20 are keysyms XK_L1 through XK_L10.
# kf31-kf45 are keysyms XK_R1 through XK_R15.
#
# However, X's keysymdef.h is hard-coded to make
# XK_L1==XK_F11 and
# XK_R1==XK_F21,
# by someone who was unfamiliar with terminal types other than Sun's. So
# xterm uses the internal X keysymbols, but the terminfo entry uses the Sun
# numbering scheme.
#
# Type 4: left 11, top 12, right 15
# ------
# The left-keypad contains an unnumbered Help-key.
# The right-keypad also contains NumLock, Ins, Del, Enter, + and - keys which
# do not appear to be part of the R-sequence.
#
# Type 5: left 9, top 12, right (more than one keypad)
# ------
# These keyboards do not use the same naming convention, look like a hybrid of
# the type 4 and IBM keyboards.
#
# XTerm resources:
# ---------------
# Set the modifyFunctionKeys resource to negative (-1) to make it simple to
# enter the higher function-key values using shift- and control-modifiers.
#
xterm-sun|xterm with sun function keys,
kb2=\E[218z,
kcpy=\E[197z,
kcub1=\EOD,
kcud1=\EOB,
kcuf1=\EOC,
kcuu1=\EOA,
kdch1=\E[3z,
kend=\E[220z,
kent=\EOM,
kf1=\E[224z,
kf10=\E[233z,
kf11=\E[192z,
kf12=\E[193z,
kf13=\E[194z,
kf14=\E[195z,
kf15=\E[196z,
kf17=\E[198z,
kf18=\E[199z,
kf19=\E[200z,
kf2=\E[225z,
kf20=\E[201z,
kf3=\E[226z,
kf31=\E[208z,
kf32=\E[209z,
kf33=\E[210z,
kf34=\E[211z,
kf35=\E[212z,
kf36=\E[213z,
kf38=\E[215z,
kf4=\E[227z,
kf40=\E[217z,
kf42=\E[219z,
kf44=\E[221z,
kf45=\E[222z,
kf46=\E[234z,
kf47=\E[235z,
kf5=\E[228z,
kf6=\E[229z,
kf7=\E[230z,
kf8=\E[231z,
kf9=\E[232z,
kfnd=\E[200z,
khlp=\E[196z,
khome=\E[214z,
kich1=\E[2z,
knp=\E[222z,
kpp=\E[216z,
kund=\E[195z,
use=xterm-basic,
#
xterm-hp|xterm with hpterm function keys,
kclr=\EJ,
kcub1=\ED,
kcud1=\EB,
kcuf1=\EC,
kcuu1=\EA,
kdch1=\EP,
kend=\EF,
kf1=\Ep,
kf2=\Eq,
kf3=\Er,
kf4=\Es,
kf5=\Et,
kf6=\Eu,
kf7=\Ev,
kf8=\Ew,
khome=\Eh,
kich1=\EQ,
knp=\ES,
kpp=\ET,
use=xterm-basic,
#
# scoterm implements 48 function-keys using shift- and control-modifiers to
# multiple 12 function-keys. X has a hard-coded limit of 35 function-keys,
# but xterm can represent larger values.
#
# XTerm resources:
# ---------------
# Set the modifyFunctionKeys resource to negative (-1) to make it simple to
# enter the higher function-key values using shift- and control-modifiers.
#
# Also, set ctrlFKeys resource to 12 (the default is 10) to make xterm see 48
# function-keys on a keyboard with 12 function-keys and 4 control/shift
# modifier combinations.
#
xterm-sco|xterm with SCO function keys,
kbeg=\E[E,
kdch1=\177,
kf1=\E[M,
kf10=\E[V,
kf11=\E[W,
kf12=\E[X,
kf13=\E[Y,
kf14=\E[Z,
kf15=\E[a,
kf16=\E[b,
kf17=\E[c,
kf18=\E[d,
kf19=\E[e,
kf2=\E[N,
kf20=\E[f,
kf21=\E[g,
kf22=\E[h,
kf23=\E[i,
kf24=\E[j,
kf25=\E[k,
kf26=\E[l,
kf27=\E[m,
kf28=\E[n,
kf29=\E[o,
kf3=\E[O,
kf30=\E[p,
kf31=\E[q,
kf32=\E[r,
kf33=\E[s,
kf34=\E[t,
kf35=\E[u,
kf36=\E[v,
kf37=\E[w,
kf38=\E[x,
kf39=\E[y,
kf4=\E[P,
kf40=\E[z,
kf41=\E[@,
kf42=\E[[,
kf43=\E[\\,
kf44=\E[],
kf45=\E[\^,
kf46=\E[_,
kf47=\E[`,
kf48=\E[{,
kf5=\E[Q,
kf6=\E[R,
kf7=\E[S,
kf8=\E[T,
kf9=\E[U,
kich1=\E[L,
kmous=\E[>M,
knp=\E[G,
kpp=\E[I,
use=xterm+noapp,
use=xterm-basic,
#
# Other variants (these are all very old entries, from X11R5):
xterm-24|xterms|vs100|xterm terminal emulator (X Window System),
lines#24,
use=xterm-old,
xterm-65|xterm with tall window 65x80 (X Window System),
lines#65,
use=xterm-old,
xterm-bold|xterm with bold instead of underline (X Window System),
sgr=%?%p9%t\016%e\017%;B\E[0%?%p6%t;1%;%?%p2%t;1%;%?%p1%p3%|%t;7%;m,
smso=\E[7m,
smul=\E[1m,
use=xterm-old,
xterm-boldso|xterm with bold for standout (X Window System),
rmso=\E[m,
smso=\E[1m,
use=xterm-old,
xterm-mono|monochrome xterm,
bce@,
colors@,
ncv@,
pairs@,
op@,
setab@,
setaf@,
setb@,
setf@,
sgr@,
use=xterm-old,
#
# VTxxx terminals are usually set up so that full-screen applications will use
# the cursor application mode strings. This is good for full-screen
# applications, including legacy applications which may have hard-coded
# behavior, but bad for interactive shells (e.g., tcsh, bash) which use arrow
# keys to scroll through a history of command strings.
#
# To see the difference between normal/application modes, consider this example:
# + In normal (non-application) mode, the terminal transmits a down-arrow
# as \E[C, which happens to echo as a down-arrow.
# + In application mode the terminal transmits \EOC, which echoes as C.
# That is because the \EO is the SS3 control, which says to use the
# character from the G3 character set for the next cell.
#
# One example of hard-coded behavior would be for applications written to work
# with VT52 and VT100 terminals. If the application's parser ignores 'O' and
# '?' characters after the escape, then the cursor and keypad strings for the
# two terminals are the same. (Indeed, one of the first curses applications
# which I used did something like this to cover "ANSI" terminals -TD).
#
# To make this work (leaving the cursor keys in normal mode), we have to adjust
# the terminal initialization sequences:
#
# smkx/rmkx set/reset the cursor and keypad application modes. We retain
# the latter (otherwise many applications fail).
#
# smcup/rmcup set/restore cursor-addressing mode for full-screen
# applications. For xterm, this normally means the alternate
# screen, which is not compatible with interactive shells. Some
# programs are "smart" and disable these.
#
xterm-noapp|xterm with cursor keys in normal mode,
rmcup@,
rmkx=\E>,
smcup@,
smkx=\E=,
use=xterm+noapp,
use=xterm,
xterm+noapp|fragment with cursor keys in normal mode,
kcub1=\E[D,
kcud1=\E[B,
kcuf1=\E[C,
kcuu1=\E[A,
use=xterm+noapp+pc,
xterm+app|fragment with cursor keys in application mode,
kcub1=\EOD,
kcud1=\EOB,
kcuf1=\EOC,
kcuu1=\EOA,
use=xterm+app+pc,
xterm+noapp+pc|fragment for noapp pc-style home/end,
kend=\E[F,
khome=\E[H,
xterm+app+pc|fragment for app pc-style home/end,
kend=\EOF,
khome=\EOH,
xterm+edit|fragment for 6-key editing-keypad,
kdch1=\E[3~,
kich1=\E[2~,
knp=\E[6~,
kpp=\E[5~,
use=xterm+pc+edit,
xterm+decedit|fragment for vt220 6-key editing-keypad,
kdch1=\E[3~,
kich1=\E[2~,
knp=\E[6~,
kpp=\E[5~,
use=xterm+vt+edit,
xterm+pc+edit|fragment for pc-style editing keypad,
kend=\E[4~,
khome=\E[1~,
xterm+vt+edit|fragment for vt220-style editing keypad,
kfnd=\E[1~,
kslt=\E[4~,
#
# This should work for the commonly used "color xterm" variations (XFree86
# xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for
# XFree86 and and rxvt, some applications that use colors will be less
# efficient, and in a few special cases (with "smart" optimization) the wrong
# color will be painted in spots.
xterm-color|generic "ANSI" color xterm (X Window System),
colors#8,
ncv@,
pairs#64,
op=\E[m,
setab=\E[4%p1%dm,
setaf=\E[3%p1%dm,
use=xterm-r6,
#
# vi may work better with this entry, because vi
# doesn't use insert mode much
xterm-ic|xterm-vi|xterm with insert character instead of insert mode,
mir@,
ich=\E[%p1%d@,
ich1=\E[@,
rmir@,
smir@,
use=xterm,
#
# This is used only for testing (it's not relevant to DEC VTxxx terminals, but
# to ncurses).
xterm-xmc|xterm with magic-cookie glitch,
xmc#1,
use=xterm-new,
#
# This one also is primarily for testing ncurses; while the ISO 6429 defines
# the REP control, none of the DEC VTxxx terminals (VT52 through VT420) support
# it.
xterm-rep|xterm with repeat-character control,
rep=%p1%c\E[%p2%{1}%-%db,
use=xterm-new,
#
# This is mainly for testing xterm; the real VT220 will not let you switch
# character sets without first altering the keyboard language in the setup
# screen. Some emulators allow this anyway. (Note that these strings are
# normally used only for printers). The parameter to csnm and scs is the same
# in both cases: the keyboard language parameter returned by CSI ? 2 6 n.
xterm-nrc|xterm with VT220 national replacement character sets,
csnm=%?%p1%{1}%=%tNorth American%e%p1%{2}%=%tBritish%e%p1%{3}%=%tFlemish%e%p1%{4}%=%tFrench Canadian%e%p1%{5}%=%tDanish%e%p1%{6}%=%tFinnish%e%p1%{7}%=%tGerman%e%p1%{8}%=%tDutch%e%p1%{9}%=%tItalian%e%p1%{10}%=%tSwiss (French)%e%p1%{11}%=%tSwiss (German)%e%p1%{12}%=%tSwedish%e%p1%{13}%=%tNorwegian%e%p1%{14}%=%tFrench/Belgian%e%p1%{15}%=%tSpanish%;,
scs=%?%p1%{1}%=%t\E(B%e%p1%{2}%=%t\E(A%e%p1%{3}%=%t\E(R%e%p1%{4}%=%t\E(9%e%p1%{5}%=%t\E(E%e%p1%{6}%=%t\E(5%e%p1%{7}%=%t\E(K%e%p1%{8}%=%t\E(4%e%p1%{9}%=%t\E(Y%e%p1%{10}%=%t\E(=%e%p1%{11}%=%t\E(=%e%p1%{12}%=%t\E(7%e%p1%{13}%=%t\E(E%e%p1%{14}%=%t\E(R%e%p1%{15}%=%t\E(Z%;,
use=xterm-new,
#
# Foreground 0-15 maps (with toggles) into 30-37 & 90-97
# Background 0-15 maps (with toggles) into 40-47 & 100-107
#
# Originally I suppressed setaf/setab, since ANSI specifies only 8 colors, but
# Stephen Marley persuaded me to allow the "ANSI" color controls to extend to
# 16 colors. (Note that ncurses 4.2 uses setf/setb from this description;
# however 5.0 selects either according to their availability). - T.Dickey
#
# SVr4 curses does not use more than 8 colors anyway, so using 16 colors is
# either for terminfo-level applications or via ncurses.
xterm-16color|xterm with 16 colors,
colors#16,
pairs#256,
setab=\E[%?%p1%{8}%<%t%p1%{40}%+%e%p1%{92}%+%;%dm,
setaf=\E[%?%p1%{8}%<%t%p1%{30}%+%e%p1%{82}%+%;%dm,
setb=%p1%{8}%/%{6}%*%{4}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m,
setf=%p1%{8}%/%{6}%*%{3}%+\E[%d%p1%{8}%m%Pa%?%ga%{1}%=%t4%e%ga%{3}%=%t6%e%ga%{4}%=%t1%e%ga%{6}%=%t3%e%ga%d%;m,
use=xterm+256color,
use=xterm-new,
#
# This uses RGB values 0..1000
#
# 256 colors should give 65536 pairs, but terminfo stores numbers in a signed
# short. Most people will not notice problems with only 32767 pairs.
xterm+256color|xterm 256-color feature,
ccc,
colors#256,
pairs#32767,
initc=\E]4;%p1%d;rgb\:%p2%{255}%*%{1000}%/%2.2X/%p3%{255}%*%{1000}%/%2.2X/%p4%{255}%*%{1000}%/%2.2X\E\\,
setab=\E[%?%p1%{8}%<%t4%p1%d%e%p1%{16}%<%t10%p1%{8}%-%d%e48;5;%p1%d%;m,
setaf=\E[%?%p1%{8}%<%t3%p1%d%e%p1%{16}%<%t9%p1%{8}%-%d%e38;5;%p1%d%;m,
setb@,
setf@,
xterm-256color|xterm with 256 colors,
use=xterm+256color,
use=xterm-new,
xterm-88color|xterm with 88 colors,
colors#88,
pairs#7744,
use=xterm-256color,
#
# This is an 8-bit version of xterm, which emulates DEC vt220 with ANSI color.
# To use it, your decTerminalID resource must be set to 200 or above, and the
# sunKeyboard resource set to true.
#
# HTS \E H \210
# RI \E M \215
# SS3 \E O \217
# CSI \E [ \233
#
xterm-8bit|xterm terminal emulator with 8-bit controls (X Window System),
OTbs,
am,
bce,
km,
mc5i,
mir,
msgr,
npc,
xenl,
AX,
colors#8,
cols#80,
it#8,
lines#24,
pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G,
blink=\2335m,
bold=\2331m,
cbt=\233Z,
civis=\233?25l,
clear=\233H\2332J,
cnorm=\233?25l\233?25h,
cr=^M,
csr=\233%i%p1%d;%p2%dr,
cub=\233%p1%dD,
cub1=^H,
cud=\233%p1%dB,
cud1=^J,
cuf=\233%p1%dC,
cuf1=\233C,
cup=\233%i%p1%d;%p2%dH,
cuu=\233%p1%dA,
cuu1=\233A,
cvvis=\233?12;25h,
dch=\233%p1%dP,
dch1=\233P,
dl=\233%p1%dM,
dl1=\233M,
ech=\233%p1%dX,
ed=\233J,
el=\233K,
el1=\2331K,
flash=\233?5h$<100/>\233?5l,
home=\233H,
hpa=\233%i%p1%dG,
ht=^I,
hts=\210,
ich=\233%p1%d@,
il=\233%p1%dL,
il1=\233L,
ind=^J,
invis=\2338m,
is2=\E[62"p\E G\233m\233?7h\E>\E7\233?1;3;4;6l\2334l\233r\E8,
ka1=\217w,
ka3=\217u,
kb2=\217y,
kbeg=\217E,
kc1=\217q,
kc3=\217s,
kcbt=\233Z,
kcub1=\217D,
kcud1=\217B,
kcuf1=\217C,
kcuu1=\217A,
kdch1=\2333~,
kend=\2334~,
kent=\217M,
kf1=\23311~,
kf10=\23321~,
kf11=\23323~,
kf12=\23324~,
kf13=\23325~,
kf14=\23326~,
kf15=\23328~,
kf16=\23329~,
kf17=\23331~,
kf18=\23332~,
kf19=\23333~,
kf2=\23312~,
kf20=\23334~,
kf3=\23313~,
kf4=\23314~,
kf5=\23315~,
kf6=\23317~,
kf7=\23318~,
kf8=\23319~,
kf9=\23320~,
khome=\2331~,
kich1=\2332~,
kmous=\233M,
knp=\2336~,
kpp=\2335~,
mc0=\233i,
mc4=\2334i,
mc5=\2335i,
meml=\El,
memu=\Em,
op=\23339;49m,
rc=\E8,
rev=\2337m,
ri=\215,
rmacs=\E(B,
rmam=\233?7l,
rmcup=\233?1049l,
rmir=\2334l,
rmkx=\233?1l\E>,
rmso=\23327m,
rmul=\23324m,
rs1=\Ec,
rs2=\E[62"p\E G\233m\233?7h\E>\E7\233?1;3;4;6l\2334l\233r\E8,
sc=\E7,
setab=\2334%p1%dm,
setaf=\2333%p1%dm,
setb=\2334%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\2333%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr=\2330%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\E(0%e\E(B%;,
sgr0=\2330m\E(B,
smacs=\E(0,
smam=\233?7h,
smcup=\233?1049h,
smir=\2334h,
smkx=\233?1h\E=,
smso=\2337m,
smul=\2334m,
tbc=\2333g,
u6=\233[%i%d;%dR,
u7=\E[6n,
u8=\233[?1;2c,
u9=\E[c,
vpa=\233%i%p1%dd,
use=xterm+kbs,
#
xterm-xf86-v44|xterm terminal emulator (XFree86 4.4 Window System),
OTbs,
am,
bce,
km,
mc5i,
mir,
msgr,
npc,
xenl,
AX,
XT,
colors#8,
cols#80,
it#8,
lines#24,
pairs#64,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G,
blink=\E[5m,
bold=\E[1m,
cbt=\E[Z,
civis=\E[?25l,
clear=\E[H\E[2J,
cnorm=\E[?12l\E[?25h,
cr=^M,
csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD,
cub1=^H,
cud=\E[%p1%dB,
cud1=^J,
cuf=\E[%p1%dC,
cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA,
cuu1=\E[A,
cvvis=\E[?12;25h,
dch=\E[%p1%dP,
dch1=\E[P,
dl=\E[%p1%dM,
dl1=\E[M,
ech=\E[%p1%dX,
ed=\E[J,
el=\E[K,
el1=\E[1K,
enacs=\E(B\E)0,
flash=\E[?5h$<100/>\E[?5l,
home=\E[H,
hpa=\E[%i%p1%dG,
ht=^I,
hts=\EH,
ich=\E[%p1%d@,
il=\E[%p1%dL,
il1=\E[L,
ind=^J,
indn=\E[%p1%dS,
invis=\E[8m,
is2=\E[!p\E[?3;4l\E[4l\E>,
kDC=\E[3;2~,
kEND=\E[1;2F,
kHOM=\E[1;2H,
kIC=\E[2;2~,
kLFT=\E[1;2D,
kNXT=\E[6;2~,
kPRV=\E[5;2~,
kRIT=\E[1;2C,
kb2=\EOE,
kcbt=\E[Z,
kcub1=\EOD,
kcud1=\EOB,
kcuf1=\EOC,
kcuu1=\EOA,
kdch1=\E[3~,
kend=\EOF,
kent=\EOM,
kf1=\EOP,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\EO2P,
kf14=\EO2Q,
kf15=\EO2R,
kf16=\EO2S,
kf17=\E[15;2~,
kf18=\E[17;2~,
kf19=\E[18;2~,
kf2=\EOQ,
kf20=\E[19;2~,
kf21=\E[20;2~,
kf22=\E[21;2~,
kf23=\E[23;2~,
kf24=\E[24;2~,
kf25=\EO5P,
kf26=\EO5Q,
kf27=\EO5R,
kf28=\EO5S,
kf29=\E[15;5~,
kf3=\EOR,
kf30=\E[17;5~,
kf31=\E[18;5~,
kf32=\E[19;5~,
kf33=\E[20;5~,
kf34=\E[21;5~,
kf35=\E[23;5~,
kf36=\E[24;5~,
kf37=\EO6P,
kf38=\EO6Q,
kf39=\EO6R,
kf4=\EOS,
kf40=\EO6S,
kf41=\E[15;6~,
kf42=\E[17;6~,
kf43=\E[18;6~,
kf44=\E[19;6~,
kf45=\E[20;6~,
kf46=\E[21;6~,
kf47=\E[23;6~,
kf48=\E[24;6~,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
khome=\EOH,
kich1=\E[2~,
kmous=\E[M,
knp=\E[6~,
kpp=\E[5~,
mc0=\E[i,
mc4=\E[4i,
mc5=\E[5i,
meml=\El,
memu=\Em,
op=\E[39;49m,
rc=\E8,
rev=\E[7m,
ri=\EM,
rin=\E[%p1%dT,
rmacs=^O,
rmam=\E[?7l,
rmcup=\E[?1049l,
rmir=\E[4l,
rmkx=\E[?1l\E>,
rmso=\E[27m,
rmul=\E[24m,
rs1=\Ec,
rs2=\E[!p\E[?3;4l\E[4l\E>,
sc=\E7,
setab=\E[4%p1%dm,
setaf=\E[3%p1%dm,
setb=\E[4%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
setf=\E[3%?%p1%{1}%=%t4%e%p1%{3}%=%t6%e%p1%{4}%=%t1%e%p1%{6}%=%t3%e%p1%d%;m,
sgr=\E[0%?%p6%t;1%;%?%p2%t;4%;%?%p1%p3%|%t;7%;%?%p4%t;5%;%?%p7%t;8%;m%?%p9%t\016%e\017%;,
sgr0=\E[m\017,
smacs=^N,
smam=\E[?7h,
smcup=\E[?1049h,
smir=\E[4h,
smkx=\E[?1h\E=,
smso=\E[7m,
smul=\E[4m,
tbc=\E[3g,
u6=\E[%i%d;%dR,
u7=\E[6n,
u8=\E[?1;2c,
u9=\E[c,
vpa=\E[%i%p1%dd,
ka2=\EOx,
kb1=\EOt,
kb3=\EOv,
kc2=\EOr,
use=xterm+kbs,
xterm-xfree86|xterm terminal emulator (XFree86 4.4 Window System),
use=xterm-xf86-v44,
#
# Compatible with the R6 xterm, with the following changes:
# + added acsc (perhaps some versions of tic assume the standard vt100
# alternate character set)
# + added u6, u7, u8, u9 strings for Daniel Weaver's tack program.
# + added kmous string for ncurses.
# + added khome/kend strings (which conflict with kfnd/kslt, see note).
xterm-r6|xterm X11R6 version,
OTbs,
am,
km,
mir,
msgr,
xenl,
cols#80,
it#8,
lines#24,
acsc=``aaffggiijjkkllmmnnooppqqrrssttuuvvwwxxyyzz{{||}}~~,
bel=^G,
bold=\E[1m,
clear=\E[H\E[2J,
cr=^M,
csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD,
cub1=^H,
cud=\E[%p1%dB,
cud1=^J,
cuf=\E[%p1%dC,
cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA,
cuu1=\E[A,
dch=\E[%p1%dP,
dch1=\E[P,
dl=\E[%p1%dM,
dl1=\E[M,
ed=\E[J,
el=\E[K,
enacs=\E)0,
home=\E[H,
ht=^I,
hts=\EH,
il=\E[%p1%dL,
il1=\E[L,
ind=^J,
is2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8,
kcub1=\EOD,
kcud1=\EOB,
kcuf1=\EOC,
kcuu1=\EOA,
kdch1=\E[3~,
kf1=\E[11~,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf13=\E[25~,
kf14=\E[26~,
kf15=\E[28~,
kf16=\E[29~,
kf17=\E[31~,
kf18=\E[32~,
kf19=\E[33~,
kf2=\E[12~,
kf20=\E[34~,
kf3=\E[13~,
kf4=\E[14~,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
kmous=\E[M,
meml=\El,
memu=\Em,
rc=\E8,
rev=\E[7m,
ri=\EM,
rmacs=^O,
rmcup=\E[2J\E[?47l\E8,
rmir=\E[4l,
rmkx=\E[?1l\E>,
rmso=\E[m,
rmul=\E[m,
rs2=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8,
sc=\E7,
sgr0=\E[m,
smacs=^N,
smcup=\E7\E[?47h,
smir=\E[4h,
smkx=\E[?1h\E=,
smso=\E[7m,
smul=\E[4m,
tbc=\E[3g,
u6=\E[%i%d;%dR,
u7=\E[6n,
u8=\E[?1;2c,
u9=\E[c,
use=xterm+kbs,
use=xterm+decedit,
xterm-old|antique xterm version,
use=xterm-r6,
#
# Compatible with the R5 xterm, with the following changes:
# + changed 'blink=@', to 'blink@' (the former meant that "@" would start
# a blink, the latter that it is not supported).
# + changed kf1 through kf4 to correspond with actual usage. Though X
# supports keypad symbols for PF1 to PF4, and xterm interprets these
# correctly, the F1 to F4 codes are commonly (but incorrectly) used.
# + moved reset string from rs1 to rs2, to correlate better with termcap.
# + make khome consistent with other entries.
# + use rmul/smul, rmir/smir from termcap, but not rmcup/smcup because
# not everyone wants the alternate screen.
# + added u6, u7, u8, u9 strings for Daniel Weaver's tack program.
# + added kmous string for ncurses.
xterm-r5|xterm R5 version,
OTbs,
am,
km,
msgr,
xenl,
cols#80,
it#8,
lines#24,
bel=^G,
bold=\E[1m,
clear=\E[H\E[2J,
cr=^M,
csr=\E[%i%p1%d;%p2%dr,
cub=\E[%p1%dD,
cub1=^H,
cud=\E[%p1%dB,
cud1=^J,
cuf=\E[%p1%dC,
cuf1=\E[C,
cup=\E[%i%p1%d;%p2%dH,
cuu=\E[%p1%dA,
cuu1=\E[A,
dch=\E[%p1%dP,
dch1=\E[P,
dl=\E[%p1%dM,
dl1=\E[M,
ed=\E[J,
el=\E[K,
home=\E[H,
ht=^I,
hts=\EH,
ich=\E[%p1%d@,
ich1=\E[@,
il=\E[%p1%dL,
il1=\E[L,
ind=^J,
kcub1=\EOD,
kcud1=\EOB,
kcuf1=\EOC,
kcuu1=\EOA,
kdch1=\E[3~,
kdl1=\E[31~,
kel=\E[8~,
kend=\E[4~,
kf0=\EOq,
kf1=\E[11~,
kf10=\E[21~,
kf11=\E[23~,
kf12=\E[24~,
kf2=\E[12~,
kf3=\E[13~,
kf4=\E[14~,
kf5=\E[15~,
kf6=\E[17~,
kf7=\E[18~,
kf8=\E[19~,
kf9=\E[20~,
khome=\E[1~,
kich1=\E[2~,
kil1=\E[30~,
kmous=\E[M,
knp=\E[6~,
kpp=\E[5~,
rc=\E8,
rev=\E[7m,
ri=\EM,
rmir=\E[4l,
rmkx=\E[?1l\E>,
rmso=\E[m,
rmul=\E[m,
rs2=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H,
sc=\E7,
sgr=\E[%?%p1%t;7%;%?%p2%t;4%;%?%p3%t;7%;%?%p4%t;5%;%?%p6%t;1%;m,
sgr0=\E[m,
smir=\E[4h,
smkx=\E[?1h\E=,
smso=\E[7m,
smul=\E[4m,
tbc=\E[3g,
u6=\E[%i%d;%dR,
u7=\E[6n,
u8=\E[?1;2c,
u9=\E[c,
use=xterm+kbs,
#
#
# Customization begins here.
#
# This is the only entry which you should have to customize, since "xterm"
# is widely used for a variety of incompatible terminal emulations including
# color_xterm and rxvt.
xterm|X11 terminal emulator,
use=xterm-new,
# use=xterm-r6,
# This fragment is for people who cannot agree on what the backspace key
# should send.
xterm+kbs|fragment for backspace key,
kbs=^H,
xterm-297/df-install.in 0000644 0001751 0000144 00000005710 12016544107 013643 0 ustar tom users #!/bin/sh
# $XTermId: df-install.in,v 1.14 2012/08/27 01:07:19 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2011,2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
#
# Install desktop-files, substituting the category to customize the file
# to the current system's conventions.
#
# Parameters are passed to the desktop-file-install program. The last
# parameter is the name of the ".desktop" file to install.
OPTS=
if test $# != 0
then
APP_NAME=$1
shift 1
fi
CDPATH=:
export CDPATH
while test $# != 0
do
case .$1 in #(vi
*.desktop) #(vi
if test $# = 1
then
OLD_FILE=$1
else
OPTS="$OPTS $1"
fi
;;
*)
OPTS="$OPTS $1"
;;
esac
shift 1
done
MY_TEMP=tempdir$$
rm -rf $MY_TEMP
if test -z "$OLD_FILE"
then
echo "? not found: $OLD_FILE"
exit 1
elif ! mkdir $MY_TEMP
then
echo "? cannot mkdir: $MY_TEMP"
exit 1
fi
# The newer dfi whines about deprecation of encoding, but no release provides
# --version or equivalent. really.
if desktop-file-install --help-all >/dev/null 2>&1
then
NO_ENCODING="#Encoding"
else
NO_ENCODING="Encoding"
fi
NEW_FILE=`basename $OLD_FILE`
sed \
-e '/^Encoding=/s%Encoding%'$NO_ENCODING'%' \
-e '/^[^#]*Icon=/s%=.*%=xterm-color%' \
-e '/^[^#]*Category=/s%=.*%=@DESKTOP_CATEGORY@%' \
-e '/^[^#]*Categories=/s%=.*%=@DESKTOP_CATEGORY@%' \
-e '/^[^#]/s%xterm%'$APP_NAME'%g' \
-e '/^[^#]/s%XTerm%@APP_CLASS@%g' \
$OLD_FILE >$MY_TEMP/$NEW_FILE
diff -u $OLD_FILE $MY_TEMP/$NEW_FILE
cd $MY_TEMP
desktop-file-install $OPTS $NEW_FILE
cd ..
rm -rf $MY_TEMP
# vi:ts=4 sw=4
xterm-297/tabs.c 0000644 0001751 0000144 00000012070 11765150447 012362 0 ustar tom users /* $XTermId: tabs.c,v 1.43 2012/06/10 16:53:59 tom Exp $ */
/*
* Copyright 2000-2011,2012 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*
*
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
*
* All Rights Reserved
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Digital Equipment
* Corporation not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior permission.
*
*
* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* tabs.c */
#include
#include
#define TAB_INDEX(n) ((n) >> TAB_BITS_SHIFT)
#define TAB_MASK(n) (1 << ((n) & (TAB_BITS_WIDTH-1)))
#define SET_TAB(tabs,n) UIntSet(tabs[TAB_INDEX(n)], TAB_MASK(n))
#define CLR_TAB(tabs,n) UIntClr(tabs[TAB_INDEX(n)], TAB_MASK(n))
#define TST_TAB(tabs,n) (tabs[TAB_INDEX(n)] & (unsigned) TAB_MASK(n))
/*
* places tabstops at only every 8 columns
*/
void
TabReset(Tabs tabs)
{
int i;
TabZonk(tabs);
for (i = 0; i < MAX_TABS; i += 8)
TabSet(tabs, i);
}
/*
* places a tabstop at col
*/
void
TabSet(Tabs tabs, int col)
{
if (col >= 0 && col < MAX_TABS) {
SET_TAB(tabs, col);
}
}
/*
* clears a tabstop at col
*/
void
TabClear(Tabs tabs, int col)
{
if (col >= 0 && col < MAX_TABS) {
CLR_TAB(tabs, col);
}
}
/*
* returns the column of the next tabstop
* (or MAX_TABS - 1 if there are no more).
* A tabstop at col is ignored.
*/
static int
TabNext(XtermWidget xw, Tabs tabs, int col)
{
TScreen *screen = TScreenOf(xw);
if (screen->curses && screen->do_wrap && (xw->flags & WRAPAROUND)) {
xtermIndex(xw, 1);
set_cur_col(screen, 0);
col = 0;
ResetWrap(screen);
}
for (++col; col < MAX_TABS; ++col)
if (TST_TAB(tabs, col))
return (col);
return (MAX_TABS - 1);
}
/*
* returns the column of the previous tabstop
* (or 0 if there are no more).
* A tabstop at col is ignored.
*/
static int
TabPrev(Tabs tabs, int col)
{
for (--col; col >= 0; --col)
if ((col < MAX_TABS) && TST_TAB(tabs, col))
return (col);
return (0);
}
/*
* Tab to the next stop, returning true if the cursor moved
*/
Bool
TabToNextStop(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int saved_column = screen->cur_col;
int next = TabNext(xw, xw->tabs, screen->cur_col);
int max = LineMaxCol(screen, getLineData(screen, screen->cur_row));
if (IsLeftRightMode(xw))
max = TScreenOf(xw)->rgt_marg;
if (next > max)
next = max;
set_cur_col(screen, next);
return (screen->cur_col > saved_column);
}
/*
* Tab to the previous stop, returning true if the cursor moved
*/
Bool
TabToPrevStop(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int saved_column = screen->cur_col;
int next_column = TabPrev(xw->tabs, screen->cur_col);
if (xw->flags & ORIGIN) {
int left = ScrnLeftMargin(xw);
if (next_column < left)
next_column = left;
}
set_cur_col(screen, next_column);
return (screen->cur_col < saved_column);
}
/*
* clears all tabs
*/
void
TabZonk(Tabs tabs)
{
memset(tabs, 0, sizeof(*tabs) * TAB_ARRAY_SIZE);
}
xterm-297/XTerm.ad 0000644 0001751 0000144 00000023631 12161534151 012624 0 ustar tom users ! $XTermId: XTerm.ad,v 1.99 2013/06/23 08:57:13 Ross.Combs Exp $
! -----------------------------------------------------------------------------
! this file is part of xterm
!
! Copyright 1996-2010,2011 by Thomas E. Dickey
!
! All Rights Reserved
!
! Permission is hereby granted, free of charge, to any person obtaining a
! copy of this software and associated documentation files (the
! "Software"), to deal in the Software without restriction, including
! without limitation the rights to use, copy, modify, merge, publish,
! distribute, sublicense, and/or sell copies of the Software, and to
! permit persons to whom the Software is furnished to do so, subject to
! the following conditions:
!
! The above copyright notice and this permission notice shall be included
! in all copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
! IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
!
! Except as contained in this notice, the name(s) of the above copyright
! holders shall not be used in advertising or otherwise to promote the
! sale, use or other dealings in this Software without prior written
! authorization.
! -----------------------------------------------------------------------------
*saveLines: 1024
*SimpleMenu*BackingStore: NotUseful
*SimpleMenu*menuLabel.font: -adobe-helvetica-bold-r-normal--*-120-*-*-*-*-iso8859-*
*SimpleMenu*menuLabel.vertSpace: 100
*SimpleMenu*HorizontalMargins: 16
*SimpleMenu*Sme.height: 16
*SimpleMenu*Cursor: left_ptr
*mainMenu.Label: Main Options
*mainMenu*toolbar*Label: Toolbar
*mainMenu*fullscreen*Label: Full Screen
*mainMenu*securekbd*Label: Secure Keyboard
*mainMenu*allowsends*Label: Allow SendEvents
*mainMenu*redraw*Label: Redraw Window
*mainMenu*logging*Label: Log to File
*mainMenu*print-immediate*Label: Print-All Immediately
*mainMenu*print-on-error*Label: Print-All on Error
*mainMenu*print*Label: Print Window
*mainMenu*print-redir*Label: Redirect to Printer
*mainMenu*8-bit control*Label: 8-Bit Controls
*mainMenu*backarrow key*Label: Backarrow Key (BS/DEL)
*mainMenu*num-lock*Label: Alt/NumLock Modifiers
*mainMenu*alt-esc*Label: Alt Sends Escape
*mainMenu*meta-esc*Label: Meta Sends Escape
*mainMenu*delete-is-del*Label: Delete is DEL
*mainMenu*oldFunctionKeys*Label: Old Function-Keys
*mainMenu*sunFunctionKeys*Label: Sun Function-Keys
*mainMenu*sunKeyboard*Label: VT220 Keyboard
*mainMenu*hpFunctionKeys*Label: HP Function-Keys
*mainMenu*scoFunctionKeys*Label: SCO Function-Keys
*mainMenu*tcapFunctionKeys*Label: Termcap Function-Keys
*mainMenu*suspend*Label: Send STOP Signal
*mainMenu*continue*Label: Send CONT Signal
*mainMenu*interrupt*Label: Send INT Signal
*mainMenu*hangup*Label: Send HUP Signal
*mainMenu*terminate*Label: Send TERM Signal
*mainMenu*kill*Label: Send KILL Signal
*mainMenu*quit*Label: Quit
*vtMenu.Label: VT Options
*vtMenu*scrollbar*Label: Enable Scrollbar
*vtMenu*jumpscroll*Label: Enable Jump Scroll
*vtMenu*reversevideo*Label: Enable Reverse Video
*vtMenu*autowrap*Label: Enable Auto Wraparound
*vtMenu*reversewrap*Label: Enable Reverse Wraparound
*vtMenu*autolinefeed*Label: Enable Auto Linefeed
*vtMenu*appcursor*Label: Enable Application Cursor Keys
*vtMenu*appkeypad*Label: Enable Application Keypad
*vtMenu*scrollkey*Label: Scroll to Bottom on Key Press
*vtMenu*scrollttyoutput*Label: Scroll to Bottom on Tty Output
*vtMenu*allow132*Label: Allow 80/132 Column Switching
*vtMenu*keepSelection*Label: Keep Selection
*vtMenu*selectToClipboard*Label: Select to Clipboard
*vtMenu*cursesemul*Label: Enable Curses Emulation
*vtMenu*visualbell*Label: Enable Visual Bell
*vtMenu*bellIsUrgent*Label: Enable Bell Urgency
*vtMenu*poponbell*Label: Enable Pop on Bell
*vtMenu*cursorblink*Label: Enable Blinking Cursor
*vtMenu*titeInhibit*Label: Enable Alternate Screen Switching
*vtMenu*activeicon*Label: Enable Active Icon
*vtMenu*softreset*Label: Do Soft Reset
*vtMenu*hardreset*Label: Do Full Reset
*vtMenu*clearsavedlines*Label: Reset and Clear Saved Lines
*vtMenu*tekshow*Label: Show Tek Window
*vtMenu*tekmode*Label: Switch to Tek Mode
*vtMenu*vthide*Label: Hide VT Window
*vtMenu*altscreen*Label: Show Alternate Screen
*vtMenu*sixelScrolling*Label: Sixel Scrolling
*vtMenu*privateColorRegisters*Label: Private Color Registers
*fontMenu.Label: VT Fonts
*fontMenu*fontdefault*Label: Default
*fontMenu*font1*Label: Unreadable
*VT100.font1: nil2
*IconFont: nil2
*fontMenu*font2*Label: Tiny
*VT100.font2: 5x7
*fontMenu*font3*Label: Small
*VT100.font3: 6x10
*fontMenu*font4*Label: Medium
*VT100.font4: 7x13
*fontMenu*font5*Label: Large
*VT100.font5: 9x15
*fontMenu*font6*Label: Huge
*VT100.font6: 10x20
*fontMenu*fontescape*Label: Escape Sequence
*fontMenu*fontsel*Label: Selection
!fontescape and fontsel overridden by application
*fontMenu*allow-bold-fonts*Label: Bold Fonts
*fontMenu*font-linedrawing*Label: Line-Drawing Characters
*fontMenu*font-doublesize*Label: Doublesized Characters
*fontMenu*font-loadable*Label: VT220 Soft Fonts
*fontMenu*font-packed*Label: Packed Font
*fontMenu*render-font*Label: TrueType Fonts
*fontMenu*utf8-mode*Label: UTF-8 Encoding
*fontMenu*utf8-fonts*Label: UTF-8 Fonts
*fontMenu*utf8-title*Label: UTF-8 Titles
*fontMenu*allow-color-ops*Label: Allow Color Ops
*fontMenu*allow-font-ops*Label: Allow Font Ops
*fontMenu*allow-tcap-ops*Label: Allow Termcap Ops
*fontMenu*allow-title-ops*Label: Allow Title Ops
*fontMenu*allow-window-ops*Label: Allow Window Ops
*VT100.utf8Fonts.font2: -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
*VT100.utf8Fonts.font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
*VT100.utf8Fonts.font3: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
*VT100.utf8Fonts.font4: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
*VT100.utf8Fonts.font5: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
*VT100.utf8Fonts.font6: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
*tekMenu.Label: Tek Options
*tekMenu*tektextlarge*Label: Large Characters
*tekMenu*tektext2*Label: #2 Size Characters
*tekMenu*tektext3*Label: #3 Size Characters
*tekMenu*tektextsmall*Label: Small Characters
*tekMenu*tekpage*Label: PAGE
*tekMenu*tekreset*Label: RESET
*tekMenu*tekcopy*Label: COPY
*tekMenu*vtshow*Label: Show VT Window
*tekMenu*vtmode*Label: Switch to VT Mode
*tekMenu*tekhide*Label: Hide Tek Window
*tek4014*fontLarge: 9x15
*tek4014*font2: 8x13
*tek4014*font3: 6x13
*tek4014*fontSmall: 6x10
! If xterm is built with a toolbar, the widget hierarchy looks like this,
! showing widget name / class names. The complete menu hierarchy is built
! at startup because it is needed to make the layout work for the menubar:
!
! xterm/XTerm
! form/Form
! menubar/Box
! mainMenuButton/MenuButton
! mainMenu/SimpleMenu
! menuLabel/SmeBSB
! toolbar/SmeBSB
! ...
! vtMenu/SimpleMenu
! menuLabel/SmeBSB
! scrollbar/SmeBSB
! ...
! fontMenu/SimpleMenu
! menuLabel/SmeBSB
! fontdefault/SmeBSB
! ...
! tekMenu/SimpleMenu
! menuLabel/SmeBSB
! fontdefault/SmeBSB
! ...
! vt100/VT100
! tektronix/TopLevelShell
! shellext/VendorShellExt
! tek4014/Tek4014
!
! If built without a toolbar, the widget hierarchy is simpler, because there
! is no form, and the popup menu widgets are created only when they are first
! used.
!
! xterm/XTerm
! shellext/VendorShellExt
! mainMenu/SimpleMenu
! menuLabel/SmeBSB
! ...
! ...
! vt100/VT100
! tektronix/TopLevelShell
! shellext/VendorShellExt
! tek4014/Tek4014
!
! A more complete list of the widget/class names can be obtained using editres
! to dump a file. Some widget names are not available until the corresponding
! menu has been created.
! These resources reduce space around the menubar, by eliminating padding in
! the enclosing form (Thickness) and the border of the Box which represents
! the menubar widget.
*form.Thickness: 0
*menubar.borderWidth: 0
! If we wanted to eliminate the border of the popup menus, we could do this
! instead, since they are children of the menubar:
!*menubar*borderWidth: 0
! Eliminate the border of the buttons in the menubar, so the only line around
! the text is for the highlighted button:
*MenuButton*borderWidth: 0
! Set a border for the menus to make them simpler to distinguish against the
! vt100 widget:
*SimpleMenu*borderWidth: 2
! xterm can switch at runtime between bitmap (default) and TrueType fonts.
! The "faceSize" resource controls the size of the latter. However, it was
! originally given with a size that makes the two types of fonts different
! sizes. Uncomment this line to use the same size as "fixed".
!*faceSize: 8
! Here is a pattern that is useful for double-clicking on a URL:
!*charClass: 33:48,35:48,37-38:48,43-47:48,58:48,61:48,63-64:48,95:48,126:48
!
! Alternatively,
!*on2Clicks: regex [[:alpha:]]+://([[:alnum:]!#+,./=?@_~-]|(%[[:xdigit:]][[:xdigit:]]))+
! VT100s and similar terminals recognize escape sequences and control
! characters to which they reply to the host with other escape sequences,
! to provide information. The "resize" program uses this feature.
!
! In addition, xterm recognizes several escape sequences which can be used to
! set fonts, window properties, return settings via escape sequences. Some
! find these useful; others are concerned with the possibility of unexpected
! inputs.
!
! All of these features can be enabled or disabled via menus.
!
! Depending on your environment, you may wish to disable those by default by
! uncommenting one or more of the resource settings below:
!*allowFontOps: false
!*allowTcapOps: false
!*allowTitleOps: false
!*allowWindowOps: false
xterm-297/88colres.h 0000644 0001751 0000144 00000011326 10633366145 013105 0 ustar tom users /*
* This header file was generated by ./88colres.pl
*/
/* $XTermId: 88colres.h,v 1.11 2007/06/12 00:44:21 tom Exp $ */
#ifndef included_88colres_h
#define included_88colres_h
COLOR_RES("16", screen.Acolors[16], DFT_COLOR("rgb:00/00/00")),
COLOR_RES("17", screen.Acolors[17], DFT_COLOR("rgb:00/00/8b")),
COLOR_RES("18", screen.Acolors[18], DFT_COLOR("rgb:00/00/cd")),
COLOR_RES("19", screen.Acolors[19], DFT_COLOR("rgb:00/00/ff")),
COLOR_RES("20", screen.Acolors[20], DFT_COLOR("rgb:00/8b/00")),
COLOR_RES("21", screen.Acolors[21], DFT_COLOR("rgb:00/8b/8b")),
COLOR_RES("22", screen.Acolors[22], DFT_COLOR("rgb:00/8b/cd")),
COLOR_RES("23", screen.Acolors[23], DFT_COLOR("rgb:00/8b/ff")),
COLOR_RES("24", screen.Acolors[24], DFT_COLOR("rgb:00/cd/00")),
COLOR_RES("25", screen.Acolors[25], DFT_COLOR("rgb:00/cd/8b")),
COLOR_RES("26", screen.Acolors[26], DFT_COLOR("rgb:00/cd/cd")),
COLOR_RES("27", screen.Acolors[27], DFT_COLOR("rgb:00/cd/ff")),
COLOR_RES("28", screen.Acolors[28], DFT_COLOR("rgb:00/ff/00")),
COLOR_RES("29", screen.Acolors[29], DFT_COLOR("rgb:00/ff/8b")),
COLOR_RES("30", screen.Acolors[30], DFT_COLOR("rgb:00/ff/cd")),
COLOR_RES("31", screen.Acolors[31], DFT_COLOR("rgb:00/ff/ff")),
COLOR_RES("32", screen.Acolors[32], DFT_COLOR("rgb:8b/00/00")),
COLOR_RES("33", screen.Acolors[33], DFT_COLOR("rgb:8b/00/8b")),
COLOR_RES("34", screen.Acolors[34], DFT_COLOR("rgb:8b/00/cd")),
COLOR_RES("35", screen.Acolors[35], DFT_COLOR("rgb:8b/00/ff")),
COLOR_RES("36", screen.Acolors[36], DFT_COLOR("rgb:8b/8b/00")),
COLOR_RES("37", screen.Acolors[37], DFT_COLOR("rgb:8b/8b/8b")),
COLOR_RES("38", screen.Acolors[38], DFT_COLOR("rgb:8b/8b/cd")),
COLOR_RES("39", screen.Acolors[39], DFT_COLOR("rgb:8b/8b/ff")),
COLOR_RES("40", screen.Acolors[40], DFT_COLOR("rgb:8b/cd/00")),
COLOR_RES("41", screen.Acolors[41], DFT_COLOR("rgb:8b/cd/8b")),
COLOR_RES("42", screen.Acolors[42], DFT_COLOR("rgb:8b/cd/cd")),
COLOR_RES("43", screen.Acolors[43], DFT_COLOR("rgb:8b/cd/ff")),
COLOR_RES("44", screen.Acolors[44], DFT_COLOR("rgb:8b/ff/00")),
COLOR_RES("45", screen.Acolors[45], DFT_COLOR("rgb:8b/ff/8b")),
COLOR_RES("46", screen.Acolors[46], DFT_COLOR("rgb:8b/ff/cd")),
COLOR_RES("47", screen.Acolors[47], DFT_COLOR("rgb:8b/ff/ff")),
COLOR_RES("48", screen.Acolors[48], DFT_COLOR("rgb:cd/00/00")),
COLOR_RES("49", screen.Acolors[49], DFT_COLOR("rgb:cd/00/8b")),
COLOR_RES("50", screen.Acolors[50], DFT_COLOR("rgb:cd/00/cd")),
COLOR_RES("51", screen.Acolors[51], DFT_COLOR("rgb:cd/00/ff")),
COLOR_RES("52", screen.Acolors[52], DFT_COLOR("rgb:cd/8b/00")),
COLOR_RES("53", screen.Acolors[53], DFT_COLOR("rgb:cd/8b/8b")),
COLOR_RES("54", screen.Acolors[54], DFT_COLOR("rgb:cd/8b/cd")),
COLOR_RES("55", screen.Acolors[55], DFT_COLOR("rgb:cd/8b/ff")),
COLOR_RES("56", screen.Acolors[56], DFT_COLOR("rgb:cd/cd/00")),
COLOR_RES("57", screen.Acolors[57], DFT_COLOR("rgb:cd/cd/8b")),
COLOR_RES("58", screen.Acolors[58], DFT_COLOR("rgb:cd/cd/cd")),
COLOR_RES("59", screen.Acolors[59], DFT_COLOR("rgb:cd/cd/ff")),
COLOR_RES("60", screen.Acolors[60], DFT_COLOR("rgb:cd/ff/00")),
COLOR_RES("61", screen.Acolors[61], DFT_COLOR("rgb:cd/ff/8b")),
COLOR_RES("62", screen.Acolors[62], DFT_COLOR("rgb:cd/ff/cd")),
COLOR_RES("63", screen.Acolors[63], DFT_COLOR("rgb:cd/ff/ff")),
COLOR_RES("64", screen.Acolors[64], DFT_COLOR("rgb:ff/00/00")),
COLOR_RES("65", screen.Acolors[65], DFT_COLOR("rgb:ff/00/8b")),
COLOR_RES("66", screen.Acolors[66], DFT_COLOR("rgb:ff/00/cd")),
COLOR_RES("67", screen.Acolors[67], DFT_COLOR("rgb:ff/00/ff")),
COLOR_RES("68", screen.Acolors[68], DFT_COLOR("rgb:ff/8b/00")),
COLOR_RES("69", screen.Acolors[69], DFT_COLOR("rgb:ff/8b/8b")),
COLOR_RES("70", screen.Acolors[70], DFT_COLOR("rgb:ff/8b/cd")),
COLOR_RES("71", screen.Acolors[71], DFT_COLOR("rgb:ff/8b/ff")),
COLOR_RES("72", screen.Acolors[72], DFT_COLOR("rgb:ff/cd/00")),
COLOR_RES("73", screen.Acolors[73], DFT_COLOR("rgb:ff/cd/8b")),
COLOR_RES("74", screen.Acolors[74], DFT_COLOR("rgb:ff/cd/cd")),
COLOR_RES("75", screen.Acolors[75], DFT_COLOR("rgb:ff/cd/ff")),
COLOR_RES("76", screen.Acolors[76], DFT_COLOR("rgb:ff/ff/00")),
COLOR_RES("77", screen.Acolors[77], DFT_COLOR("rgb:ff/ff/8b")),
COLOR_RES("78", screen.Acolors[78], DFT_COLOR("rgb:ff/ff/cd")),
COLOR_RES("79", screen.Acolors[79], DFT_COLOR("rgb:ff/ff/ff")),
COLOR_RES("80", screen.Acolors[80], DFT_COLOR("rgb:2e/2e/2e")),
COLOR_RES("81", screen.Acolors[81], DFT_COLOR("rgb:5c/5c/5c")),
COLOR_RES("82", screen.Acolors[82], DFT_COLOR("rgb:73/73/73")),
COLOR_RES("83", screen.Acolors[83], DFT_COLOR("rgb:8b/8b/8b")),
COLOR_RES("84", screen.Acolors[84], DFT_COLOR("rgb:a2/a2/a2")),
COLOR_RES("85", screen.Acolors[85], DFT_COLOR("rgb:b9/b9/b9")),
COLOR_RES("86", screen.Acolors[86], DFT_COLOR("rgb:d0/d0/d0")),
COLOR_RES("87", screen.Acolors[87], DFT_COLOR("rgb:e7/e7/e7")),
#endif /* included_88colres_h */
xterm-297/README 0000644 0001751 0000144 00000001657 10625366077 012160 0 ustar tom users -- $XTermId: README,v 1.3 2007/05/24 19:49:19 tom Exp $
-- Below is the original README for xterm from 1991, for your amusement.
-- For a better overview, see http://invisible-island.net/xterm/
-------------------------------------------------------------------------------
Abandon All Hope, Ye Who Enter Here
This is undoubtedly the most ugly program in the distribution. It was one of
the first "serious" programs ported, and still has a lot of historical baggage.
Ideally, there would be a general tty widget and then vt102 and tek4014
subwidgets so that they could be used in other programs. We are trying to
clean things up as we go, but there is still a lot of work to do.
If you are porting this to a machine that has problems with overlapping
bcopy's, watch out!
There are two documents on xterm: the man page, xterm.man, which describes
how to use it, and ctlseqs.ms, which describes the control sequences it
understands.
xterm-297/menu.h 0000644 0001751 0000144 00000037374 12161660026 012406 0 ustar tom users /* $XTermId: menu.h,v 1.132 2013/06/23 20:52:38 tom Exp $ */
/*
* Copyright 1999-2011,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*
*
* Copyright 1989 The Open Group
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation.
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
* OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of The Open Group shall
* not be used in advertising or otherwise to promote the sale, use or
* other dealings in this Software without prior written authorization
* from The Open Group.
*
*/
#ifndef included_menu_h
#define included_menu_h
/* *INDENT-OFF* */
#include
typedef struct _MenuEntry {
const char *name;
void (*function) PROTO_XT_CALLBACK_ARGS;
Widget widget;
} MenuEntry;
extern MenuEntry mainMenuEntries[], vtMenuEntries[];
extern MenuEntry fontMenuEntries[];
#if OPT_TEK4014
extern MenuEntry tekMenuEntries[];
#endif
extern void Handle8BitControl PROTO_XT_ACTIONS_ARGS;
extern void HandleAllow132 PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowBoldFonts PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowColorOps PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowFontOps PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowSends PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowTcapOps PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowTitleOps PROTO_XT_ACTIONS_ARGS;
extern void HandleAllowWindowOps PROTO_XT_ACTIONS_ARGS;
extern void HandleAltEsc PROTO_XT_ACTIONS_ARGS;
extern void HandleAltScreen PROTO_XT_ACTIONS_ARGS;
extern void HandleAppCursor PROTO_XT_ACTIONS_ARGS;
extern void HandleAppKeypad PROTO_XT_ACTIONS_ARGS;
extern void HandleAutoLineFeed PROTO_XT_ACTIONS_ARGS;
extern void HandleAutoWrap PROTO_XT_ACTIONS_ARGS;
extern void HandleBackarrow PROTO_XT_ACTIONS_ARGS;
extern void HandleBellIsUrgent PROTO_XT_ACTIONS_ARGS;
extern void HandleClearSavedLines PROTO_XT_ACTIONS_ARGS;
extern void HandleCreateMenu PROTO_XT_ACTIONS_ARGS;
extern void HandleCursesEmul PROTO_XT_ACTIONS_ARGS;
extern void HandleCursorBlink PROTO_XT_ACTIONS_ARGS;
extern void HandleDeleteIsDEL PROTO_XT_ACTIONS_ARGS;
extern void HandleFontBoxChars PROTO_XT_ACTIONS_ARGS;
extern void HandleFontDoublesize PROTO_XT_ACTIONS_ARGS;
extern void HandleFontLoading PROTO_XT_ACTIONS_ARGS;
extern void HandleFontPacked PROTO_XT_ACTIONS_ARGS;
extern void HandleFullscreen PROTO_XT_ACTIONS_ARGS;
extern void HandleHardReset PROTO_XT_ACTIONS_ARGS;
extern void HandleHpFunctionKeys PROTO_XT_ACTIONS_ARGS;
extern void HandleJumpscroll PROTO_XT_ACTIONS_ARGS;
extern void HandleKeepSelection PROTO_XT_ACTIONS_ARGS;
extern void HandleLogging PROTO_XT_ACTIONS_ARGS;
extern void HandleMarginBell PROTO_XT_ACTIONS_ARGS;
extern void HandleMetaEsc PROTO_XT_ACTIONS_ARGS;
extern void HandleNumLock PROTO_XT_ACTIONS_ARGS;
extern void HandleOldFunctionKeys PROTO_XT_ACTIONS_ARGS;
extern void HandlePopupMenu PROTO_XT_ACTIONS_ARGS;
extern void HandlePrintControlMode PROTO_XT_ACTIONS_ARGS;
extern void HandlePrintEverything PROTO_XT_ACTIONS_ARGS;
extern void HandlePrintScreen PROTO_XT_ACTIONS_ARGS;
extern void HandleQuit PROTO_XT_ACTIONS_ARGS;
extern void HandleRedraw PROTO_XT_ACTIONS_ARGS;
extern void HandleRenderFont PROTO_XT_ACTIONS_ARGS;
extern void HandleReverseVideo PROTO_XT_ACTIONS_ARGS;
extern void HandleReverseWrap PROTO_XT_ACTIONS_ARGS;
extern void HandleScoFunctionKeys PROTO_XT_ACTIONS_ARGS;
extern void HandleScrollKey PROTO_XT_ACTIONS_ARGS;
extern void HandleScrollTtyOutput PROTO_XT_ACTIONS_ARGS;
extern void HandleScrollbar PROTO_XT_ACTIONS_ARGS;
extern void HandleSecure PROTO_XT_ACTIONS_ARGS;
extern void HandleSendSignal PROTO_XT_ACTIONS_ARGS;
extern void HandleSetPopOnBell PROTO_XT_ACTIONS_ARGS;
extern void HandleSetPrivateColorRegisters PROTO_XT_ACTIONS_ARGS;
extern void HandleSetSelect PROTO_XT_ACTIONS_ARGS;
extern void HandleSetTekText PROTO_XT_ACTIONS_ARGS;
extern void HandleSetTerminalType PROTO_XT_ACTIONS_ARGS;
extern void HandleSetVisualBell PROTO_XT_ACTIONS_ARGS;
extern void HandleSixelScrolling PROTO_XT_ACTIONS_ARGS;
extern void HandleSoftReset PROTO_XT_ACTIONS_ARGS;
extern void HandleSunFunctionKeys PROTO_XT_ACTIONS_ARGS;
extern void HandleSunKeyboard PROTO_XT_ACTIONS_ARGS;
extern void HandleTekCopy PROTO_XT_ACTIONS_ARGS;
extern void HandleTekPage PROTO_XT_ACTIONS_ARGS;
extern void HandleTekReset PROTO_XT_ACTIONS_ARGS;
extern void HandleTiteInhibit PROTO_XT_ACTIONS_ARGS;
extern void HandleToolbar PROTO_XT_ACTIONS_ARGS;
extern void HandleUTF8Fonts PROTO_XT_ACTIONS_ARGS;
extern void HandleUTF8Mode PROTO_XT_ACTIONS_ARGS;
extern void HandleUTF8Title PROTO_XT_ACTIONS_ARGS;
extern void HandleVisibility PROTO_XT_ACTIONS_ARGS;
extern void HandleWriteError PROTO_XT_ACTIONS_ARGS;
extern void HandleWriteNow PROTO_XT_ACTIONS_ARGS;
extern void SetupMenus (Widget /*shell*/, Widget */*forms*/, Widget */*menus*/, Dimension * /*menu_high*/);
#if OPT_TOOLBAR
extern void ShowToolbar(Bool);
#endif
/*
* The following definitions MUST match the order of entries given in
* the mainMenuEntries, vtMenuEntries, and tekMenuEntries arrays in menu.c.
*/
/*
* items in primary menu
*/
typedef enum {
#if OPT_TOOLBAR
mainMenu_toolbar,
#endif
#if OPT_MAXIMIZE
mainMenu_fullscreen,
#endif
mainMenu_securekbd,
mainMenu_allowsends,
mainMenu_redraw,
mainMenu_line1,
#ifdef ALLOWLOGGING
mainMenu_logging,
#endif
#if OPT_PRINT_ON_EXIT
mainMenu_write_now,
mainMenu_write_error,
#endif
mainMenu_print,
mainMenu_print_redir,
mainMenu_line2,
mainMenu_8bit_ctrl,
mainMenu_backarrow,
#if OPT_NUM_LOCK
mainMenu_num_lock,
mainMenu_alt_esc,
mainMenu_meta_esc,
#endif
mainMenu_delete_del,
mainMenu_old_fkeys,
#if OPT_TCAP_FKEYS
mainMenu_tcap_fkeys,
#endif
#if OPT_HP_FUNC_KEYS
mainMenu_hp_fkeys,
#endif
#if OPT_SCO_FUNC_KEYS
mainMenu_sco_fkeys,
#endif
#if OPT_SUN_FUNC_KEYS
mainMenu_sun_fkeys,
#endif
#if OPT_SUNPC_KBD
mainMenu_sun_kbd,
#endif
mainMenu_line3,
mainMenu_suspend,
mainMenu_continue,
mainMenu_interrupt,
mainMenu_hangup,
mainMenu_terminate,
mainMenu_kill,
mainMenu_line4,
mainMenu_quit,
mainMenu_LAST
} mainMenuIndices;
/*
* items in vt100 mode menu
*/
typedef enum {
vtMenu_scrollbar,
vtMenu_jumpscroll,
vtMenu_reversevideo,
vtMenu_autowrap,
vtMenu_reversewrap,
vtMenu_autolinefeed,
vtMenu_appcursor,
vtMenu_appkeypad,
vtMenu_scrollkey,
vtMenu_scrollttyoutput,
vtMenu_allow132,
vtMenu_keepSelection,
vtMenu_selectToClipboard,
vtMenu_visualbell,
vtMenu_bellIsUrgent,
vtMenu_poponbell,
#if OPT_BLINK_CURS
vtMenu_cursorblink,
#endif
vtMenu_titeInhibit,
#ifndef NO_ACTIVE_ICON
vtMenu_activeicon,
#endif /* NO_ACTIVE_ICON */
vtMenu_line1,
vtMenu_softreset,
vtMenu_hardreset,
vtMenu_clearsavedlines,
vtMenu_line2,
#if OPT_TEK4014
vtMenu_tekshow,
vtMenu_tekmode,
vtMenu_vthide,
#endif
vtMenu_altscreen,
#if OPT_SIXEL_GRAPHICS
vtMenu_sixelscrolling,
vtMenu_privatecolorregisters,
#endif
vtMenu_LAST
} vtMenuIndices;
/*
* items in vt100 font menu
*/
typedef enum {
fontMenu_default,
fontMenu_font1,
fontMenu_font2,
fontMenu_font3,
fontMenu_font4,
fontMenu_font5,
fontMenu_font6,
#define fontMenu_lastBuiltin fontMenu_font6
fontMenu_fontescape,
fontMenu_fontsel,
/* number of non-line items down to here should match NMENUFONTS in ptyx.h */
#if OPT_DEC_CHRSET || OPT_BOX_CHARS || OPT_DEC_SOFTFONT
fontMenu_line1,
fontMenu_allowBoldFonts,
#if OPT_BOX_CHARS
fontMenu_font_boxchars,
fontMenu_font_packedfont,
#endif
#if OPT_DEC_CHRSET
fontMenu_font_doublesize,
#endif
#if OPT_DEC_SOFTFONT
fontMenu_font_loadable,
#endif
#endif
#if OPT_RENDERFONT || OPT_WIDE_CHARS
fontMenu_line2,
#if OPT_RENDERFONT
fontMenu_render_font,
#endif
#if OPT_WIDE_CHARS
fontMenu_utf8_mode,
fontMenu_utf8_fonts,
fontMenu_utf8_title,
#endif
#endif
#if OPT_ALLOW_XXX_OPS
fontMenu_line3,
fontMenu_allowColorOps,
fontMenu_allowFontOps,
fontMenu_allowTcapOps,
fontMenu_allowTitleOps,
fontMenu_allowWindowOps,
#endif
fontMenu_LAST
} fontMenuIndices;
/*
* items in tek4014 mode menu
*/
#if OPT_TEK4014
typedef enum {
tekMenu_tektextlarge,
tekMenu_tektext2,
tekMenu_tektext3,
tekMenu_tektextsmall,
tekMenu_line1,
tekMenu_tekpage,
tekMenu_tekreset,
tekMenu_tekcopy,
tekMenu_line2,
tekMenu_vtshow,
tekMenu_vtmode,
tekMenu_tekhide,
tekMenu_LAST
} tekMenuIndices;
#endif
/*
* functions for updating menus
*/
extern void SetItemSensitivity(Widget mi, Bool val);
typedef enum {
toggleErr = -2,
toggleAll = -1,
toggleOff = 0,
toggleOn = 1
} ToggleEnum;
extern int decodeToggle(XtermWidget /* xw */, String * /* params */, Cardinal /* nparams */);
/*
* there should be one of each of the following for each checkable item
*/
#if OPT_TOOLBAR
extern void update_toolbar(void);
#else
#define update_toolbar() /* nothing */
#endif
#if OPT_MAXIMIZE
extern void update_fullscreen(void);
#else
#define update_fullscreen() /* nothing */
#endif
extern void update_securekbd(void);
extern void update_allowsends(void);
#ifdef ALLOWLOGGING
extern void update_logging(void);
#else
#define update_logging() /*nothing*/
#endif
#if OPT_PRINT_ON_EXIT
extern void update_write_error(void);
#else
#define update_write_error() /*nothing*/
#endif
extern void update_print_redir(void);
extern void update_8bit_control(void);
extern void update_decbkm(void);
#if OPT_NUM_LOCK
extern void update_num_lock(void);
extern void update_alt_esc(void);
extern void update_meta_esc(void);
#else
#define update_num_lock() /*nothing*/
#define update_alt_esc() /*nothing*/
#define update_meta_esc() /*nothing*/
#endif
extern void update_old_fkeys(void);
extern void update_delete_del(void);
#if OPT_SUNPC_KBD
extern void update_sun_kbd(void);
#endif
#if OPT_HP_FUNC_KEYS
extern void update_hp_fkeys(void);
#else
#define update_hp_fkeys() /*nothing*/
#endif
#if OPT_SCO_FUNC_KEYS
extern void update_sco_fkeys(void);
#else
#define update_sco_fkeys() /*nothing*/
#endif
#if OPT_SUN_FUNC_KEYS
extern void update_sun_fkeys(void);
#else
#define update_sun_fkeys() /*nothing*/
#endif
#if OPT_TCAP_FKEYS
extern void update_tcap_fkeys(void);
#else
#define update_tcap_fkeys() /*nothing*/
#endif
extern void update_scrollbar(void);
extern void update_jumpscroll(void);
extern void update_reversevideo(void);
extern void update_autowrap(void);
extern void update_reversewrap(void);
extern void update_autolinefeed(void);
extern void update_appcursor(void);
extern void update_appkeypad(void);
extern void update_scrollkey(void);
extern void update_keepSelection(void);
extern void update_selectToClipboard(void);
extern void update_scrollttyoutput(void);
extern void update_allow132(void);
extern void update_cursesemul(void);
extern void update_visualbell(void);
extern void update_bellIsUrgent(void);
extern void update_poponbell(void);
#define update_marginbell() /* nothing */
#if OPT_ALLOW_XXX_OPS
extern void update_menu_allowColorOps(void);
extern void update_menu_allowFontOps(void);
extern void update_menu_allowTcapOps(void);
extern void update_menu_allowTitleOps(void);
extern void update_menu_allowWindowOps(void);
#endif
#if OPT_BLINK_CURS
extern void update_cursorblink(void);
#else
#define update_cursorblink() /* nothing */
#endif
extern void update_altscreen(void);
extern void update_titeInhibit(void);
#ifndef NO_ACTIVE_ICON
extern void update_activeicon(void);
#endif /* NO_ACTIVE_ICON */
#if OPT_DEC_CHRSET
extern void update_font_doublesize(void);
#else
#define update_font_doublesize() /* nothing */
#endif
#if OPT_BOX_CHARS
extern void update_font_boxchars(void);
extern void update_font_packed(void);
#else
#define update_font_boxchars() /* nothing */
#define update_font_packed() /* nothing */
#endif
#if OPT_SIXEL_GRAPHICS
extern void update_decsdm(void);
extern void update_privatecolorregisters(void);
#else
#define update_decsdm() /* nothing */
#define update_privatecolorregisters() /* nothing */
#endif
#if OPT_DEC_SOFTFONT
extern void update_font_loadable(void);
#else
#define update_font_loadable() /* nothing */
#endif
#if OPT_RENDERFONT
extern void update_font_renderfont(void);
#else
#define update_font_renderfont() /* nothing */
#endif
#if OPT_WIDE_CHARS
extern void update_font_utf8_mode(void);
extern void update_font_utf8_fonts(void);
extern void update_font_utf8_title(void);
#else
#define update_font_utf8_mode() /* nothing */
#define update_font_utf8_fonts() /* nothing */
#define update_font_utf8_title() /* nothing */
#endif
#if OPT_TEK4014
extern void update_tekshow(void);
extern void update_vttekmode(void);
extern void update_vtshow(void);
extern void set_vthide_sensitivity(void);
extern void set_tekhide_sensitivity(void);
#else
#define update_tekshow() /*nothing*/
#define update_vttekmode() /*nothing*/
#define update_vtshow() /*nothing*/
#define set_vthide_sensitivity() /*nothing*/
#define set_tekhide_sensitivity() /*nothing*/
#endif
#if OPT_DEC_CHRSET || OPT_BOX_CHARS || OPT_DEC_SOFTFONT
extern void update_menu_allowBoldFonts(void);
#else
#define update_menu_allowBoldFonts() /*nothing*/
#endif
/*
* macros for mapping font size to tekMenu placement
*/
#define FS2MI(n) (n) /* font_size_to_menu_item */
#define MI2FS(n) (n) /* menu_item_to_font_size */
#if OPT_TEK4014
extern void set_tekfont_menu_item(int n,int val);
#else
#define set_tekfont_menu_item(n,val) /*nothing*/
#endif
extern void set_menu_font(int val);
/* *INDENT-ON* */
#endif /* included_menu_h */
xterm-297/termcap 0000644 0001751 0000144 00000024147 11765127615 012654 0 ustar tom users # $XTermId: termcap,v 1.80 2012/06/10 14:30:37 tom Exp $
#
# These are termcap entries that correspond to xterm's terminfo file.
# The file is formatted using ncurses' "tic -CNx", but is not mechanically
# derived from the terminfo.
#
#------------------------------------------------------------------------------
# Copyright 1996-2011,2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
#------------------------------------------------------------------------------
#
# Note:
# termcap format is limited to 1023 characters. This set of descriptions
# is a subset of the terminfo, since not all features can be fit into
# that limit. The 'xterm' description supports color. The monochrome
# 'xterm-mono' drops color in favor of additional function keys. If you
# need both, use terminfo.
#
# The 1023-character limit applies to each entry after resolving the
# "tc=" strings. Some implementations may discount all or part of the
# formatting characters in the entry (i.e., the backslash newline tab
# colon). GNU termcap does not have this limit.
#
# I checked the limits using ncurses "captoinfo -CrTUvx", which prints
# the resolved length of each entry in a comment at the end - T.Dickey
#
xf|xterm-new|modern xterm:\
:*6=\EOF:@7=\EOF:F1=\E[23~:F2=\E[24~:K2=\EOE:Km=\E[M:\
:k1=\EOP:k2=\EOQ:k3=\EOR:k4=\EOS:k5=\E[15~:k6=\E[17~:\
:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:kB=\E[Z:kH=\EOF:\
:kI=\E[2~:kN=\E[6~:kP=\E[5~:kd=\EOB:kh=\EOH:kl=\EOD:\
:kr=\EOC:ku=\EOA:tc=xterm-basic:
#
# This chunk is used for building the VT220/Sun/PC keyboard variants.
xb|xterm-basic|modern xterm common:\
:am:bs:km:mi:ms:ut:xn:AX:\
:Co#8:co#80:kn#12:li#24:pa#64:\
:AB=\E[4%dm:AF=\E[3%dm:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\
:DO=\E[%dB:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=\E(B:al=\E[L:\
:as=\E(0:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\
:ei=\E[4l:ho=\E[H:im=\E[4h:is=\E[!p\E[?3;4l\E[4l\E>:\
:kD=\E[3~:ke=\E[?1l\E>:ks=\E[?1h\E=:le=^H:md=\E[1m:\
:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:op=\E[39;49m:\
:rc=\E8:rs=\E[!p\E[?3;4l\E[4l\E>:sc=\E7:se=\E[27m:sf=^J:\
:so=\E[7m:sr=\EM:st=\EH:te=\E[?1049l:ti=\E[?1049h:\
:ue=\E[24m:up=\E[A:us=\E[4m:ve=\E[?12l\E[?25h:vi=\E[?25l:\
:vs=\E[?12;25h:tc=xterm+kbs:
# The xterm-new description has all of the features, but is not completely
# compatible with vt220. If you are using a Sun or PC keyboard, set the
# sunKeyboard resource to true:
# + maps the editing keypad
# + interprets control-function-key as a second array of keys, so a
# 12-fkey keyboard can support vt220's 20-fkeys.
# + maps numeric keypad "+" to ",".
# + uses DEC-style control sequences for the application keypad.
#
vt|xterm-vt220|xterm emulating vt220:\
:*6=\E[4~:@7=\E[4~:K2=\EOu:Km=\E[M:kB=\E[Z:kH=\E[4~:\
:kh=\E[1~:tc=xterm-basic:
v1|xterm-24|xterms|vs100|24x80 xterm:\
:li#24:tc=xterm-old:
v2|xterm-65|65x80 xterm:\
:li#65:tc=xterm-old:
vb|xterm-bold|xterm with bold for underline:\
:so=\E[7m:us=\E[1m:tc=xterm-old:
vB|xterm-boldso|xterm with bold for standout:\
:se=\E[m:so=\E[1m:tc=xterm-old:
vm|xterm-mono|monochrome xterm:\
:ut@:\
:Co@:NC@:kn#20:pa@:\
:AB@:AF@:Sb@:Sf@:op@:st@:tc=xterm-old:
#
# Alternate terminal description that "works" for interactive shells such as
# tcsh and bash.
xn|xterm-noapp|xterm with cursor keys in normal mode:\
:kd=\E[B:ke=\E>:kl=\E[D:kr=\E[C:ks=\E=:ku=\E[A:te@:ti@:\
:tc=xterm:
#
# This should work for the commonly used "color xterm" variations (XFree86
# xterm, color_xterm, nxterm, rxvt). Note that it does not set 'bce', so for
# XFree86 and rxvt, some applications that use colors will be less efficient,
# and in a few special cases (with "smart" optimization) the wrong color will
# be painted in spots.
vc|xterm-color|generic "ANSI" color xterm:\
:Co#8:NC@:pa#64:\
:AB=\E[4%dm:AF=\E[3%dm:ac=:op=\E[m:tc=xterm-r6:
#
# These aliases are for compatibility with the terminfo; termcap cannot provide
# the extra features such as color initialization, but termcap applications
# still want the names.
x1|xterm-16color|xterm alias:\
:tc=xterm-new:
x2|xterm-88color|xterm alias:\
:Co#88:pa#7744:tc=xterm-256color:
x3|xterm-256color|xterm alias:\
:Co#256:pa#32767:\
:AB=\E[48;5;%dm:AF=\E[38;5;%dm:tc=xterm-new:
xi|xterm-nrc|xterm alias:\
:tc=xterm:
xr|xterm-rep|xterm alias:\
:tc=xterm:
xx|xterm-xmc|xterm alias:\
:sg#1:tc=xterm:
#
# An 8-bit description is doable with termcap, but there are probably no
# termcap (or BSD curses) applications that are able to use it.
x8|xterm-8bit|xterm terminal emulator 8-bit controls (X Window System):\
:am:km:mi:ms:xn:\
:co#80:it#8:li#24:\
:AL=\233%dL:DC=\233%dP:DL=\233%dM:DO=\233%dB:IC=\233%d@:\
:K2=\217y:Km=\233M:LE=\233%dD:RI=\233%dC:UP=\233%dA:\
:ae=\E(B:al=\233L:as=\E(0:bl=^G:bt=\233Z:cd=\233J:ce=\233K:\
:cl=\233H\2332J:cm=\233%i%d;%dH:cr=^M:cs=\233%i%d;%dr:\
:ct=\2333g:dc=\233P:dl=\233M:do=^J:ei=\2334l:ho=\233H:\
:im=\2334h:\
:is=\E[62"p\E G\233m\233?7h\E>\E7\233?1;3;4;6l\2334l\233r\E8:\
:k1=\23311~:k2=\23312~:k3=\23313~:k4=\23314~:k5=\23315~:\
:k6=\23317~:k7=\23318~:k8=\23319~:k9=\23320~:kD=\2333~:\
:kI=\2332~:kN=\2336~:kP=\2335~:kd=\217B:ke=\233?1l\E>:\
:kh=\2331~:kl=\217D:kr=\217C:ks=\233?1h\E=:ku=\217A:le=^H:\
:mb=\2335m:md=\2331m:me=\233m:mr=\2337m:nd=\233C:rc=\E8:\
:sc=\E7:se=\23327m:sf=^J:so=\2337m:sr=\215:st=\210:ta=^I:\
:te=\233?1049l:ti=\233?1049h:ue=\23324m:up=\233A:\
:us=\2334m:vb=\233?5h\233?5l:ve=\233?25l\233?25h:\
:vi=\233?25l:vs=\233?12;25h:tc=xterm+kbs:
#
hp|xterm-hp|xterm with hpterm function keys:\
:@7=\EF:k1=\Ep:k2=\Eq:k3=\Er:k4=\Es:k5=\Et:k6=\Eu:k7=\Ev:\
:k8=\Ew:kC=\EJ:kD=\EP:kI=\EQ:kN=\ES:kP=\ET:kd=\EB:kh=\Eh:\
:kl=\ED:kr=\EC:ku=\EA:tc=xterm-basic:
#
xS|xterm-sco|xterm with SCO function keys:\
:@7=\E[F:F1=\E[W:F2=\E[X:F3=\E[Y:F5=\E[a:F6=\E[b:F7=\E[c:\
:F8=\E[d:F9=\E[e:FA=\E[f:FB=\E[g:FC=\E[h:FD=\E[i:FE=\E[j:\
:FF=\E[k:ac=:k1=\E[M:k2=\E[N:k3=\E[O:k4=\E[P:k5=\E[Q:\
:k6=\E[R:k7=\E[S:k8=\E[T:k9=\E[U:k;=\E[V:kD=\177:kI=\E[L:\
:kN=\E[G:kP=\E[I:kd=\E[B:kh=\E[H:kl=\E[D:kr=\E[C:ku=\E[A:\
:tc=xterm-basic:
#
v5|xterm-vt52|xterm emulating vt52:\
:bs:\
:co#80:it#8:li#24:\
:ae=\EG:as=\EF:bl=^G:cd=\EJ:ce=\EK:cl=\EH\EJ:cm=\EY%+ %+ :\
:cr=^M:do=\EB:ho=\EH:kd=\EB:kl=\ED:kr=\EC:ku=\EA:le=\ED:\
:nd=\EC:nw=^M^J:sf=^J:sr=\EI:ta=^I:up=\EA:tc=xterm+kbs:
#
xs|xterm-sun|xterm with Sun functionkeys:\
:%1=\E[196z:&8=\E[195z:@0=\E[200z:@5=\E[197z:@7=\E[220z:\
:F1=\E[192z:F2=\E[193z:K2=\E[218z:Km=\E[M:k1=\E[224z:\
:k2=\E[225z:k3=\E[226z:k4=\E[227z:k5=\E[228z:k6=\E[229z:\
:k7=\E[230z:k8=\E[231z:k9=\E[232z:k;=\E[233z:kD=\E[3z:\
:kI=\E[2z:kN=\E[222z:kP=\E[216z:kh=\E[214z:\
:tc=xterm-basic:
#
# vi may work better with this entry, because vi doesn't use insert mode much.
# |xterm-ic|xterm-vi|xterm with insert character instead of insert mode:\
vi|xterm-ic|xterm-vi|xterm with insert char:\
:mi@:\
:IC=\E[%d@:ei@:ic=\E[@:im@:tc=xterm:
#
# Compatible with the X11R6.3 xterm
r6|xterm-r6|xterm-old|X11R6 xterm:\
:am:bs:km:mi:ms:pt:xn:\
:co#80:kn#20:li#24:\
:*6=\E[4~:@0=\E[1~:@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:\
:DO=\E[%dB:F1=\E[23~:F2=\E[24~:F3=\E[25~:F4=\E[26~:\
:F5=\E[28~:F6=\E[29~:F7=\E[31~:F8=\E[32~:F9=\E[33~:\
:FA=\E[34~:LE=\E[%dD:RI=\E[%dC:UP=\E[%dA:ae=^O:al=\E[L:\
:as=^N:bl=^G:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:cm=\E[%i%d;%dH:\
:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:eA=\E)0:ei=\E[4l:\
:ho=\E[H:im=\E[4h:\
:is=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:\
:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:k5=\E[15~:\
:k6=\E[17~:k7=\E[18~:k8=\E[19~:k9=\E[20~:k;=\E[21~:\
:kD=\E[3~:kI=\E[2~:kN=\E[6~:kP=\E[5~:kd=\EOB:ke=\E[?1l\E>:\
:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:ku=\EOA:md=\E[1m:\
:me=\E[m:ml=\El:mr=\E[7m:mu=\Em:nd=\E[C:rc=\E8:\
:rs=\E[m\E[?7h\E[4l\E>\E7\E[r\E[?1;3;4;6l\E8:sc=\E7:\
:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\
:ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m:tc=xterm+kbs:
#
# Compatible with the R5 xterm
r5|xterm-r5|X11R5 xterm X11R5:\
:am:bs:km:mi:ms:pt:xn:\
:co#80:kn#4:li#24:\
:@7=\E[4~:AL=\E[%dL:DC=\E[%dP:DL=\E[%dM:DO=\E[%dB:\
:IC=\E[%d@:UP=\E[%dA:al=\E[L:cd=\E[J:ce=\E[K:cl=\E[H\E[2J:\
:cm=\E[%i%d;%dH:cs=\E[%i%d;%dr:ct=\E[3g:dc=\E[P:dl=\E[M:\
:ei=\E[4l:ho=\E[H:im=\E[4h:\
:is=\E[r\E[m\E[2J\E[H\E[?7h\E[?1;3;4;6l\E[4l:\
:k1=\E[11~:k2=\E[12~:k3=\E[13~:k4=\E[14~:kd=\EOB:\
:ke=\E[?1l\E>:kh=\E[1~:kl=\EOD:kr=\EOC:ks=\E[?1h\E=:\
:ku=\EOA:md=\E[1m:me=\E[m:mr=\E[7m:nd=\E[C:rc=\E8:\
:rs=\E>\E[?1;3;4;5;6l\E[4l\E[?7h\E[m\E[r\E[2J\E[H:\
:sc=\E7:se=\E[m:sf=^J:so=\E[7m:sr=\EM:te=\E[2J\E[?47l\E8:\
:ti=\E7\E[?47h:ue=\E[m:up=\E[A:us=\E[4m:tc=xterm+kbs:
#
# Customization begins here.
x0|xterm-xfree86|xterm terminal emulator (XFree86):\
:tc=xterm-new:
#
# This is the only entry which you should have to customize, since "xterm"
# is widely used for a variety of incompatible terminal emulations including
# color_xterm and rxvt.
v0|xterm|X11 terminal emulator:\
:tc=xterm-new:
# :tc=xterm-r6:
# This fragment is for people who cannot agree on what the backspace key
# should send.
xterm+kbs|fragment for backspace key:\
:kb=^H:
xterm-297/charproc.c 0000644 0001751 0000144 00001071610 12213653227 013231 0 ustar tom users /* $XTermId: charproc.c,v 1.1315 2013/09/10 17:27:51 tom Exp $ */
/*
* Copyright 1999-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*
*
* Copyright 1988 The Open Group
*
* Permission to use, copy, modify, distribute, and sell this software and its
* documentation for any purpose is hereby granted without fee, provided that
* the above copyright notice appear in all copies and that both that
* copyright notice and this permission notice appear in supporting
* documentation.
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name of The Open Group shall not be
* used in advertising or otherwise to promote the sale, use or other dealings
* in this Software without prior written authorization from The Open Group.
*
*/
/*
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
*
* All Rights Reserved
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Digital Equipment
* Corporation not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior permission.
*
*
* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
/* charproc.c */
#include
#include
#include
#include
#include
#include
#include
#include
#if OPT_INPUT_METHOD
#if defined(HAVE_LIB_XAW)
#include
#elif defined(HAVE_LIB_XAW3D)
#include
#elif defined(HAVE_LIB_NEXTAW)
#include
#elif defined(HAVE_LIB_XAWPLUS)
#include
#endif
#endif
#if OPT_DOUBLE_BUFFER
#include
#endif
#if OPT_WIDE_CHARS
#include
#include
#include
#ifdef HAVE_LANGINFO_CODESET
#include
#endif
#endif
#if OPT_INPUT_METHOD
#include
#endif
#include
#include
#include
#if defined(HAVE_SCHED_YIELD)
#include
#endif
#include
#include
#include
#include
#include
#include
#include
#include
#include
typedef int (*BitFunc) (unsigned * /* p */ ,
unsigned /* mask */ );
static IChar doinput(void);
static int set_character_class(char * /*s */ );
static void FromAlternate(XtermWidget /* xw */ );
static void ReallyReset(XtermWidget /* xw */ ,
Bool /* full */ ,
Bool /* saved */ );
static void RequestResize(XtermWidget /* xw */ ,
int /* rows */ ,
int /* cols */ ,
Bool /* text */ );
static void SwitchBufs(XtermWidget /* xw */ ,
int /* toBuf */ ,
Bool /* clearFirst */ );
static void ToAlternate(XtermWidget /* xw */ ,
Bool /* clearFirst */ );
static void ansi_modes(XtermWidget termw,
BitFunc /* func */ );
static int bitclr(unsigned *p, unsigned mask);
static int bitcpy(unsigned *p, unsigned q, unsigned mask);
static int bitset(unsigned *p, unsigned mask);
static void dpmodes(XtermWidget /* xw */ ,
BitFunc /* func */ );
static void restoremodes(XtermWidget /* xw */ );
static void savemodes(XtermWidget /* xw */ );
static void window_ops(XtermWidget /* xw */ );
#define DoStartBlinking(s) ((s)->cursor_blink ^ (s)->cursor_blink_esc)
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
#define UpdateCursorBlink(screen) SetCursorBlink(screen, screen->cursor_blink)
static void SetCursorBlink(TScreen * /* screen */ ,
Bool /* enable */ );
static void HandleBlinking(XtPointer /* closure */ ,
XtIntervalId * /* id */ );
static void StartBlinking(TScreen * /* screen */ );
static void StopBlinking(TScreen * /* screen */ );
#else
#define StartBlinking(screen) /* nothing */
#define StopBlinking(screen) /* nothing */
#endif
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
static void PreeditPosition(XtermWidget /* xw */ );
#endif
#define DEFAULT -1
#define BELLSUPPRESSMSEC 200
static ANSI reply;
static PARAMS parms;
#define nparam parms.count
#define InitParams() parms.count = parms.is_sub[0] = parms.has_subparams = 0
#define GetParam(n) parms.params[(n)]
#define SetParam(n,v) parms.params[(n)] = v
#define ParamPair(n) nparam - (n), parms.params + (n)
#define ParamsDone() InitParams()
static jmp_buf vtjmpbuf;
/* event handlers */
static void HandleBell PROTO_XT_ACTIONS_ARGS;
static void HandleIgnore PROTO_XT_ACTIONS_ARGS;
static void HandleKeymapChange PROTO_XT_ACTIONS_ARGS;
static void HandleVisualBell PROTO_XT_ACTIONS_ARGS;
#if HANDLE_STRUCT_NOTIFY
static void HandleStructNotify PROTO_XT_EV_HANDLER_ARGS;
#endif
/*
* NOTE: VTInitialize zeros out the entire ".screen" component of the
* XtermWidget, so make sure to add an assignment statement in VTInitialize()
* for each new ".screen" field added to this resource list.
*/
/* Defaults */
#if OPT_ISO_COLORS
/*
* If we default to colorMode enabled, compile-in defaults for the ANSI colors.
*/
#if DFT_COLORMODE
#define DFT_COLOR(name) name
#else
#define DFT_COLOR(name) XtDefaultForeground
#endif
#endif
static String _Font_Selected_ = "yes"; /* string is arbitrary */
static const char *defaultTranslations;
/* *INDENT-OFF* */
static XtActionsRec actionsList[] = {
{ "allow-send-events", HandleAllowSends },
{ "bell", HandleBell },
{ "clear-saved-lines", HandleClearSavedLines },
{ "copy-selection", HandleCopySelection },
{ "create-menu", HandleCreateMenu },
{ "delete-is-del", HandleDeleteIsDEL },
{ "dired-button", DiredButton },
{ "hard-reset", HandleHardReset },
{ "ignore", HandleIgnore },
{ "insert", HandleKeyPressed }, /* alias for insert-seven-bit */
{ "insert-eight-bit", HandleEightBitKeyPressed },
{ "insert-selection", HandleInsertSelection },
{ "insert-seven-bit", HandleKeyPressed },
{ "interpret", HandleInterpret },
{ "keymap", HandleKeymapChange },
{ "popup-menu", HandlePopupMenu },
{ "print", HandlePrintScreen },
{ "print-everything", HandlePrintEverything },
{ "print-redir", HandlePrintControlMode },
{ "quit", HandleQuit },
{ "redraw", HandleRedraw },
{ "scroll-back", HandleScrollBack },
{ "scroll-forw", HandleScrollForward },
{ "secure", HandleSecure },
{ "select-cursor-end", HandleKeyboardSelectEnd },
{ "select-cursor-extend", HandleKeyboardSelectExtend },
{ "select-cursor-start", HandleKeyboardSelectStart },
{ "select-end", HandleSelectEnd },
{ "select-extend", HandleSelectExtend },
{ "select-set", HandleSelectSet },
{ "select-start", HandleSelectStart },
{ "send-signal", HandleSendSignal },
{ "set-8-bit-control", Handle8BitControl },
{ "set-allow132", HandleAllow132 },
{ "set-altscreen", HandleAltScreen },
{ "set-appcursor", HandleAppCursor },
{ "set-appkeypad", HandleAppKeypad },
{ "set-autolinefeed", HandleAutoLineFeed },
{ "set-autowrap", HandleAutoWrap },
{ "set-backarrow", HandleBackarrow },
{ "set-bellIsUrgent", HandleBellIsUrgent },
{ "set-cursesemul", HandleCursesEmul },
{ "set-jumpscroll", HandleJumpscroll },
{ "set-keep-selection", HandleKeepSelection },
{ "set-marginbell", HandleMarginBell },
{ "set-old-function-keys", HandleOldFunctionKeys },
{ "set-pop-on-bell", HandleSetPopOnBell },
{ "set-reverse-video", HandleReverseVideo },
{ "set-reversewrap", HandleReverseWrap },
{ "set-scroll-on-key", HandleScrollKey },
{ "set-scroll-on-tty-output", HandleScrollTtyOutput },
{ "set-scrollbar", HandleScrollbar },
{ "set-select", HandleSetSelect },
{ "set-sun-keyboard", HandleSunKeyboard },
{ "set-titeInhibit", HandleTiteInhibit },
{ "set-visual-bell", HandleSetVisualBell },
{ "set-vt-font", HandleSetFont },
{ "soft-reset", HandleSoftReset },
{ "start-cursor-extend", HandleKeyboardStartExtend },
{ "start-extend", HandleStartExtend },
{ "string", HandleStringEvent },
{ "vi-button", ViButton },
{ "visual-bell", HandleVisualBell },
#ifdef ALLOWLOGGING
{ "set-logging", HandleLogging },
#endif
#if OPT_ALLOW_XXX_OPS
{ "allow-color-ops", HandleAllowColorOps },
{ "allow-font-ops", HandleAllowFontOps },
{ "allow-tcap-ops", HandleAllowTcapOps },
{ "allow-title-ops", HandleAllowTitleOps },
{ "allow-window-ops", HandleAllowWindowOps },
#endif
#if OPT_BLINK_CURS
{ "set-cursorblink", HandleCursorBlink },
#endif
#if OPT_BOX_CHARS
{ "set-font-linedrawing", HandleFontBoxChars },
{ "set-font-packed", HandleFontPacked },
#endif
#if OPT_DABBREV
{ "dabbrev-expand", HandleDabbrevExpand },
#endif
#if OPT_DEC_CHRSET
{ "set-font-doublesize", HandleFontDoublesize },
#endif
#if OPT_DEC_SOFTFONT
{ "set-font-loading", HandleFontLoading },
#endif
#if OPT_EXEC_XTERM
{ "spawn-new-terminal", HandleSpawnTerminal },
#endif
#if OPT_HP_FUNC_KEYS
{ "set-hp-function-keys", HandleHpFunctionKeys },
#endif
#if OPT_LOAD_VTFONTS
{ "load-vt-fonts", HandleLoadVTFonts },
#endif
#if OPT_MAXIMIZE
{ "deiconify", HandleDeIconify },
{ "fullscreen", HandleFullscreen },
{ "iconify", HandleIconify },
{ "maximize", HandleMaximize },
{ "restore", HandleRestoreSize },
#endif
#if OPT_NUM_LOCK
{ "alt-sends-escape", HandleAltEsc },
{ "meta-sends-escape", HandleMetaEsc },
{ "set-num-lock", HandleNumLock },
#endif
#if OPT_READLINE
{ "readline-button", ReadLineButton },
#endif
#if OPT_RENDERFONT
{ "set-render-font", HandleRenderFont },
#endif
#if OPT_SCO_FUNC_KEYS
{ "set-sco-function-keys", HandleScoFunctionKeys },
#endif
#if OPT_SCROLL_LOCK
{ "scroll-lock", HandleScrollLock },
#endif
#if OPT_SELECTION_OPS
{ "exec-formatted", HandleExecFormatted },
{ "exec-selectable", HandleExecSelectable },
{ "insert-formatted", HandleInsertFormatted },
{ "insert-selectable", HandleInsertSelectable },
#endif
#if OPT_SHIFT_FONTS
{ "larger-vt-font", HandleLargerFont },
{ "smaller-vt-font", HandleSmallerFont },
#endif
#if OPT_SIXEL_GRAPHICS
{ "set-private-colors", HandleSetPrivateColorRegisters },
{ "set-sixel-scrolling", HandleSixelScrolling },
#endif
#if OPT_SUN_FUNC_KEYS
{ "set-sun-function-keys", HandleSunFunctionKeys },
#endif
#if OPT_TEK4014
{ "set-terminal-type", HandleSetTerminalType },
{ "set-visibility", HandleVisibility },
{ "set-tek-text", HandleSetTekText },
{ "tek-page", HandleTekPage },
{ "tek-reset", HandleTekReset },
{ "tek-copy", HandleTekCopy },
#endif
#if OPT_TOOLBAR
{ "set-toolbar", HandleToolbar },
#endif
#if OPT_WIDE_CHARS
{ "set-utf8-mode", HandleUTF8Mode },
{ "set-utf8-fonts", HandleUTF8Fonts },
{ "set-utf8-title", HandleUTF8Title },
#endif
};
/* *INDENT-ON* */
#define SPS screen.printer_state
static XtResource xterm_resources[] =
{
Bres(XtNallowPasteControls, XtCAllowPasteControls,
screen.allowPasteControls, False),
Bres(XtNallowSendEvents, XtCAllowSendEvents, screen.allowSendEvent0, False),
Bres(XtNallowColorOps, XtCAllowColorOps, screen.allowColorOp0, DEF_ALLOW_COLOR),
Bres(XtNallowFontOps, XtCAllowFontOps, screen.allowFontOp0, DEF_ALLOW_FONT),
Bres(XtNallowTcapOps, XtCAllowTcapOps, screen.allowTcapOp0, DEF_ALLOW_TCAP),
Bres(XtNallowTitleOps, XtCAllowTitleOps, screen.allowTitleOp0, DEF_ALLOW_TITLE),
Bres(XtNallowWindowOps, XtCAllowWindowOps, screen.allowWindowOp0, DEF_ALLOW_WINDOW),
Bres(XtNaltIsNotMeta, XtCAltIsNotMeta, screen.alt_is_not_meta, False),
Bres(XtNaltSendsEscape, XtCAltSendsEscape, screen.alt_sends_esc, DEF_ALT_SENDS_ESC),
Bres(XtNallowBoldFonts, XtCAllowBoldFonts, screen.allowBoldFonts, True),
Bres(XtNalwaysBoldMode, XtCAlwaysBoldMode, screen.always_bold_mode, False),
Bres(XtNalwaysHighlight, XtCAlwaysHighlight, screen.always_highlight, False),
Bres(XtNappcursorDefault, XtCAppcursorDefault, misc.appcursorDefault, False),
Bres(XtNappkeypadDefault, XtCAppkeypadDefault, misc.appkeypadDefault, False),
Bres(XtNalternateScroll, XtCScrollCond, screen.alternateScroll, False),
Bres(XtNautoWrap, XtCAutoWrap, misc.autoWrap, True),
Bres(XtNawaitInput, XtCAwaitInput, screen.awaitInput, False),
Bres(XtNfreeBoldBox, XtCFreeBoldBox, screen.free_bold_box, False),
Bres(XtNbackarrowKey, XtCBackarrowKey, screen.backarrow_key, DEF_BACKARO_BS),
Bres(XtNbellIsUrgent, XtCBellIsUrgent, screen.bellIsUrgent, False),
Bres(XtNbellOnReset, XtCBellOnReset, screen.bellOnReset, True),
Bres(XtNboldMode, XtCBoldMode, screen.bold_mode, True),
Bres(XtNbrokenSelections, XtCBrokenSelections, screen.brokenSelections, False),
Bres(XtNc132, XtCC132, screen.c132, False),
Bres(XtNcdXtraScroll, XtCCdXtraScroll, misc.cdXtraScroll, False),
Bres(XtNcurses, XtCCurses, screen.curses, False),
Bres(XtNcutNewline, XtCCutNewline, screen.cutNewline, True),
Bres(XtNcutToBeginningOfLine, XtCCutToBeginningOfLine,
screen.cutToBeginningOfLine, True),
Bres(XtNdeleteIsDEL, XtCDeleteIsDEL, screen.delete_is_del, DEFDELETE_DEL),
Bres(XtNdynamicColors, XtCDynamicColors, misc.dynamicColors, True),
Bres(XtNeightBitControl, XtCEightBitControl, screen.control_eight_bits, False),
Bres(XtNeightBitInput, XtCEightBitInput, screen.input_eight_bits, True),
Bres(XtNeightBitOutput, XtCEightBitOutput, screen.output_eight_bits, True),
Bres(XtNhighlightSelection, XtCHighlightSelection,
screen.highlight_selection, False),
Bres(XtNshowWrapMarks, XtCShowWrapMarks, screen.show_wrap_marks, False),
Bres(XtNhpLowerleftBugCompat, XtCHpLowerleftBugCompat, screen.hp_ll_bc, False),
Bres(XtNi18nSelections, XtCI18nSelections, screen.i18nSelections, True),
Bres(XtNfastScroll, XtCFastScroll, screen.fastscroll, False),
Bres(XtNjumpScroll, XtCJumpScroll, screen.jumpscroll, True),
Bres(XtNkeepSelection, XtCKeepSelection, screen.keepSelection, True),
Bres(XtNloginShell, XtCLoginShell, misc.login_shell, False),
Bres(XtNmarginBell, XtCMarginBell, screen.marginbell, False),
Bres(XtNmetaSendsEscape, XtCMetaSendsEscape, screen.meta_sends_esc, DEF_META_SENDS_ESC),
Bres(XtNmultiScroll, XtCMultiScroll, screen.multiscroll, False),
Bres(XtNoldXtermFKeys, XtCOldXtermFKeys, screen.old_fkeys, False),
Bres(XtNpopOnBell, XtCPopOnBell, screen.poponbell, False),
Bres(XtNprinterAutoClose, XtCPrinterAutoClose, SPS.printer_autoclose, False),
Bres(XtNprinterExtent, XtCPrinterExtent, SPS.printer_extent, False),
Bres(XtNprinterFormFeed, XtCPrinterFormFeed, SPS.printer_formfeed, False),
Bres(XtNprinterNewLine, XtCPrinterNewLine, SPS.printer_newline, True),
Bres(XtNquietGrab, XtCQuietGrab, screen.quiet_grab, False),
Bres(XtNreverseVideo, XtCReverseVideo, misc.re_verse, False),
Bres(XtNreverseWrap, XtCReverseWrap, misc.reverseWrap, False),
Bres(XtNscrollBar, XtCScrollBar, misc.scrollbar, False),
Bres(XtNscrollKey, XtCScrollCond, screen.scrollkey, False),
Bres(XtNscrollTtyOutput, XtCScrollCond, screen.scrollttyoutput, True),
Bres(XtNselectToClipboard, XtCSelectToClipboard,
screen.selectToClipboard, False),
Bres(XtNsignalInhibit, XtCSignalInhibit, misc.signalInhibit, False),
Bres(XtNtiteInhibit, XtCTiteInhibit, misc.titeInhibit, False),
Bres(XtNtiXtraScroll, XtCTiXtraScroll, misc.tiXtraScroll, False),
Bres(XtNtrimSelection, XtCTrimSelection, screen.trim_selection, False),
Bres(XtNunderLine, XtCUnderLine, screen.underline, True),
Bres(XtNvisualBell, XtCVisualBell, screen.visualbell, False),
Bres(XtNvisualBellLine, XtCVisualBellLine, screen.flash_line, False),
Dres(XtNscaleHeight, XtCScaleHeight, screen.scale_height, "1.0"),
Ires(XtNbellSuppressTime, XtCBellSuppressTime, screen.bellSuppressTime, BELLSUPPRESSMSEC),
Ires(XtNfontWarnings, XtCFontWarnings, misc.fontWarnings, fwResource),
Ires(XtNinternalBorder, XtCBorderWidth, screen.border, DEFBORDER),
Ires(XtNlimitResize, XtCLimitResize, misc.limit_resize, 1),
Ires(XtNmultiClickTime, XtCMultiClickTime, screen.multiClickTime, MULTICLICKTIME),
Ires(XtNnMarginBell, XtCColumn, screen.nmarginbell, N_MARGINBELL),
Ires(XtNpointerMode, XtCPointerMode, screen.pointer_mode, DEF_POINTER_MODE),
Ires(XtNprinterControlMode, XtCPrinterControlMode,
SPS.printer_controlmode, 0),
Ires(XtNtitleModes, XtCTitleModes, screen.title_modes, DEF_TITLE_MODES),
Ires(XtNvisualBellDelay, XtCVisualBellDelay, screen.visualBellDelay, 100),
Ires(XtNsaveLines, XtCSaveLines, screen.savelines, SAVELINES),
Ires(XtNscrollBarBorder, XtCScrollBarBorder, screen.scrollBarBorder, 1),
Ires(XtNscrollLines, XtCScrollLines, screen.scrolllines, SCROLLLINES),
Sres(XtNinitialFont, XtCInitialFont, screen.initial_font, NULL),
Sres(XtNfont1, XtCFont1, screen.MenuFontName(fontMenu_font1), NULL),
Sres(XtNfont2, XtCFont2, screen.MenuFontName(fontMenu_font2), NULL),
Sres(XtNfont3, XtCFont3, screen.MenuFontName(fontMenu_font3), NULL),
Sres(XtNfont4, XtCFont4, screen.MenuFontName(fontMenu_font4), NULL),
Sres(XtNfont5, XtCFont5, screen.MenuFontName(fontMenu_font5), NULL),
Sres(XtNfont6, XtCFont6, screen.MenuFontName(fontMenu_font6), NULL),
Sres(XtNanswerbackString, XtCAnswerbackString, screen.answer_back, ""),
Sres(XtNboldFont, XtCBoldFont, misc.default_font.f_b, DEFBOLDFONT),
Sres(XtNcharClass, XtCCharClass, screen.charClass, NULL),
Sres(XtNdecTerminalID, XtCDecTerminalID, screen.term_id, DFT_DECID),
Sres(XtNdefaultString, XtCDefaultString, screen.default_string, "#"),
Sres(XtNdisallowedColorOps, XtCDisallowedColorOps,
screen.disallowedColorOps, DEF_DISALLOWED_COLOR),
Sres(XtNdisallowedFontOps, XtCDisallowedFontOps,
screen.disallowedFontOps, DEF_DISALLOWED_FONT),
Sres(XtNdisallowedTcapOps, XtCDisallowedTcapOps,
screen.disallowedTcapOps, DEF_DISALLOWED_TCAP),
Sres(XtNdisallowedWindowOps, XtCDisallowedWindowOps,
screen.disallowedWinOps, DEF_DISALLOWED_WINDOW),
Sres(XtNeightBitMeta, XtCEightBitMeta, screen.eight_bit_meta_s, DEF_8BIT_META),
Sres(XtNeightBitSelectTypes, XtCEightBitSelectTypes,
screen.eightbit_select_types, NULL),
Sres(XtNfont, XtCFont, misc.default_font.f_n, DEFFONT),
Sres(XtNgeometry, XtCGeometry, misc.geo_metry, NULL),
Sres(XtNkeyboardDialect, XtCKeyboardDialect, screen.keyboard_dialect, DFT_KBD_DIALECT),
Sres(XtNprinterCommand, XtCPrinterCommand, SPS.printer_command, ""),
Sres(XtNtekGeometry, XtCGeometry, misc.T_geometry, NULL),
Tres(XtNcursorColor, XtCCursorColor, TEXT_CURSOR, XtDefaultForeground),
Tres(XtNforeground, XtCForeground, TEXT_FG, XtDefaultForeground),
Tres(XtNpointerColor, XtCPointerColor, MOUSE_FG, XtDefaultForeground),
Tres(XtNbackground, XtCBackground, TEXT_BG, XtDefaultBackground),
Tres(XtNpointerColorBackground, XtCBackground, MOUSE_BG, XtDefaultBackground),
{XtNresizeGravity, XtCResizeGravity, XtRGravity, sizeof(XtGravity),
XtOffsetOf(XtermWidgetRec, misc.resizeGravity),
XtRImmediate, (XtPointer) SouthWestGravity},
{XtNpointerShape, XtCCursor, XtRCursor, sizeof(Cursor),
XtOffsetOf(XtermWidgetRec, screen.pointer_cursor),
XtRString, (XtPointer) "xterm"},
#ifdef ALLOWLOGGING
Bres(XtNlogInhibit, XtCLogInhibit, misc.logInhibit, False),
Bres(XtNlogging, XtCLogging, misc.log_on, False),
Sres(XtNlogFile, XtCLogfile, screen.logfile, NULL),
#endif
#ifndef NO_ACTIVE_ICON
Sres("activeIcon", "ActiveIcon", misc.active_icon_s, "default"),
Ires("iconBorderWidth", XtCBorderWidth, misc.icon_border_width, 2),
Sres("iconFont", "IconFont", screen.icon_fontname, "nil2"),
Cres("iconBorderColor", XtCBorderColor, misc.icon_border_pixel, XtDefaultBackground),
#endif /* NO_ACTIVE_ICON */
#if OPT_BLINK_CURS
Bres(XtNcursorBlink, XtCCursorBlink, screen.cursor_blink, False),
#endif
Bres(XtNcursorUnderline, XtCCursorUnderline, screen.cursor_underline, False),
#if OPT_BLINK_TEXT
Bres(XtNshowBlinkAsBold, XtCCursorBlink, screen.blink_as_bold, DEFBLINKASBOLD),
#endif
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
Ires(XtNcursorOnTime, XtCCursorOnTime, screen.blink_on, 600),
Ires(XtNcursorOffTime, XtCCursorOffTime, screen.blink_off, 300),
#endif
#if OPT_BOX_CHARS
Bres(XtNforceBoxChars, XtCForceBoxChars, screen.force_box_chars, False),
Bres(XtNforcePackedFont, XtCForcePackedFont, screen.force_packed, True),
Bres(XtNshowMissingGlyphs, XtCShowMissingGlyphs, screen.force_all_chars, False),
Bres(XtNassumeAllChars, XtCAssumeAllChars, screen.assume_all_chars, False),
#endif
#if OPT_BROKEN_OSC
Bres(XtNbrokenLinuxOSC, XtCBrokenLinuxOSC, screen.brokenLinuxOSC, True),
#endif
#if OPT_BROKEN_ST
Bres(XtNbrokenStringTerm, XtCBrokenStringTerm, screen.brokenStringTerm, False),
#endif
#if OPT_C1_PRINT
Bres(XtNallowC1Printable, XtCAllowC1Printable, screen.c1_printable, False),
#endif
#if OPT_CLIP_BOLD
Bres(XtNuseClipping, XtCUseClipping, screen.use_clipping, True),
#endif
#if OPT_DEC_CHRSET
Bres(XtNfontDoublesize, XtCFontDoublesize, screen.font_doublesize, True),
Ires(XtNcacheDoublesize, XtCCacheDoublesize, screen.cache_doublesize, NUM_CHRSET),
#endif
#if OPT_HIGHLIGHT_COLOR
Tres(XtNhighlightColor, XtCHighlightColor, HIGHLIGHT_BG, XtDefaultForeground),
Tres(XtNhighlightTextColor, XtCHighlightTextColor, HIGHLIGHT_FG, XtDefaultBackground),
Bres(XtNhighlightReverse, XtCHighlightReverse, screen.hilite_reverse, True),
Bres(XtNhighlightColorMode, XtCHighlightColorMode, screen.hilite_color, Maybe),
#endif /* OPT_HIGHLIGHT_COLOR */
#if OPT_INPUT_METHOD
Bres(XtNopenIm, XtCOpenIm, misc.open_im, True),
Sres(XtNinputMethod, XtCInputMethod, misc.input_method, NULL),
Sres(XtNpreeditType, XtCPreeditType, misc.preedit_type,
"OverTheSpot,Root"),
Ires(XtNretryInputMethod, XtCRetryInputMethod, misc.retry_im, 3),
#endif
#if OPT_ISO_COLORS
Bres(XtNboldColors, XtCColorMode, screen.boldColors, True),
Ires(XtNveryBoldColors, XtCVeryBoldColors, screen.veryBoldColors, 0),
Bres(XtNcolorMode, XtCColorMode, screen.colorMode, DFT_COLORMODE),
Bres(XtNcolorAttrMode, XtCColorAttrMode, screen.colorAttrMode, False),
Bres(XtNcolorBDMode, XtCColorAttrMode, screen.colorBDMode, False),
Bres(XtNcolorBLMode, XtCColorAttrMode, screen.colorBLMode, False),
Bres(XtNcolorRVMode, XtCColorAttrMode, screen.colorRVMode, False),
Bres(XtNcolorULMode, XtCColorAttrMode, screen.colorULMode, False),
Bres(XtNitalicULMode, XtCColorAttrMode, screen.italicULMode, False),
COLOR_RES("0", screen.Acolors[COLOR_0], DFT_COLOR("black")),
COLOR_RES("1", screen.Acolors[COLOR_1], DFT_COLOR("red3")),
COLOR_RES("2", screen.Acolors[COLOR_2], DFT_COLOR("green3")),
COLOR_RES("3", screen.Acolors[COLOR_3], DFT_COLOR("yellow3")),
COLOR_RES("4", screen.Acolors[COLOR_4], DFT_COLOR(DEF_COLOR4)),
COLOR_RES("5", screen.Acolors[COLOR_5], DFT_COLOR("magenta3")),
COLOR_RES("6", screen.Acolors[COLOR_6], DFT_COLOR("cyan3")),
COLOR_RES("7", screen.Acolors[COLOR_7], DFT_COLOR("gray90")),
COLOR_RES("8", screen.Acolors[COLOR_8], DFT_COLOR("gray50")),
COLOR_RES("9", screen.Acolors[COLOR_9], DFT_COLOR("red")),
COLOR_RES("10", screen.Acolors[COLOR_10], DFT_COLOR("green")),
COLOR_RES("11", screen.Acolors[COLOR_11], DFT_COLOR("yellow")),
COLOR_RES("12", screen.Acolors[COLOR_12], DFT_COLOR(DEF_COLOR12)),
COLOR_RES("13", screen.Acolors[COLOR_13], DFT_COLOR("magenta")),
COLOR_RES("14", screen.Acolors[COLOR_14], DFT_COLOR("cyan")),
COLOR_RES("15", screen.Acolors[COLOR_15], DFT_COLOR("white")),
COLOR_RES("BD", screen.Acolors[COLOR_BD], DFT_COLOR(XtDefaultForeground)),
COLOR_RES("BL", screen.Acolors[COLOR_BL], DFT_COLOR(XtDefaultForeground)),
COLOR_RES("UL", screen.Acolors[COLOR_UL], DFT_COLOR(XtDefaultForeground)),
COLOR_RES("RV", screen.Acolors[COLOR_RV], DFT_COLOR(XtDefaultForeground)),
#if !OPT_COLOR_RES2
#if OPT_256_COLORS
# include <256colres.h>
#elif OPT_88_COLORS
# include <88colres.h>
#endif
#endif /* !OPT_COLOR_RES2 */
#endif /* OPT_ISO_COLORS */
CLICK_RES("2", screen.onClick[1], "word"),
CLICK_RES("3", screen.onClick[2], "line"),
CLICK_RES("4", screen.onClick[3], 0),
CLICK_RES("5", screen.onClick[4], 0),
#if OPT_MOD_FKEYS
Ires(XtNmodifyKeyboard, XtCModifyKeyboard,
keyboard.modify_1st.allow_keys, 0),
Ires(XtNmodifyCursorKeys, XtCModifyCursorKeys,
keyboard.modify_1st.cursor_keys, 2),
Ires(XtNmodifyFunctionKeys, XtCModifyFunctionKeys,
keyboard.modify_1st.function_keys, 2),
Ires(XtNmodifyKeypadKeys, XtCModifyKeypadKeys,
keyboard.modify_1st.keypad_keys, 0),
Ires(XtNmodifyOtherKeys, XtCModifyOtherKeys,
keyboard.modify_1st.other_keys, 0),
Ires(XtNmodifyStringKeys, XtCModifyStringKeys,
keyboard.modify_1st.string_keys, 0),
Ires(XtNformatOtherKeys, XtCFormatOtherKeys,
keyboard.format_keys, 0),
#endif
#if OPT_NUM_LOCK
Bres(XtNalwaysUseMods, XtCAlwaysUseMods, misc.alwaysUseMods, False),
Bres(XtNnumLock, XtCNumLock, misc.real_NumLock, True),
#endif
#if OPT_PRINT_COLORS
Ires(XtNprintAttributes, XtCPrintAttributes, SPS.print_attributes, 1),
#endif
#if OPT_SHIFT_FONTS
Bres(XtNshiftFonts, XtCShiftFonts, misc.shift_fonts, True),
#endif
#if OPT_SIXEL_GRAPHICS
Bres(XtNprivateColorRegisters, XtCPrivateColorRegisters,
screen.privatecolorregisters, True),
Bres(XtNsixelScrolling, XtCSixelScrolling, screen.sixel_scrolling, False),
#endif
#if OPT_SUNPC_KBD
Ires(XtNctrlFKeys, XtCCtrlFKeys, misc.ctrl_fkeys, 10),
#endif
#if OPT_TEK4014
Bres(XtNtekInhibit, XtCTekInhibit, misc.tekInhibit, False),
Bres(XtNtekSmall, XtCTekSmall, misc.tekSmall, False),
Bres(XtNtekStartup, XtCTekStartup, misc.TekEmu, False),
#endif
#if OPT_TOOLBAR
Wres(XtNmenuBar, XtCMenuBar, VT100_TB_INFO(menu_bar), 0),
Ires(XtNmenuHeight, XtCMenuHeight, VT100_TB_INFO(menu_height), 25),
#endif
#if OPT_WIDE_CHARS
Bres(XtNcjkWidth, XtCCjkWidth, misc.cjk_width, False),
Bres(XtNmkWidth, XtCMkWidth, misc.mk_width, False),
Bres(XtNprecompose, XtCPrecompose, screen.normalized_c, True),
Bres(XtNutf8Latin1, XtCUtf8Latin1, screen.utf8_latin1, False),
Bres(XtNutf8Title, XtCUtf8Title, screen.utf8_title, False),
Bres(XtNvt100Graphics, XtCVT100Graphics, screen.vt100_graphics, True),
Bres(XtNwideChars, XtCWideChars, screen.wide_chars, False),
Ires(XtNcombiningChars, XtCCombiningChars, screen.max_combining, 2),
Ires(XtNmkSamplePass, XtCMkSamplePass, misc.mk_samplepass, 256),
Ires(XtNmkSampleSize, XtCMkSampleSize, misc.mk_samplesize, 1024),
Sres(XtNutf8, XtCUtf8, screen.utf8_mode_s, "default"),
Sres(XtNutf8Fonts, XtCUtf8Fonts, screen.utf8_fonts_s, "default"),
Sres(XtNwideBoldFont, XtCWideBoldFont, misc.default_font.f_wb, DEFWIDEBOLDFONT),
Sres(XtNwideFont, XtCWideFont, misc.default_font.f_w, DEFWIDEFONT),
Sres(XtNutf8SelectTypes, XtCUtf8SelectTypes, screen.utf8_select_types, NULL),
#endif
#if OPT_LUIT_PROG
Sres(XtNlocale, XtCLocale, misc.locale_str, "medium"),
Sres(XtNlocaleFilter, XtCLocaleFilter, misc.localefilter, DEFLOCALEFILTER),
#endif
#if OPT_INPUT_METHOD
Sres(XtNximFont, XtCXimFont, misc.f_x, DEFXIMFONT),
#endif
#if OPT_SCROLL_LOCK
Bres(XtNallowScrollLock, XtCAllowScrollLock, screen.allowScrollLock0, False),
#endif
#if OPT_XMC_GLITCH
Bres(XtNxmcInline, XtCXmcInline, screen.xmc_inline, False),
Bres(XtNxmcMoveSGR, XtCXmcMoveSGR, screen.move_sgr_ok, True),
Ires(XtNxmcAttributes, XtCXmcAttributes, screen.xmc_attributes, 1),
Ires(XtNxmcGlitch, XtCXmcGlitch, screen.xmc_glitch, 0),
#endif
#ifdef SCROLLBAR_RIGHT
Bres(XtNrightScrollBar, XtCRightScrollBar, misc.useRight, False),
#endif
#if OPT_RENDERFONT
#define RES_FACESIZE(n) Dres(XtNfaceSize #n, XtCFaceSize #n, misc.face_size[n], "0.0")
RES_FACESIZE(1),
RES_FACESIZE(2),
RES_FACESIZE(3),
RES_FACESIZE(4),
RES_FACESIZE(5),
RES_FACESIZE(6),
Dres(XtNfaceSize, XtCFaceSize, misc.face_size[0], DEFFACESIZE),
Sres(XtNfaceName, XtCFaceName, misc.face_name, DEFFACENAME),
Sres(XtNfaceNameDoublesize, XtCFaceNameDoublesize, misc.face_wide_name, DEFFACENAME),
Sres(XtNrenderFont, XtCRenderFont, misc.render_font_s, "default"),
#endif
};
static Boolean VTSetValues(Widget cur, Widget request, Widget new_arg,
ArgList args, Cardinal *num_args);
static void VTClassInit(void);
static void VTDestroy(Widget w);
static void VTExpose(Widget w, XEvent * event, Region region);
static void VTInitialize(Widget wrequest, Widget new_arg, ArgList args,
Cardinal *num_args);
static void VTRealize(Widget w, XtValueMask * valuemask,
XSetWindowAttributes * values);
static void VTResize(Widget w);
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
static void VTInitI18N(XtermWidget);
#endif
#ifdef VMS
globaldef {
"xtermclassrec"
} noshare
#else
static
#endif /* VMS */
WidgetClassRec xtermClassRec =
{
{
/* core_class fields */
(WidgetClass) & widgetClassRec, /* superclass */
"VT100", /* class_name */
sizeof(XtermWidgetRec), /* widget_size */
VTClassInit, /* class_initialize */
NULL, /* class_part_initialize */
False, /* class_inited */
VTInitialize, /* initialize */
NULL, /* initialize_hook */
VTRealize, /* realize */
actionsList, /* actions */
XtNumber(actionsList), /* num_actions */
xterm_resources, /* resources */
XtNumber(xterm_resources), /* num_resources */
NULLQUARK, /* xrm_class */
True, /* compress_motion */
False, /* compress_exposure */
True, /* compress_enterleave */
False, /* visible_interest */
VTDestroy, /* destroy */
VTResize, /* resize */
VTExpose, /* expose */
VTSetValues, /* set_values */
NULL, /* set_values_hook */
XtInheritSetValuesAlmost, /* set_values_almost */
NULL, /* get_values_hook */
NULL, /* accept_focus */
XtVersion, /* version */
NULL, /* callback_offsets */
0, /* tm_table */
XtInheritQueryGeometry, /* query_geometry */
XtInheritDisplayAccelerator, /* display_accelerator */
NULL /* extension */
}
};
#ifdef VMS
globaldef {
"xtermwidgetclass"
}
noshare
#endif /* VMS */
WidgetClass xtermWidgetClass = (WidgetClass) & xtermClassRec;
/*
* Add input-actions for widgets that are overlooked (scrollbar and toolbar):
*
* a) Sometimes the scrollbar passes through translations, sometimes it
* doesn't. We add the KeyPress translations here, just to be sure.
* b) In the normal (non-toolbar) configuration, the xterm widget covers
* almost all of the window. With a toolbar, there's a relatively
* large area that the user would expect to enter keystrokes since the
* program can get the focus.
*/
void
xtermAddInput(Widget w)
{
/* *INDENT-OFF* */
XtActionsRec input_actions[] = {
{ "insert", HandleKeyPressed }, /* alias */
{ "insert-eight-bit", HandleEightBitKeyPressed },
{ "insert-seven-bit", HandleKeyPressed },
{ "secure", HandleSecure },
{ "string", HandleStringEvent },
{ "scroll-back", HandleScrollBack },
{ "scroll-forw", HandleScrollForward },
{ "select-cursor-end", HandleKeyboardSelectEnd },
{ "select-cursor-extend", HandleKeyboardSelectExtend },
{ "select-cursor-start", HandleKeyboardSelectStart },
{ "insert-selection", HandleInsertSelection },
{ "select-start", HandleSelectStart },
{ "select-extend", HandleSelectExtend },
{ "start-extend", HandleStartExtend },
{ "select-end", HandleSelectEnd },
{ "clear-saved-lines", HandleClearSavedLines },
{ "popup-menu", HandlePopupMenu },
{ "bell", HandleBell },
{ "ignore", HandleIgnore },
#if OPT_DABBREV
{ "dabbrev-expand", HandleDabbrevExpand },
#endif
#if OPT_MAXIMIZE
{ "fullscreen", HandleFullscreen },
#endif
#if OPT_SCROLL_LOCK
{ "scroll-lock", HandleScrollLock },
#endif
#if OPT_SHIFT_FONTS
{ "larger-vt-font", HandleLargerFont },
{ "smaller-vt-font", HandleSmallerFont },
#endif
};
/* *INDENT-ON* */
TRACE_TRANS("BEFORE", w);
XtAppAddActions(app_con, input_actions, XtNumber(input_actions));
XtAugmentTranslations(w, XtParseTranslationTable(defaultTranslations));
TRACE_TRANS("AFTER:", w);
#if OPT_EXTRA_PASTE
if (term && term->keyboard.extra_translations)
XtOverrideTranslations((Widget) term, XtParseTranslationTable(term->keyboard.extra_translations));
#endif
}
#if OPT_ISO_COLORS
#ifdef EXP_BOGUS_FG
static Bool
CheckBogusForeground(TScreen *screen, const char *tag)
{
int row = -1, col = -1, pass;
Bool isClear = True;
(void) tag;
for (pass = 0; pass < 2; ++pass) {
row = screen->cur_row;
for (; isClear && (row <= screen->max_row); ++row) {
LineData *ld = getLineData(screen, row)->;
if (ld != 0) {
Char *attribs = ld->attribs;
col = (row == screen->cur_row) ? screen->cur_col : 0;
for (; isClear && (col <= screen->max_col); ++col) {
unsigned flags = attribs[col];
if (pass) {
flags &= ~FG_COLOR;
attribs[col] = (Char) flags;
} else if ((flags & BG_COLOR)) {
isClear = False;
} else if ((flags & FG_COLOR)) {
unsigned ch = ld->charData[col];
isClear = ((ch == ' ') || (ch == 0));
} else {
isClear = False;
}
}
}
}
}
TRACE(("%s checked %d,%d to %d,%d %s pass %d\n",
tag, screen->cur_row, screen->cur_col,
row, col,
isClear && pass ? "cleared" : "unchanged",
pass));
return isClear;
}
#endif
/*
* The terminal's foreground and background colors are set via two mechanisms:
* text (cur_foreground, cur_background values that are passed down to
* XDrawImageString and XDrawString)
* area (X11 graphics context used in XClearArea and XFillRectangle)
*/
void
SGR_Foreground(XtermWidget xw, int color)
{
TScreen *screen = TScreenOf(xw);
Pixel fg;
if (color >= 0) {
UIntSet(xw->flags, FG_COLOR);
} else {
UIntClr(xw->flags, FG_COLOR);
}
fg = getXtermForeground(xw, xw->flags, color);
xw->cur_foreground = color;
setCgsFore(xw, WhichVWin(screen), gcNorm, fg);
setCgsBack(xw, WhichVWin(screen), gcNormReverse, fg);
setCgsFore(xw, WhichVWin(screen), gcBold, fg);
setCgsBack(xw, WhichVWin(screen), gcBoldReverse, fg);
#ifdef EXP_BOGUS_FG
/*
* If we've just turned off the foreground color, check for blank cells
* which have no background color, but do have foreground color. This
* could happen due to setting the foreground color just before scrolling.
*
* Those cells look uncolored, but will confuse ShowCursor(), which looks
* for the colors in the current cell, and will see the foreground color.
* In that case, remove the foreground color from the blank cells.
*/
if (color < 0) {
CheckBogusForeground(screen, "SGR_Foreground");
}
#endif
}
void
SGR_Background(XtermWidget xw, int color)
{
TScreen *screen = TScreenOf(xw);
Pixel bg;
/*
* An indexing operation may have set screen->scroll_amt, which would
* normally result in calling FlushScroll() in WriteText(). However,
* if we're changing the background color now, then the new value
* should not apply to the pending blank lines.
*/
if (screen->scroll_amt && (color != xw->cur_background))
FlushScroll(xw);
if (color >= 0) {
UIntSet(xw->flags, BG_COLOR);
} else {
UIntClr(xw->flags, BG_COLOR);
}
bg = getXtermBackground(xw, xw->flags, color);
xw->cur_background = color;
setCgsBack(xw, WhichVWin(screen), gcNorm, bg);
setCgsFore(xw, WhichVWin(screen), gcNormReverse, bg);
setCgsBack(xw, WhichVWin(screen), gcBold, bg);
setCgsFore(xw, WhichVWin(screen), gcBoldReverse, bg);
}
/* Invoked after updating bold/underline flags, computes the extended color
* index to use for foreground. (See also 'extract_fg()').
*/
static void
setExtendedFG(XtermWidget xw)
{
int fg = xw->sgr_foreground;
if (TScreenOf(xw)->colorAttrMode
|| (fg < 0)) {
fg = MapToColorMode(fg, TScreenOf(xw), xw->flags);
}
/* This implements the IBM PC-style convention of 8-colors, with one
* bit for bold, thus mapping the 0-7 codes to 8-15. It won't make
* much sense for 16-color applications, but we keep it to retain
* compatiblity with ANSI-color applications.
*/
#if OPT_PC_COLORS /* XXXJTL should be settable at runtime (resource or OSC?) */
if (TScreenOf(xw)->boldColors
&& (!xw->sgr_extended)
&& (fg >= 0)
&& (fg < 8)
&& (xw->flags & BOLD))
fg |= 8;
#endif
SGR_Foreground(xw, fg);
}
/* Invoked after updating inverse flag, computes the extended color
* index to use for background. (See also 'extract_bg()').
*/
static void
setExtendedBG(XtermWidget xw)
{
int bg = xw->sgr_background;
if (TScreenOf(xw)->colorAttrMode
|| (bg < 0)) {
if (TScreenOf(xw)->colorRVMode && (xw->flags & INVERSE))
bg = COLOR_RV;
}
SGR_Background(xw, bg);
}
static void
reset_SGR_Foreground(XtermWidget xw)
{
xw->sgr_foreground = -1;
xw->sgr_extended = False;
setExtendedFG(xw);
}
static void
reset_SGR_Background(XtermWidget xw)
{
xw->sgr_background = -1;
setExtendedBG(xw);
}
static void
reset_SGR_Colors(XtermWidget xw)
{
reset_SGR_Foreground(xw);
reset_SGR_Background(xw);
}
#endif /* OPT_ISO_COLORS */
void
resetCharsets(TScreen *screen)
{
TRACE(("resetCharsets\n"));
screen->gsets[0] = nrc_ASCII;
screen->gsets[1] = nrc_ASCII;
screen->gsets[2] = nrc_ASCII;
screen->gsets[3] = nrc_ASCII;
screen->curgl = 0; /* G0 => GL. */
screen->curgr = 2; /* G2 => GR. */
screen->curss = 0; /* No single shift. */
#if OPT_VT52_MODE
if (screen->vtXX_level == 0)
screen->gsets[1] = '0'; /* Graphics */
#endif
}
static void
modified_DECNRCM(XtermWidget xw)
{
#if OPT_WIDE_CHARS
TScreen *screen = TScreenOf(xw);
if (screen->wide_chars && (screen->utf8_mode || screen->utf8_nrc_mode)) {
int enabled = ((xw->flags & NATIONAL) != 0);
int modefix;
EXCHANGE(screen->utf8_nrc_mode, screen->utf8_mode, modefix);
switchPtyData(screen, !enabled);
TRACE(("UTF8 mode temporarily %s\n", BtoS(!enabled)));
}
#endif
}
/*
* VT300 and up support three ANSI conformance levels, defined according to
* the dpANSI X3.134.1 standard. DEC's manuals equate levels 1 and 2, and
* are unclear. This code is written based on the manuals.
*/
static void
set_ansi_conformance(TScreen *screen, int level)
{
TRACE(("set_ansi_conformance(%d) dec_level %d:%d, ansi_level %d\n",
level,
screen->vtXX_level * 100,
screen->terminal_id,
screen->ansi_level));
if (screen->vtXX_level >= 3) {
switch (screen->ansi_level = level) {
case 1:
/* FALLTHRU */
case 2:
screen->gsets[0] = nrc_ASCII; /* G0 is ASCII */
screen->gsets[1] = nrc_ASCII; /* G1 is ISO Latin-1 */
screen->curgl = 0;
screen->curgr = 1;
break;
case 3:
screen->gsets[0] = nrc_ASCII; /* G0 is ASCII */
screen->curgl = 0;
break;
}
}
}
/*
* Set scrolling margins. VTxxx terminals require that the top/bottom are
* different, so we have at least two lines in the scrolling region.
*/
void
set_tb_margins(TScreen *screen, int top, int bottom)
{
TRACE(("set_tb_margins %d..%d, prior %d..%d\n",
top, bottom,
screen->top_marg,
screen->bot_marg));
if (bottom > top) {
screen->top_marg = top;
screen->bot_marg = bottom;
}
if (screen->top_marg > screen->max_row)
screen->top_marg = screen->max_row;
if (screen->bot_marg > screen->max_row)
screen->bot_marg = screen->max_row;
}
void
set_lr_margins(TScreen *screen, int left, int right)
{
TRACE(("set_lr_margins %d..%d, prior %d..%d\n",
left, right,
screen->lft_marg,
screen->rgt_marg));
if (right > left) {
screen->lft_marg = left;
screen->rgt_marg = right;
}
if (screen->lft_marg > screen->max_col)
screen->lft_marg = screen->max_col;
if (screen->rgt_marg > screen->max_col)
screen->rgt_marg = screen->max_col;
}
#define reset_tb_margins(screen) set_tb_margins(screen, 0, screen->max_row)
#define reset_lr_margins(screen) set_lr_margins(screen, 0, screen->max_col)
static void
reset_margins(TScreen *screen)
{
reset_tb_margins(screen);
reset_lr_margins(screen);
}
void
set_max_col(TScreen *screen, int cols)
{
TRACE(("set_max_col %d, prior %d\n", cols, screen->max_col));
if (cols < 0)
cols = 0;
screen->max_col = cols;
}
void
set_max_row(TScreen *screen, int rows)
{
TRACE(("set_max_row %d, prior %d\n", rows, screen->max_row));
if (rows < 0)
rows = 0;
screen->max_row = rows;
}
#if OPT_MOD_FKEYS
static void
set_mod_fkeys(XtermWidget xw, int which, int what, Bool enabled)
{
#define SET_MOD_FKEYS(field) \
xw->keyboard.modify_now.field = ((what == DEFAULT) && enabled) \
? xw->keyboard.modify_1st.field \
: what; \
TRACE(("set modify_now.%s to %d\n", #field, \
xw->keyboard.modify_now.field));
switch (which) {
case 0:
SET_MOD_FKEYS(allow_keys);
break;
case 1:
SET_MOD_FKEYS(cursor_keys);
break;
case 2:
SET_MOD_FKEYS(function_keys);
break;
case 3:
SET_MOD_FKEYS(keypad_keys);
break;
case 4:
SET_MOD_FKEYS(other_keys);
break;
case 5:
SET_MOD_FKEYS(string_keys);
break;
}
}
#endif /* OPT_MOD_FKEYS */
#if OPT_TRACE
#define WHICH_TABLE(name) if (table == name) result = #name
static const char *
which_table(Const PARSE_T * table)
{
const char *result = "?";
/* *INDENT-OFF* */
WHICH_TABLE (ansi_table);
else WHICH_TABLE (cigtable);
else WHICH_TABLE (csi2_table);
else WHICH_TABLE (csi_ex_table);
else WHICH_TABLE (csi_quo_table);
else WHICH_TABLE (csi_table);
else WHICH_TABLE (dec2_table);
else WHICH_TABLE (dec3_table);
else WHICH_TABLE (dec_table);
else WHICH_TABLE (eigtable);
else WHICH_TABLE (esc_sp_table);
else WHICH_TABLE (esc_table);
else WHICH_TABLE (scrtable);
else WHICH_TABLE (scs96table);
else WHICH_TABLE (scstable);
else WHICH_TABLE (sos_table);
#if OPT_BLINK_CURS
else WHICH_TABLE (csi_sp_table);
#endif
#if OPT_DEC_LOCATOR
else WHICH_TABLE (csi_tick_table);
#endif
#if OPT_DEC_RECTOPS
else WHICH_TABLE (csi_dollar_table);
else WHICH_TABLE (csi_star_table);
else WHICH_TABLE (csi_dec_dollar_table);
#endif
#if OPT_WIDE_CHARS
else WHICH_TABLE (esc_pct_table);
else WHICH_TABLE (scs_pct_table);
#endif
#if OPT_VT52_MODE
else WHICH_TABLE (vt52_table);
else WHICH_TABLE (vt52_esc_table);
else WHICH_TABLE (vt52_ignore_table);
#endif
/* *INDENT-ON* */
return result;
}
#endif
#if OPT_TRACE > 0
static void
dump_params(void)
{
int n;
int arg;
TRACE(("params %d (%d)\n", nparam, parms.has_subparams));
for (arg = 1, n = 0; n < nparam; ++n) {
TRACE(("%3d.%d %d\n", arg, parms.is_sub[n], parms.params[n]));
if (!parms.is_sub[n])
++arg;
}
}
#define DumpParams() dump_params()
#else
#define DumpParams() /* nothing */
#endif
/* allocate larger buffer if needed/possible */
#define SafeAlloc(type, area, used, size) \
type *new_string = area; \
size_t new_length = size; \
if (new_length == 0) { \
new_length = 256; \
new_string = TypeMallocN(type, new_length); \
} else if (used+1 >= new_length) { \
new_length = size * 2; \
new_string = TypeMallocN(type, new_length); \
if (new_string != 0 \
&& area != 0 \
&& used != 0) \
memcpy(new_string, area, used * sizeof(type)); \
}
#define WriteNow() { \
unsigned single = 0; \
\
if (screen->curss) { \
dotext(xw, \
screen->gsets[(int) (screen->curss)], \
sp->print_area, \
(Cardinal) 1); \
screen->curss = 0; \
single++; \
} \
if (sp->print_used > single) { \
dotext(xw, \
screen->gsets[(int) (screen->curgl)], \
sp->print_area + single, \
(Cardinal) (sp->print_used - single)); \
} \
sp->print_used = 0; \
} \
struct ParseState {
#if OPT_VT52_MODE
Bool vt52_cup;
#endif
Const PARSE_T *groundtable;
Const PARSE_T *parsestate;
int scstype;
int scssize;
Bool private_function; /* distinguish private-mode from standard */
int string_mode; /* nonzero iff we're processing a string */
int lastchar; /* positive iff we had a graphic character */
int nextstate;
#if OPT_WIDE_CHARS
int last_was_wide;
#endif
/* Buffer for processing printable text */
IChar *print_area;
size_t print_size;
size_t print_used;
/* Buffer for processing strings (e.g., OSC ... ST) */
Char *string_area;
size_t string_size;
size_t string_used;
};
static struct ParseState myState;
static void
init_groundtable(TScreen *screen, struct ParseState *sp)
{
(void) screen;
#if OPT_VT52_MODE
if (!(screen->vtXX_level)) {
sp->groundtable = vt52_table;
} else if (screen->terminal_id >= 100)
#endif
{
sp->groundtable = ansi_table;
}
}
static void
select_charset(struct ParseState *sp, int type, int size)
{
TRACE(("select_charset %d %d\n", type, size));
sp->scstype = type;
sp->scssize = size;
if (size == 94) {
sp->parsestate = scstable;
} else {
sp->parsestate = scs96table;
}
}
static void
decode_scs(XtermWidget xw, int which, int prefix, int suffix)
{
/* *INDENT-OFF* */
static struct {
DECNRCM_codes result;
int prefix;
int suffix;
int min_level;
int max_level;
int need_nrc;
} table[] = {
{ nrc_ASCII, 0, 'B', 1, 9, 0 },
{ nrc_British, 0, 'A', 1, 9, 0 },
{ nrc_DEC_Spec_Graphic, 0, '0', 1, 9, 0 },
{ nrc_DEC_Alt_Chars, 0, '1', 1, 1, 0 },
{ nrc_DEC_Alt_Graphics, 0, '2', 1, 1, 0 },
/* VT2xx */
{ nrc_DEC_Supp, 0, '<', 2, 9, 0 },
{ nrc_Dutch, 0, '4', 2, 9, 1 },
{ nrc_Finnish, 0, '5', 2, 9, 1 },
{ nrc_Finnish2, 0, 'C', 2, 9, 1 },
{ nrc_French, 0, 'R', 2, 9, 1 },
{ nrc_French2, 0, 'f', 2, 9, 1 },
{ nrc_French_Canadian, 0, 'Q', 2, 9, 1 },
{ nrc_German, 0, 'K', 2, 9, 1 },
{ nrc_Italian, 0, 'Y', 2, 9, 1 },
{ nrc_Norwegian_Danish2, 0, 'E', 2, 9, 1 },
{ nrc_Norwegian_Danish3, 0, '6', 2, 9, 1 },
{ nrc_Spanish, 0, 'Z', 2, 9, 1 },
{ nrc_Swedish, 0, '7', 2, 9, 1 },
{ nrc_Swedish2, 0, 'H', 2, 9, 1 },
{ nrc_Swiss, 0, '=', 2, 9, 1 },
/* VT3xx */
{ nrc_British_Latin_1, 0, 'A', 3, 9, 1 },
{ nrc_DEC_Supp_Graphic, '%', '5', 3, 9, 0 },
{ nrc_DEC_Technical, 0, '>', 3, 9, 0 },
{ nrc_French_Canadian2, 0, '9', 3, 9, 1 },
{ nrc_Norwegian_Danish, 0, '`', 3, 9, 1 },
{ nrc_Portugese, '%', '6', 3, 9, 1 },
#if 0
/* VT5xx (not implemented) */
{ nrc_Cyrillic, '&', '4', 5, 9, 0 },
{ nrc_Greek, '"', '?', 5, 9, 0 },
{ nrc_Greek_Supp, 0, 'F', 5, 9, 0 },
{ nrc_Hebrew, '"', '4', 5, 9, 0 },
{ nrc_Hebrew2, '%', '=', 5, 9, 1 },
{ nrc_Hebrew_Supp, 0, 'H', 5, 9, 0 },
{ nrc_Latin_5_Supp, 0, 'M', 5, 9, 0 },
{ nrc_Latin_Cyrillic, 0, 'L', 5, 9, 0 },
{ nrc_Russian, '&', '5', 5, 9, 1 },
{ nrc_SCS_NRCS, '%', '3', 5, 9, 0 },
{ nrc_Turkish, '%', '0', 5, 9, 0 },
{ nrc_Turkish2, '%', '2', 5, 9, 1 },
#endif
};
/* *INDENT-ON* */
TScreen *screen = TScreenOf(xw);
Cardinal n;
DECNRCM_codes result = nrc_Unknown;
suffix &= 0x7f;
for (n = 0; n < XtNumber(table); ++n) {
if (prefix == table[n].prefix
&& suffix == table[n].suffix
&& screen->vtXX_level >= table[n].min_level
&& screen->vtXX_level <= table[n].max_level
&& (table[n].need_nrc == 0 || (xw->flags & NATIONAL) != 0)) {
result = table[n].result;
break;
}
}
if (result != nrc_Unknown) {
screen->gsets[which] = result;
TRACE(("setting G%d to %s\n", which, visibleScsCode(result)));
} else {
TRACE(("...unknown GSET\n"));
}
}
/*
* Given a parameter number, and subparameter (starting in each case from zero)
* return the corresponding index into the parameter array. If the combination
* is not found, return -1.
*/
static int
subparam_index(int p, int s)
{
int result = -1;
int j, p2, s2;
for (j = p2 = 0; j < nparam; ++j, ++p2) {
if (parms.is_sub[j]) {
s2 = 0;
do {
if ((p == p2) && (s == s2)) {
result = j;
break;
}
++s2;
} while ((++j < nparam) && (parms.is_sub[j - 1] < parms.is_sub[j]));
if (result >= 0)
break;
--j; /* undo the last "while" */
} else if (p == p2) {
if (s == 0) {
result = j;
}
break;
}
}
TRACE2(("...subparam_index %d.%d = %d\n", p + 1, s + 1, result));
return result;
}
/*
* Given an index into the parameter array, return the corresponding parameter
* number (starting from zero).
*/
static int
param_number(int item)
{
int result = -1;
int j, p;
for (j = p = 0; j < nparam; ++j, ++p) {
if (p >= item) {
result = j;
break;
}
if (parms.is_sub[j]) {
while ((++j < nparam) && (parms.is_sub[j - 1] < parms.is_sub[j])) {
/* EMPTY */
}
--j;
}
}
TRACE2(("...param_number(%d) = %d\n", item, result));
return result;
}
static int
get_subparam(int p, int s)
{
int item = subparam_index(p, s);
int result = (item >= 0) ? parms.params[item] : DEFAULT;
TRACE(("...get_subparam[%d] = %d\n", item, result));
return result;
}
/*
* Check if the given item in the parameter array has subparameters.
* If so, return the number of subparameters to use as a loop limit, etc.
*/
static int
param_has_subparams(int item)
{
int result = 0;
if (parms.has_subparams) {
int n = subparam_index(item, 0);
if (n >= 0 && parms.is_sub[n]) {
while (n++ < nparam && parms.is_sub[n - 1] < parms.is_sub[n]) {
result++;
}
}
}
TRACE(("...param_has_subparams(%d) ->%d\n", item, result));
return result;
}
#if OPT_256_COLORS || OPT_88_COLORS || OPT_ISO_COLORS
/*
* Some background -
*
* Todd Larason provided the initial changes to support 256-colors in July 1999.
* I pointed out that the description of SGR 38/48 in ECMA-48 was vague, and
* was unsure if there would be some standard using those codes. His response
* was that this was documented (it turns out, in equally vague terms) in ITU
* T.416
*
* Discussing this with Todd Larason in mid-1999, my point was that given the
* high cost of obtaining ITU T.416 (ISO-8613-6), the standard was not going
* to be effective (more than $100 then, more than $200 in 2012)
*
* We overlooked the detail about ":" as a subparameter delimiter (documented
* in 5.4.t2 in ECMA-48). Some discussion in KDE in mid-2006 led Lars Doelle
* to discuss the issue with me. Lars' initial concern dealt with the fact
* that a sequence such as
* CSI 38 ; 5 ; 1 m
* violated the principle that SGR parameters could be used in any order.
* Further discussion (see KDE #107487) resolved that the standard expected
* that the sequence would look like
* CSI 38 ; 5 : 1 m
* which still violates that principle, since the "5:1" parameter has to
* follow the "38" to be useful.
*
* This function accepts either format (per request by Paul Leonerd Evans).
* It also accepts
* CSI 38 : 5 : 1 m
* according to Lars' original assumption.
*
* By the way - all of the parameters are decimal integers.
*/
#define extended_colors_limit(n) ((n) == 5 ? 1 : ((n) == 2 ? 3 : 0))
static Boolean
parse_extended_colors(XtermWidget xw, int *colorp, int *itemp)
{
Boolean result = False;
int item = *itemp;
int next = item;
int base = param_number(item);
int code = -1;
int values[3]; /* maximum number of subparameters */
int need = 0; /* number of subparameters needed */
int have;
int n;
/*
* On entry, 'item' points to the 38/48 code in the parameter array.
* If that has subparameters, we will expect all of the values to
* be subparameters of that item.
*/
if ((have = param_has_subparams(item)) != 0) {
/* accept CSI 38 : 5 : 1 m */
/* accept CSI 38 : 2 : 1 : 2 : 3 m */
code = get_subparam(base, 1);
need = extended_colors_limit(code);
next = item + have;
for (n = 0; n < need && n < 3; ++n) {
values[n] = get_subparam(base, 2 + n);
}
} else if (++item < nparam) {
++base;
if ((have = param_has_subparams(item)) != 0) {
/* accept CSI 38 ; 5 : 1 m */
/* accept CSI 38 ; 2 : 1 : 2 : 3 m */
code = get_subparam(base, 0);
need = extended_colors_limit(code);
next = base + have;
for (n = 0; n < need && n < 3; ++n) {
values[n] = get_subparam(base, 1 + n);
}
} else {
/* accept CSI 38 ; 5 ; 1 m */
/* accept CSI 38 ; 2 ; 1 ; 2 ; 3 m */
code = GetParam(item);
need = extended_colors_limit(code);
next = item + need;
for (n = 0; n < need && n < 3; ++n) {
values[n] = GetParam(item + 1 + n);
}
}
}
item = next;
switch (code) {
case 2:
/* direct color in rgb space */
if ((values[0] >= 0 && values[0] < 256) &&
(values[1] >= 0 && values[1] < 256) &&
(values[2] >= 0 && values[2] < 256)) {
*colorp = xtermClosestColor(xw, values[0], values[1], values[2]);
} else {
*colorp = -1;
}
break;
case 5:
/* indexed color */
*colorp = values[0];
break;
default:
*colorp = -1;
break;
}
result = (*colorp >= 0 && *colorp < NUM_ANSI_COLORS);
TRACE(("...resulting color %d/%d %s\n",
*colorp, NUM_ANSI_COLORS,
result ? "OK" : "ERR"));
*itemp = item;
return result;
}
#endif /* ...extended_colors */
static int
optional_param(int which)
{
return (nparam > which) ? GetParam(which) : DEFAULT;
}
static int
zero_if_default(int which)
{
int result = (nparam > which) ? GetParam(which) : 0;
if (result <= 0)
result = 0;
return result;
}
static int
one_if_default(int which)
{
int result = (nparam > which) ? GetParam(which) : 0;
if (result <= 0)
result = 1;
return result;
}
/*
* Color palette changes using the OSC controls require a repaint of the
* screen - but not immediately. Do the repaint as soon as we detect a
* state which will not lead to another color palette change.
*/
static void
repaintWhenPaletteChanged(XtermWidget xw, struct ParseState *sp)
{
Boolean ignore = False;
switch (sp->nextstate) {
case CASE_ESC:
ignore = ((sp->parsestate == ansi_table) ||
(sp->parsestate == sos_table));
break;
case CASE_OSC:
ignore = ((sp->parsestate == ansi_table) ||
(sp->parsestate == esc_table));
break;
case CASE_IGNORE:
ignore = (sp->parsestate == sos_table);
break;
case CASE_ST:
ignore = ((sp->parsestate == esc_table) ||
(sp->parsestate == sos_table));
break;
case CASE_ESC_DIGIT:
ignore = (sp->parsestate == csi_table);
break;
case CASE_ESC_SEMI:
ignore = (sp->parsestate == csi2_table);
break;
}
if (!ignore) {
TRACE(("repaintWhenPaletteChanged\n"));
xw->misc.palette_changed = False;
xtermRepaint(xw);
}
}
#if OPT_C1_PRINT || OPT_WIDE_CHARS
#define ParseSOS(screen) ((screen)->c1_printable == 0)
#else
#define ParseSOS(screen) 0
#endif
#define ResetState(sp) ParamsDone(), (sp)->parsestate = (sp)->groundtable
static void
illegal_parse(XtermWidget xw, unsigned c, struct ParseState *sp)
{
ResetState(sp);
sp->nextstate = sp->parsestate[E2A(c)];
Bell(xw, XkbBI_MinorError, 0);
}
static void
init_parser(XtermWidget xw, struct ParseState *sp)
{
TScreen *screen = TScreenOf(xw);
memset(sp, 0, sizeof(*sp));
sp->scssize = 94; /* number of printable/nonspace ASCII */
sp->lastchar = -1; /* not a legal IChar */
sp->nextstate = -1; /* not a legal state */
init_groundtable(screen, sp);
ResetState(sp);
}
static void
init_reply(unsigned type)
{
memset(&reply, 0, sizeof(reply));
reply.a_type = (Char) type;
}
static Boolean
doparsing(XtermWidget xw, unsigned c, struct ParseState *sp)
{
TScreen *screen = TScreenOf(xw);
int item;
int count;
int value;
int laststate;
int thischar = -1;
XTermRect myRect;
do {
#if OPT_WIDE_CHARS
int this_is_wide = 0;
/*
* Handle zero-width combining characters. Make it faster by noting
* that according to the Unicode charts, the majority of Western
* character sets do not use this feature. There are some unassigned
* codes at 0x242, but no zero-width characters until past 0x300.
*/
if (c >= 0x300
&& screen->wide_chars
&& my_wcwidth((wchar_t) c) == 0
&& !isWideControl(c)) {
int prev, test;
Boolean used = True;
int use_row;
int use_col;
WriteNow();
use_row = (screen->char_was_written
? screen->last_written_row
: screen->cur_row);
use_col = (screen->char_was_written
? screen->last_written_col
: screen->cur_col);
/*
* Check if the latest data can be added to the base character.
* If there is already a combining character stored for the cell,
* we cannot, since that would change the order.
*/
if (screen->normalized_c
&& !IsCellCombined(screen, use_row, use_col)) {
prev = (int) XTERM_CELL(use_row, use_col);
test = do_precomposition(prev, (int) c);
TRACE(("do_precomposition (U+%04X [%d], U+%04X [%d]) -> U+%04X [%d]\n",
prev, my_wcwidth((wchar_t) prev),
(int) c, my_wcwidth((wchar_t) c),
test, my_wcwidth((wchar_t) test)));
} else {
prev = -1;
test = -1;
}
/* substitute combined character with precomposed character
* only if it does not change the width of the base character
*/
if (test != -1
&& my_wcwidth((wchar_t) test) == my_wcwidth((wchar_t) prev)) {
putXtermCell(screen, use_row, use_col, test);
} else if (screen->char_was_written
|| getXtermCell(screen, use_row, use_col) > ' ') {
addXtermCombining(screen, use_row, use_col, c);
} else {
/*
* none of the above... we will add the combining character as
* a base character.
*/
used = False;
}
if (used) {
if (!screen->scroll_amt)
ScrnUpdate(xw, use_row, use_col, 1, 1, 1);
continue;
}
}
#endif
/* Intercept characters for printer controller mode */
if (PrinterOf(screen).printer_controlmode == 2) {
if ((c = (unsigned) xtermPrinterControl(xw, (int) c)) == 0)
continue;
}
/*
* VT52 is a little ugly in the one place it has a parameterized
* control sequence, since the parameter falls after the character
* that denotes the type of sequence.
*/
#if OPT_VT52_MODE
if (sp->vt52_cup) {
if (nparam < NPARAM - 1) {
SetParam(nparam++, (int) (c & 0x7f) - 32);
parms.is_sub[nparam] = 0;
}
if (nparam < 2)
continue;
sp->vt52_cup = False;
CursorSet(screen, zero_if_default(0), zero_if_default(1), xw->flags);
sp->parsestate = vt52_table;
SetParam(0, 0);
SetParam(1, 0);
continue;
}
#endif
laststate = sp->nextstate;
if (c == ANSI_DEL
&& sp->parsestate == sp->groundtable
&& sp->scssize == 96
&& sp->scstype != 0) {
/*
* Handle special case of shifts for 96-character sets by checking
* if we have a DEL. The other special case for SPACE will always
* be printable.
*/
sp->nextstate = CASE_PRINT;
} else
#if OPT_WIDE_CHARS
if (c > 255) {
/*
* The parsing tables all have 256 entries. If we're supporting
* wide characters, we handle them by treating them the same as
* printing characters.
*/
if (sp->parsestate == sp->groundtable) {
sp->nextstate = CASE_PRINT;
} else if (sp->parsestate == sos_table) {
c &= 0xffff;
if (c > 255) {
TRACE(("Found code > 255 while in SOS state: %04X\n", c));
c = '?';
}
} else {
sp->nextstate = CASE_GROUND_STATE;
}
} else
#endif
sp->nextstate = sp->parsestate[E2A(c)];
#if OPT_BROKEN_OSC
/*
* Linux console palette escape sequences start with an OSC, but do
* not terminate correctly. Some scripts do not check before writing
* them, making xterm appear to hang (it's awaiting a valid string
* terminator). Just ignore these if we see them - there's no point
* in emulating bad code.
*/
if (screen->brokenLinuxOSC
&& sp->parsestate == sos_table) {
if (sp->string_used) {
switch (sp->string_area[0]) {
case 'P':
if (sp->string_used <= 7)
break;
/* FALLTHRU */
case 'R':
illegal_parse(xw, c, sp);
TRACE(("Reset to ground state (brokenLinuxOSC)\n"));
break;
}
}
}
#endif
#if OPT_BROKEN_ST
/*
* Before patch #171, carriage control embedded within an OSC string
* would terminate it. Some (buggy, of course) applications rely on
* this behavior. Accommodate them by allowing one to compile xterm
* and emulate the old behavior.
*/
if (screen->brokenStringTerm
&& sp->parsestate == sos_table
&& c < 32) {
switch (c) {
case ANSI_EOT: /* FALLTHRU */
case ANSI_BS: /* FALLTHRU */
case ANSI_HT: /* FALLTHRU */
case ANSI_LF: /* FALLTHRU */
case ANSI_VT: /* FALLTHRU */
case ANSI_FF: /* FALLTHRU */
case ANSI_CR: /* FALLTHRU */
case ANSI_SO: /* FALLTHRU */
case ANSI_SI: /* FALLTHRU */
case ANSI_XON: /* FALLTHRU */
case ANSI_CAN:
illegal_parse(xw, c, sp);
TRACE(("Reset to ground state (brokenStringTerm)\n"));
break;
}
}
#endif
#if OPT_C1_PRINT
/*
* This is not completely foolproof, but will allow an application
* with values in the C1 range to use them as printable characters,
* provided that they are not intermixed with an escape sequence.
*/
if (screen->c1_printable
&& (c >= 128 && c < 160)) {
sp->nextstate = (sp->parsestate == esc_table
? CASE_ESC_IGNORE
: sp->parsestate[E2A(160)]);
}
#endif
#if OPT_WIDE_CHARS
/*
* If we have a C1 code and the c1_printable flag is not set, simply
* ignore it when it was translated from UTF-8. That is because the
* value could not have been present as-is in the UTF-8.
*
* To see that CASE_IGNORE is a consistent value, note that it is
* always used for NUL and other uninteresting C0 controls.
*/
#if OPT_C1_PRINT
if (!screen->c1_printable)
#endif
if (screen->wide_chars
&& (c >= 128 && c < 160)) {
sp->nextstate = CASE_IGNORE;
}
/*
* If this character is a different width than the last one, put the
* previous text into the buffer and draw it now.
*/
this_is_wide = isWide((int) c);
if (this_is_wide != sp->last_was_wide) {
WriteNow();
}
#endif
/*
* Accumulate string for printable text. This may be 8/16-bit
* characters.
*/
if (sp->nextstate == CASE_PRINT) {
SafeAlloc(IChar, sp->print_area, sp->print_used, sp->print_size);
if (new_string == 0) {
xtermWarning("Cannot allocate %lu bytes for printable text\n",
(unsigned long) new_length);
continue;
}
#if OPT_VT52_MODE
/*
* Strip output text to 7-bits for VT52. We should do this for
* VT100 also (which is a 7-bit device), but xterm has been
* doing this for so long we shouldn't change this behavior.
*/
if (screen->vtXX_level < 1)
c &= 0x7f;
#endif
sp->print_area = new_string;
sp->print_size = new_length;
sp->print_area[sp->print_used++] = (IChar) c;
sp->lastchar = thischar = (int) c;
#if OPT_WIDE_CHARS
sp->last_was_wide = this_is_wide;
#endif
if (morePtyData(screen, VTbuffer)) {
continue;
}
}
if (sp->nextstate == CASE_PRINT
|| (laststate == CASE_PRINT && sp->print_used)) {
WriteNow();
}
/*
* Accumulate string for APC, DCS, PM, OSC, SOS controls
* This should always be 8-bit characters.
*/
if (sp->parsestate == sos_table) {
SafeAlloc(Char, sp->string_area, sp->string_used, sp->string_size);
if (new_string == 0) {
xtermWarning("Cannot allocate %lu bytes for string mode %d\n",
(unsigned long) new_length, sp->string_mode);
continue;
}
#if OPT_WIDE_CHARS
/*
* We cannot display codes above 255, but let's try to
* accommodate the application a little by not aborting the
* string.
*/
if ((c & 0xffff) > 255) {
sp->nextstate = CASE_PRINT;
c = '?';
}
#endif
sp->string_area = new_string;
sp->string_size = new_length;
sp->string_area[(sp->string_used)++] = CharOf(c);
} else if (sp->parsestate != esc_table) {
/* if we were accumulating, we're not any more */
sp->string_mode = 0;
sp->string_used = 0;
}
DumpParams();
TRACE(("parse %04X -> %d %s (used=%lu)\n",
c, sp->nextstate,
which_table(sp->parsestate),
(unsigned long) sp->string_used));
/*
* If the parameter list has subparameters (tokens separated by ":")
* reject any controls that do not accept subparameters.
*/
if (parms.has_subparams) {
switch (sp->nextstate) {
case CASE_GROUND_STATE:
case CASE_CSI_IGNORE:
/* FALLTHRU */
case CASE_ESC_DIGIT:
case CASE_ESC_SEMI:
case CASE_ESC_COLON:
/* these states are required to parse parameter lists */
break;
case CASE_SGR:
TRACE(("...possible subparam usage\n"));
break;
case CASE_CSI_DEC_DOLLAR_STATE:
case CASE_CSI_DOLLAR_STATE:
case CASE_CSI_EX_STATE:
case CASE_CSI_QUOTE_STATE:
case CASE_CSI_SPACE_STATE:
case CASE_CSI_STAR_STATE:
case CASE_CSI_TICK_STATE:
case CASE_DEC2_STATE:
case CASE_DEC3_STATE:
case CASE_DEC_STATE:
/* use this branch when we do not yet have the final character */
TRACE(("...unexpected subparam usage\n"));
ParamsDone();
sp->nextstate = CASE_CSI_IGNORE;
break;
default:
/* use this branch for cases where we have the final character
* in the table that processed the parameter list.
*/
TRACE(("...unexpected subparam usage\n"));
ResetState(sp);
continue;
}
}
if (xw->misc.palette_changed) {
repaintWhenPaletteChanged(xw, sp);
}
switch (sp->nextstate) {
case CASE_PRINT:
TRACE(("CASE_PRINT - printable characters\n"));
break;
case CASE_GROUND_STATE:
TRACE(("CASE_GROUND_STATE - exit ignore mode\n"));
ResetState(sp);
break;
case CASE_IGNORE:
TRACE(("CASE_IGNORE - Ignore character %02X\n", c));
break;
case CASE_ENQ:
TRACE(("CASE_ENQ - answerback\n"));
for (count = 0; screen->answer_back[count] != 0; count++)
unparseputc(xw, screen->answer_back[count]);
unparse_end(xw);
break;
case CASE_BELL:
TRACE(("CASE_BELL - bell\n"));
if (sp->string_mode == ANSI_OSC) {
if (sp->string_used)
sp->string_area[--(sp->string_used)] = '\0';
do_osc(xw, sp->string_area, sp->string_used, (int) c);
ResetState(sp);
} else {
/* bell */
Bell(xw, XkbBI_TerminalBell, 0);
}
break;
case CASE_BS:
TRACE(("CASE_BS - backspace\n"));
CursorBack(xw, 1);
break;
case CASE_CR:
TRACE(("CASE_CR\n"));
CarriageReturn(xw);
break;
case CASE_ESC:
if_OPT_VT52_MODE(screen, {
sp->parsestate = vt52_esc_table;
break;
});
sp->parsestate = esc_table;
break;
#if OPT_VT52_MODE
case CASE_VT52_CUP:
TRACE(("CASE_VT52_CUP - VT52 cursor addressing\n"));
sp->vt52_cup = True;
InitParams();
break;
case CASE_VT52_IGNORE:
TRACE(("CASE_VT52_IGNORE - VT52 ignore-character\n"));
sp->parsestate = vt52_ignore_table;
break;
#endif
case CASE_VMOT:
TRACE(("CASE_VMOT\n"));
/*
* form feed, line feed, vertical tab
*/
xtermAutoPrint(xw, c);
xtermIndex(xw, 1);
if (xw->flags & LINEFEED)
CarriageReturn(xw);
else
do_xevents();
break;
case CASE_CBT:
TRACE(("CASE_CBT\n"));
/* cursor backward tabulation */
count = one_if_default(0);
while ((count-- > 0)
&& (TabToPrevStop(xw))) ;
ResetState(sp);
break;
case CASE_CHT:
TRACE(("CASE_CHT\n"));
/* cursor forward tabulation */
count = one_if_default(0);
while ((count-- > 0)
&& (TabToNextStop(xw))) ;
ResetState(sp);
break;
case CASE_TAB:
/* tab */
TabToNextStop(xw);
break;
case CASE_SI:
screen->curgl = 0;
if_OPT_VT52_MODE(screen, {
ResetState(sp);
});
break;
case CASE_SO:
screen->curgl = 1;
if_OPT_VT52_MODE(screen, {
ResetState(sp);
});
break;
case CASE_DECDHL:
xterm_DECDHL(xw, c == '3');
ResetState(sp);
break;
case CASE_DECSWL:
xterm_DECSWL(xw);
ResetState(sp);
break;
case CASE_DECDWL:
xterm_DECDWL(xw);
ResetState(sp);
break;
case CASE_SCR_STATE:
/* enter scr state */
sp->parsestate = scrtable;
break;
case CASE_SCS0_STATE:
/* enter scs state 0 */
select_charset(sp, 0, 94);
break;
case CASE_SCS1_STATE:
/* enter scs state 1 */
select_charset(sp, 1, 94);
break;
case CASE_SCS2_STATE:
/* enter scs state 2 */
select_charset(sp, 2, 94);
break;
case CASE_SCS3_STATE:
/* enter scs state 3 */
select_charset(sp, 3, 94);
break;
case CASE_SCS1A_STATE:
/* enter scs state 1 */
select_charset(sp, 1, 96);
break;
case CASE_SCS2A_STATE:
/* enter scs state 2 */
select_charset(sp, 2, 96);
break;
case CASE_SCS3A_STATE:
/* enter scs state 3 */
select_charset(sp, 3, 96);
break;
case CASE_ESC_IGNORE:
/* unknown escape sequence */
sp->parsestate = eigtable;
break;
case CASE_ESC_DIGIT:
/* digit in csi or dec mode */
if (nparam > 0) {
value = zero_if_default(nparam - 1);
SetParam(nparam - 1, (10 * value) + ((int) c - '0'));
if (GetParam(nparam - 1) > 65535)
SetParam(nparam - 1, 65535);
if (sp->parsestate == csi_table)
sp->parsestate = csi2_table;
}
break;
case CASE_ESC_SEMI:
/* semicolon in csi or dec mode */
if (nparam < NPARAM) {
parms.is_sub[nparam] = 0;
SetParam(nparam++, DEFAULT);
}
if (sp->parsestate == csi_table)
sp->parsestate = csi2_table;
break;
/*
* A _few_ commands accept colon-separated subparameters.
* Mark the parameter list so that we can exclude (most) bogus
* commands with simple/fast checks.
*/
case CASE_ESC_COLON:
if (nparam < NPARAM) {
parms.has_subparams = 1;
if (nparam == 0) {
parms.is_sub[nparam] = 1;
SetParam(nparam++, DEFAULT);
} else if (parms.is_sub[nparam - 1] == 0) {
parms.is_sub[nparam - 1] = 1;
parms.is_sub[nparam] = 2;
parms.params[nparam] = 0;
++nparam;
} else {
parms.is_sub[nparam] = 1 + parms.is_sub[nparam - 1];
parms.params[nparam] = 0;
++nparam;
}
}
break;
case CASE_DEC_STATE:
/* enter dec mode */
sp->parsestate = dec_table;
break;
case CASE_DEC2_STATE:
/* enter dec2 mode */
sp->parsestate = dec2_table;
break;
case CASE_DEC3_STATE:
/* enter dec3 mode */
sp->parsestate = dec3_table;
break;
case CASE_ICH:
TRACE(("CASE_ICH - insert char\n"));
InsertChar(xw, (unsigned) one_if_default(0));
ResetState(sp);
break;
case CASE_CUU:
TRACE(("CASE_CUU - cursor up\n"));
CursorUp(screen, one_if_default(0));
ResetState(sp);
break;
case CASE_CUD:
TRACE(("CASE_CUD - cursor down\n"));
CursorDown(screen, one_if_default(0));
ResetState(sp);
break;
case CASE_CUF:
TRACE(("CASE_CUF - cursor forward\n"));
CursorForward(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_CUB:
TRACE(("CASE_CUB - cursor backward\n"));
CursorBack(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_CUP:
TRACE(("CASE_CUP - cursor position\n"));
if_OPT_XMC_GLITCH(screen, {
Jump_XMC(xw);
});
CursorSet(screen, one_if_default(0) - 1, one_if_default(1) - 1, xw->flags);
ResetState(sp);
break;
case CASE_VPA:
TRACE(("CASE_VPA - vertical position absolute\n"));
CursorSet(screen, one_if_default(0) - 1, CursorCol(xw), xw->flags);
ResetState(sp);
break;
case CASE_HPA:
TRACE(("CASE_HPA - horizontal position absolute\n"));
CursorSet(screen, CursorRow(xw), one_if_default(0) - 1, xw->flags);
ResetState(sp);
break;
case CASE_VPR:
TRACE(("CASE_VPR - vertical position relative\n"));
CursorSet(screen,
CursorRow(xw) + one_if_default(0),
CursorCol(xw),
xw->flags);
ResetState(sp);
break;
case CASE_HPR:
TRACE(("CASE_HPR - horizontal position relative\n"));
CursorSet(screen,
CursorRow(xw),
CursorCol(xw) + one_if_default(0),
xw->flags);
ResetState(sp);
break;
case CASE_HP_BUGGY_LL:
TRACE(("CASE_HP_BUGGY_LL\n"));
/* Some HP-UX applications have the bug that they
assume ESC F goes to the lower left corner of
the screen, regardless of what terminfo says. */
if (screen->hp_ll_bc)
CursorSet(screen, screen->max_row, 0, xw->flags);
ResetState(sp);
break;
case CASE_ED:
TRACE(("CASE_ED - erase display\n"));
do_cd_xtra_scroll(xw);
do_erase_display(xw, zero_if_default(0), OFF_PROTECT);
ResetState(sp);
break;
case CASE_EL:
TRACE(("CASE_EL - erase line\n"));
do_erase_line(xw, zero_if_default(0), OFF_PROTECT);
ResetState(sp);
break;
case CASE_ECH:
TRACE(("CASE_ECH - erase char\n"));
/* ECH */
ClearRight(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_IL:
TRACE(("CASE_IL - insert line\n"));
set_cur_col(screen, ScrnLeftMargin(xw));
InsertLine(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_DL:
TRACE(("CASE_DL - delete line\n"));
set_cur_col(screen, ScrnLeftMargin(xw));
DeleteLine(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_DCH:
TRACE(("CASE_DCH - delete char\n"));
DeleteChar(xw, (unsigned) one_if_default(0));
ResetState(sp);
break;
case CASE_TRACK_MOUSE:
/*
* A single parameter other than zero is always scroll-down.
* A zero-parameter is used to reset the mouse mode, and is
* not useful for scrolling anyway.
*/
if (nparam > 1 || GetParam(0) == 0) {
CELL start;
TRACE(("CASE_TRACK_MOUSE\n"));
/* Track mouse as long as in window and between
* specified rows
*/
start.row = one_if_default(2) - 1;
start.col = GetParam(1) - 1;
TrackMouse(xw,
GetParam(0),
&start,
GetParam(3) - 1, GetParam(4) - 2);
} else {
TRACE(("CASE_SD - scroll down\n"));
/* SD */
RevScroll(xw, one_if_default(0));
do_xevents();
}
ResetState(sp);
break;
case CASE_DECID:
TRACE(("CASE_DECID\n"));
if_OPT_VT52_MODE(screen, {
unparseputc(xw, ANSI_ESC);
unparseputc(xw, '/');
unparseputc(xw, 'Z');
unparse_end(xw);
ResetState(sp);
break;
});
SetParam(0, DEFAULT); /* Default ID parameter */
/* FALLTHRU */
case CASE_DA1:
TRACE(("CASE_DA1\n"));
if (GetParam(0) <= 0) { /* less than means DEFAULT */
count = 0;
init_reply(ANSI_CSI);
reply.a_pintro = '?';
/*
* The first parameter corresponds to the highest operating
* level (i.e., service level) of the emulation. A DEC
* terminal can be setup to respond with a different DA
* response, but there's no control sequence that modifies
* this. We set it via a resource.
*/
if (screen->terminal_id < 200) {
switch (screen->terminal_id) {
case 125:
reply.a_param[count++] = 12; /* VT125 */
reply.a_param[count++] = 0 | 2 | 0; /* no STP, AVO, no GPO (ReGIS) */
reply.a_param[count++] = 0; /* no printer */
reply.a_param[count++] = XTERM_PATCH; /* ROM version */
break;
case 102:
reply.a_param[count++] = 6; /* VT102 */
break;
case 101:
reply.a_param[count++] = 1; /* VT101 */
reply.a_param[count++] = 0; /* no options */
break;
default: /* VT100 */
reply.a_param[count++] = 1; /* VT100 */
reply.a_param[count++] = 0 | 2 | 0; /* no STP, AVO, no GPO (ReGIS) */
break;
}
} else {
reply.a_param[count++] = (ParmType) (60
+ screen->terminal_id
/ 100);
reply.a_param[count++] = 1; /* 132-columns */
reply.a_param[count++] = 2; /* printer */
#if OPT_SIXEL_GRAPHICS
if (screen->terminal_id == 240 ||
screen->terminal_id == 241 ||
screen->terminal_id == 330 ||
screen->terminal_id == 340) {
reply.a_param[count++] = 3; /* ReGIS graphics */
reply.a_param[count++] = 4; /* sixel graphics */
}
#endif
reply.a_param[count++] = 6; /* selective-erase */
#if OPT_SUNPC_KBD
if (xw->keyboard.type == keyboardIsVT220)
#endif
reply.a_param[count++] = 8; /* user-defined-keys */
reply.a_param[count++] = 9; /* national replacement charsets */
reply.a_param[count++] = 15; /* technical characters */
if (screen->terminal_id >= 400) {
reply.a_param[count++] = 18; /* windowing capability */
reply.a_param[count++] = 21; /* horizontal scrolling */
}
if_OPT_ISO_COLORS(screen, {
reply.a_param[count++] = 22; /* ANSI color, VT525 */
});
#if OPT_DEC_LOCATOR
reply.a_param[count++] = 29; /* ANSI text locator */
#endif
}
reply.a_nparam = (ParmType) count;
reply.a_inters = 0;
reply.a_final = 'c';
unparseseq(xw, &reply);
}
ResetState(sp);
break;
case CASE_DA2:
TRACE(("CASE_DA2\n"));
if (GetParam(0) <= 0) { /* less than means DEFAULT */
count = 0;
init_reply(ANSI_CSI);
reply.a_pintro = '>';
if (screen->terminal_id >= 200) {
switch (screen->terminal_id) {
case 220:
default:
reply.a_param[count++] = 1; /* VT220 */
break;
case 240:
/* http://www.decuslib.com/DECUS/vax87a/gendyn/vt200_kind.lis */
reply.a_param[count++] = 2; /* VT240 */
break;
case 320:
/* http://www.vt100.net/docs/vt320-uu/appendixe.html */
reply.a_param[count++] = 24; /* VT320 */
break;
case 330:
reply.a_param[count++] = 18; /* VT330 */
break;
case 340:
reply.a_param[count++] = 19; /* VT340 */
break;
case 420:
reply.a_param[count++] = 41; /* VT420 */
break;
case 510:
/* http://www.vt100.net/docs/vt510-rm/DA2 */
reply.a_param[count++] = 61; /* VT510 */
break;
case 520:
reply.a_param[count++] = 64; /* VT520 */
break;
case 525:
reply.a_param[count++] = 65; /* VT525 */
break;
}
} else {
reply.a_param[count++] = 0; /* VT100 (nonstandard) */
}
reply.a_param[count++] = XTERM_PATCH; /* Version */
reply.a_param[count++] = 0; /* options (none) */
reply.a_nparam = (ParmType) count;
reply.a_inters = 0;
reply.a_final = 'c';
unparseseq(xw, &reply);
}
ResetState(sp);
break;
case CASE_DECRPTUI:
TRACE(("CASE_DECRPTUI\n"));
if ((screen->vtXX_level >= 4)
&& (GetParam(0) <= 0)) { /* less than means DEFAULT */
unparseputc1(xw, ANSI_DCS);
unparseputc(xw, '!');
unparseputc(xw, '|');
unparseputc(xw, '0');
unparseputc1(xw, ANSI_ST);
unparse_end(xw);
}
ResetState(sp);
break;
case CASE_TBC:
TRACE(("CASE_TBC - tab clear\n"));
if ((value = GetParam(0)) <= 0) /* less than means default */
TabClear(xw->tabs, screen->cur_col);
else if (value == 3)
TabZonk(xw->tabs);
ResetState(sp);
break;
case CASE_SET:
TRACE(("CASE_SET - set mode\n"));
ansi_modes(xw, bitset);
ResetState(sp);
break;
case CASE_RST:
TRACE(("CASE_RST - reset mode\n"));
ansi_modes(xw, bitclr);
ResetState(sp);
break;
case CASE_SGR:
for (item = 0; item < nparam; ++item) {
int op = GetParam(item);
if_OPT_XMC_GLITCH(screen, {
Mark_XMC(xw, op);
});
TRACE(("CASE_SGR %d\n", op));
/*
* Only SGR 38/48 accept subparameters, and in those cases
* the values will not be seen at this point.
*/
if (param_has_subparams(item)) {
switch (op) {
case 38:
case 48:
if_OPT_ISO_COLORS(screen, {
break;
});
default:
TRACE(("...unexpected subparameter in SGR\n"));
op = 9999;
ResetState(sp);
break;
}
}
switch (op) {
case DEFAULT:
case 0:
UIntClr(xw->flags,
(INVERSE | BOLD | BLINK | UNDERLINE | INVISIBLE));
if_OPT_ISO_COLORS(screen, {
reset_SGR_Colors(xw);
});
break;
case 1: /* Bold */
xw->flags |= BOLD;
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 5: /* Blink */
xw->flags |= BLINK;
StartBlinking(screen);
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 4: /* Underscore */
xw->flags |= UNDERLINE;
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 7:
xw->flags |= INVERSE;
if_OPT_ISO_COLORS(screen, {
setExtendedBG(xw);
});
break;
case 8:
xw->flags |= INVISIBLE;
break;
case 22: /* reset 'bold' */
UIntClr(xw->flags, BOLD);
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 24:
UIntClr(xw->flags, UNDERLINE);
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 25: /* reset 'blink' */
UIntClr(xw->flags, BLINK);
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
break;
case 27:
UIntClr(xw->flags, INVERSE);
if_OPT_ISO_COLORS(screen, {
setExtendedBG(xw);
});
break;
case 28:
UIntClr(xw->flags, INVISIBLE);
break;
case 30:
case 31:
case 32:
case 33:
case 34:
case 35:
case 36:
case 37:
if_OPT_ISO_COLORS(screen, {
xw->sgr_foreground = (op - 30);
xw->sgr_extended = False;
setExtendedFG(xw);
});
break;
case 38:
/* This is more complicated than I'd like, but it should
* properly eat all the parameters for unsupported modes.
*/
if_OPT_ISO_COLORS(screen, {
if (parse_extended_colors(xw, &value, &item)) {
xw->sgr_foreground = value;
xw->sgr_extended = True;
setExtendedFG(xw);
}
});
break;
case 39:
if_OPT_ISO_COLORS(screen, {
reset_SGR_Foreground(xw);
});
break;
case 40:
case 41:
case 42:
case 43:
case 44:
case 45:
case 46:
case 47:
if_OPT_ISO_COLORS(screen, {
xw->sgr_background = (op - 40);
setExtendedBG(xw);
});
break;
case 48:
if_OPT_ISO_COLORS(screen, {
if (parse_extended_colors(xw, &value, &item)) {
xw->sgr_background = value;
setExtendedBG(xw);
}
});
break;
case 49:
if_OPT_ISO_COLORS(screen, {
reset_SGR_Background(xw);
});
break;
case 90:
case 91:
case 92:
case 93:
case 94:
case 95:
case 96:
case 97:
if_OPT_AIX_COLORS(screen, {
xw->sgr_foreground = (op - 90 + 8);
xw->sgr_extended = False;
setExtendedFG(xw);
});
break;
case 100:
#if !OPT_AIX_COLORS
if_OPT_ISO_COLORS(screen, {
reset_SGR_Foreground(xw);
reset_SGR_Background(xw);
});
break;
#endif
case 101:
case 102:
case 103:
case 104:
case 105:
case 106:
case 107:
if_OPT_AIX_COLORS(screen, {
xw->sgr_background = (op - 100 + 8);
setExtendedBG(xw);
});
break;
}
}
ResetState(sp);
break;
/* DSR (except for the '?') is a superset of CPR */
case CASE_DSR:
sp->private_function = True;
/* FALLTHRU */
case CASE_CPR:
TRACE(("CASE_DSR - device status report\n"));
count = 0;
init_reply(ANSI_CSI);
reply.a_pintro = CharOf(sp->private_function ? '?' : 0);
reply.a_inters = 0;
reply.a_final = 'n';
switch (GetParam(0)) {
case 5:
TRACE(("...request operating status\n"));
/* operating status */
reply.a_param[count++] = 0; /* (no malfunction ;-) */
break;
case 6:
TRACE(("...request %s\n",
(sp->private_function
? "DECXCPR"
: "CPR")));
/* CPR */
/* DECXCPR (with page=1) */
value = (screen->cur_row + 1);
if ((xw->flags & ORIGIN) != 0) {
value -= screen->top_marg;
}
reply.a_param[count++] = (ParmType) value;
value = (screen->cur_col + 1);
if ((xw->flags & ORIGIN) != 0) {
value -= screen->lft_marg;
}
reply.a_param[count++] = (ParmType) value;
if (sp->private_function
&& screen->vtXX_level >= 4) { /* VT420 */
reply.a_param[count++] = 1;
}
reply.a_final = 'R';
break;
case 15:
TRACE(("...request printer status\n"));
if (sp->private_function
&& screen->vtXX_level >= 2) { /* VT220 */
reply.a_param[count++] = 13; /* no printer detected */
}
break;
case 25:
TRACE(("...request UDK status\n"));
if (sp->private_function
&& screen->vtXX_level >= 2) { /* VT220 */
reply.a_param[count++] = 20; /* UDK always unlocked */
}
break;
case 26:
TRACE(("...request keyboard status\n"));
if (sp->private_function
&& screen->vtXX_level >= 2) { /* VT220 */
reply.a_param[count++] = 27;
reply.a_param[count++] = 1; /* North American */
if (screen->vtXX_level >= 4) { /* VT420 */
reply.a_param[count++] = 0; /* ready */
reply.a_param[count++] = 0; /* LK201 */
}
}
break;
case 53: /* according to existing xterm handling */
case 55: /* according to the VT330/VT340 Text Programming Manual */
TRACE(("...request locator status\n"));
if (sp->private_function
&& screen->vtXX_level >= 2) { /* VT220 */
#if OPT_DEC_LOCATOR
reply.a_param[count++] = 50; /* locator ready */
#else
reply.a_param[count++] = 53; /* no locator */
#endif
}
break;
case 56:
TRACE(("...request locator type\n"));
if (sp->private_function
&& screen->vtXX_level >= 3) { /* VT330 (FIXME: what about VT220?) */
reply.a_param[count++] = 57;
#if OPT_DEC_LOCATOR
reply.a_param[count++] = 1; /* mouse */
#else
reply.a_param[count++] = 0; /* unknown */
#endif
}
break;
case 62:
TRACE(("...request DECMSR - macro space\n"));
if (sp->private_function
&& screen->vtXX_level >= 4) { /* VT420 */
reply.a_pintro = 0;
reply.a_radix[count] = 16; /* no data */
reply.a_param[count++] = 0; /* no space for macros */
reply.a_inters = '*';
reply.a_final = '{';
}
break;
case 63:
TRACE(("...request DECCKSR - memory checksum\n"));
/* DECCKSR - Memory checksum */
if (sp->private_function
&& screen->vtXX_level >= 4) { /* VT420 */
init_reply(ANSI_DCS);
reply.a_param[count++] = (ParmType) GetParam(1); /* PID */
reply.a_delim = "!~"; /* delimiter */
reply.a_radix[count] = 16; /* use hex */
reply.a_param[count++] = 0; /* no data */
}
break;
case 75:
TRACE(("...request data integrity\n"));
if (sp->private_function
&& screen->vtXX_level >= 4) { /* VT420 */
reply.a_param[count++] = 70; /* no errors */
}
break;
case 85:
TRACE(("...request multi-session configuration\n"));
if (sp->private_function
&& screen->vtXX_level >= 4) { /* VT420 */
reply.a_param[count++] = 83; /* not configured */
}
break;
default:
break;
}
if ((reply.a_nparam = (ParmType) count) != 0)
unparseseq(xw, &reply);
ResetState(sp);
sp->private_function = False;
break;
case CASE_MC:
TRACE(("CASE_MC - media control\n"));
xtermMediaControl(xw, GetParam(0), False);
ResetState(sp);
break;
case CASE_DEC_MC:
TRACE(("CASE_DEC_MC - DEC media control\n"));
xtermMediaControl(xw, GetParam(0), True);
ResetState(sp);
break;
case CASE_HP_MEM_LOCK:
case CASE_HP_MEM_UNLOCK:
TRACE(("%s\n", ((sp->parsestate[c] == CASE_HP_MEM_LOCK)
? "CASE_HP_MEM_LOCK"
: "CASE_HP_MEM_UNLOCK")));
if (screen->scroll_amt)
FlushScroll(xw);
if (sp->parsestate[c] == CASE_HP_MEM_LOCK)
set_tb_margins(screen, screen->cur_row, screen->bot_marg);
else
set_tb_margins(screen, 0, screen->bot_marg);
ResetState(sp);
break;
case CASE_DECSTBM:
TRACE(("CASE_DECSTBM - set scrolling region\n"));
{
int top;
int bot;
top = one_if_default(0);
if (nparam < 2 || (bot = GetParam(1)) == DEFAULT
|| bot > MaxRows(screen)
|| bot == 0)
bot = MaxRows(screen);
if (bot > top) {
if (screen->scroll_amt)
FlushScroll(xw);
set_tb_margins(screen, top - 1, bot - 1);
CursorSet(screen, 0, 0, xw->flags);
}
ResetState(sp);
}
break;
case CASE_DECREQTPARM:
TRACE(("CASE_DECREQTPARM\n"));
if (screen->terminal_id < 200) { /* VT102 */
value = zero_if_default(0);
if (value == 0 || value == 1) {
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 7;
reply.a_param[0] = (ParmType) (value + 2);
reply.a_param[1] = 1; /* no parity */
reply.a_param[2] = 1; /* eight bits */
reply.a_param[3] = 128; /* transmit 38.4k baud */
reply.a_param[4] = 128; /* receive 38.4k baud */
reply.a_param[5] = 1; /* clock multiplier ? */
reply.a_param[6] = 0; /* STP flags ? */
reply.a_inters = 0;
reply.a_final = 'x';
unparseseq(xw, &reply);
}
}
ResetState(sp);
break;
case CASE_DECSET:
/* DECSET */
#if OPT_VT52_MODE
if (screen->vtXX_level != 0)
#endif
dpmodes(xw, bitset);
ResetState(sp);
#if OPT_TEK4014
if (TEK4014_ACTIVE(xw))
return False;
#endif
break;
case CASE_DECRST:
/* DECRST */
dpmodes(xw, bitclr);
init_groundtable(screen, sp);
ResetState(sp);
break;
case CASE_DECALN:
TRACE(("CASE_DECALN - alignment test\n"));
if (screen->cursor_state)
HideCursor();
reset_margins(screen);
CursorSet(screen, 0, 0, xw->flags);
xtermParseRect(xw, 0, 0, &myRect);
ScrnFillRectangle(xw, &myRect, 'E', 0, False);
ResetState(sp);
break;
case CASE_GSETS:
TRACE(("CASE_GSETS(%d) = '%c'\n", sp->scstype, c));
decode_scs(xw, sp->scstype, 0, (int) c);
ResetState(sp);
break;
case CASE_ANSI_SC:
if (IsLeftRightMode(xw)) {
int left;
int right;
TRACE(("CASE_DECSLRM - set left and right margin\n"));
left = one_if_default(0);
if (nparam < 2 || (right = GetParam(1)) == DEFAULT
|| right > MaxCols(screen)
|| right == 0)
right = MaxCols(screen);
if (right > left) {
set_lr_margins(screen, left - 1, right - 1);
CursorSet(screen, 0, 0, xw->flags);
}
} else {
TRACE(("CASE_ANSI_SC - save cursor\n"));
CursorSave(xw);
}
ResetState(sp);
break;
case CASE_DECSC:
TRACE(("CASE_DECSC - save cursor\n"));
CursorSave(xw);
ResetState(sp);
break;
case CASE_ANSI_RC:
case CASE_DECRC:
TRACE(("CASE_%sRC - restore cursor\n",
(sp->nextstate == CASE_DECRC) ? "DEC" : "ANSI_"));
CursorRestore(xw);
if_OPT_ISO_COLORS(screen, {
setExtendedFG(xw);
});
ResetState(sp);
break;
case CASE_DECKPAM:
TRACE(("CASE_DECKPAM\n"));
xw->keyboard.flags |= MODE_DECKPAM;
update_appkeypad();
ResetState(sp);
break;
case CASE_DECKPNM:
TRACE(("CASE_DECKPNM\n"));
UIntClr(xw->keyboard.flags, MODE_DECKPAM);
update_appkeypad();
ResetState(sp);
break;
case CASE_CSI_QUOTE_STATE:
sp->parsestate = csi_quo_table;
break;
#if OPT_BLINK_CURS
case CASE_CSI_SPACE_STATE:
sp->parsestate = csi_sp_table;
break;
case CASE_DECSCUSR:
TRACE(("CASE_DECSCUSR\n"));
{
Boolean change = True;
Boolean blinks = screen->cursor_blink_esc;
HideCursor();
switch (GetParam(0)) {
case DEFAULT:
case DEFAULT_STYLE:
case BLINK_BLOCK:
blinks = True;
screen->cursor_shape = CURSOR_BLOCK;
break;
case STEADY_BLOCK:
blinks = False;
screen->cursor_shape = CURSOR_BLOCK;
break;
case BLINK_UNDERLINE:
blinks = True;
screen->cursor_shape = CURSOR_UNDERLINE;
break;
case STEADY_UNDERLINE:
blinks = False;
screen->cursor_shape = CURSOR_UNDERLINE;
break;
case BLINK_BAR:
blinks = True;
screen->cursor_shape = CURSOR_BAR;
break;
case STEADY_BAR:
blinks = False;
screen->cursor_shape = CURSOR_BAR;
break;
default:
change = False;
break;
}
if (change) {
xtermSetCursorBox(screen);
screen->cursor_blink_esc = blinks;
UpdateCursorBlink(screen);
}
}
ResetState(sp);
break;
#endif
#if OPT_SCROLL_LOCK
case CASE_DECLL:
TRACE(("CASE_DECLL\n"));
if (nparam > 0) {
for (count = 0; count < nparam; ++count) {
int op = zero_if_default(count);
switch (op) {
case 0:
case DEFAULT:
xtermClearLEDs(screen);
break;
case 1:
case 2:
case 3:
xtermShowLED(screen,
(Cardinal) op,
True);
break;
case 21:
case 22:
case 23:
xtermShowLED(screen,
(Cardinal) (op - 20),
True);
break;
}
}
} else {
xtermClearLEDs(screen);
}
ResetState(sp);
break;
#endif
#if OPT_VT52_MODE
case CASE_VT52_FINISH:
TRACE(("CASE_VT52_FINISH terminal_id %d, vtXX_level %d\n",
screen->terminal_id,
screen->vtXX_level));
if (screen->terminal_id >= 100
&& screen->vtXX_level == 0) {
sp->groundtable =
sp->parsestate = ansi_table;
/*
* On restore, the terminal does not recognize DECRQSS for
* DECSCL (per vttest).
*/
screen->vtXX_level = 1;
screen->curgl = screen->vt52_save_curgl;
screen->curgr = screen->vt52_save_curgr;
screen->curss = screen->vt52_save_curss;
memmove(screen->gsets, screen->vt52_save_gsets, sizeof(screen->gsets));
}
break;
#endif
case CASE_ANSI_LEVEL_1:
TRACE(("CASE_ANSI_LEVEL_1\n"));
set_ansi_conformance(screen, 1);
ResetState(sp);
break;
case CASE_ANSI_LEVEL_2:
TRACE(("CASE_ANSI_LEVEL_2\n"));
set_ansi_conformance(screen, 2);
ResetState(sp);
break;
case CASE_ANSI_LEVEL_3:
TRACE(("CASE_ANSI_LEVEL_3\n"));
set_ansi_conformance(screen, 3);
ResetState(sp);
break;
case CASE_DECSCL:
TRACE(("CASE_DECSCL(%d,%d)\n", GetParam(0), GetParam(1)));
/*
* This changes the emulation level, and is not recognized by
* VT100s.
*/
if (screen->terminal_id >= 200) {
/*
* Disallow unrecognized parameters, as well as attempts to set
* the operating level higher than the given terminal-id.
*/
if (GetParam(0) >= 61
&& GetParam(0) <= 60 + (screen->terminal_id / 100)) {
/*
* VT300, VT420, VT520 manuals claim that DECSCL does a
* hard reset (RIS). VT220 manual states that it is a soft
* reset. Perhaps both are right (unlikely). Kermit says
* it's soft.
*/
ReallyReset(xw, False, False);
init_parser(xw, sp);
screen->vtXX_level = GetParam(0) - 60;
if (GetParam(0) > 61) {
switch (zero_if_default(1)) {
case 1:
show_8bit_control(False);
break;
case 0:
case 2:
show_8bit_control(True);
break;
}
}
}
}
ResetState(sp);
break;
case CASE_DECSCA:
TRACE(("CASE_DECSCA\n"));
screen->protected_mode = DEC_PROTECT;
if (GetParam(0) <= 0 || GetParam(0) == 2) {
UIntClr(xw->flags, PROTECTED);
TRACE(("...clear PROTECTED\n"));
} else if (GetParam(0) == 1) {
xw->flags |= PROTECTED;
TRACE(("...set PROTECTED\n"));
}
ResetState(sp);
break;
case CASE_DECSED:
TRACE(("CASE_DECSED\n"));
do_erase_display(xw, zero_if_default(0), DEC_PROTECT);
ResetState(sp);
break;
case CASE_DECSEL:
TRACE(("CASE_DECSEL\n"));
do_erase_line(xw, zero_if_default(0), DEC_PROTECT);
ResetState(sp);
break;
case CASE_ST:
TRACE(("CASE_ST: End of String (%lu bytes) (mode=%d)\n",
(unsigned long) sp->string_used,
sp->string_mode));
ResetState(sp);
if (!sp->string_used)
break;
sp->string_area[--(sp->string_used)] = '\0';
switch (sp->string_mode) {
case ANSI_APC:
/* ignored */
break;
case ANSI_DCS:
do_dcs(xw, sp->string_area, sp->string_used);
break;
case ANSI_OSC:
do_osc(xw, sp->string_area, sp->string_used, ANSI_ST);
break;
case ANSI_PM:
/* ignored */
break;
case ANSI_SOS:
/* ignored */
break;
default:
TRACE(("unknown mode\n"));
break;
}
break;
case CASE_SOS:
TRACE(("CASE_SOS: Start of String\n"));
if (ParseSOS(screen)) {
sp->string_mode = ANSI_SOS;
sp->parsestate = sos_table;
} else {
illegal_parse(xw, c, sp);
}
break;
case CASE_PM:
TRACE(("CASE_PM: Privacy Message\n"));
if (ParseSOS(screen)) {
sp->string_mode = ANSI_PM;
sp->parsestate = sos_table;
} else {
illegal_parse(xw, c, sp);
}
break;
case CASE_DCS:
TRACE(("CASE_DCS: Device Control String\n"));
sp->string_mode = ANSI_DCS;
sp->parsestate = sos_table;
break;
case CASE_APC:
TRACE(("CASE_APC: Application Program Command\n"));
if (ParseSOS(screen)) {
sp->string_mode = ANSI_APC;
sp->parsestate = sos_table;
} else {
illegal_parse(xw, c, sp);
}
break;
case CASE_SPA:
TRACE(("CASE_SPA - start protected area\n"));
screen->protected_mode = ISO_PROTECT;
xw->flags |= PROTECTED;
ResetState(sp);
break;
case CASE_EPA:
TRACE(("CASE_EPA - end protected area\n"));
UIntClr(xw->flags, PROTECTED);
ResetState(sp);
break;
case CASE_SU:
TRACE(("CASE_SU - scroll up\n"));
xtermScroll(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_SL: /* ISO 6429, non-DEC */
TRACE(("CASE_SL - scroll left\n"));
xtermScrollLR(xw, one_if_default(0), True);
ResetState(sp);
break;
case CASE_SR: /* ISO 6429, non-DEC */
TRACE(("CASE_SR - scroll right\n"));
xtermScrollLR(xw, one_if_default(0), False);
ResetState(sp);
break;
case CASE_DECDC:
TRACE(("CASE_DC - delete column\n"));
if (screen->vtXX_level >= 4
&& IsLeftRightMode(xw)) {
xtermColScroll(xw, one_if_default(0), True, screen->cur_col);
}
ResetState(sp);
break;
case CASE_DECIC:
TRACE(("CASE_IC - insert column\n"));
if (screen->vtXX_level >= 4
&& IsLeftRightMode(xw)) {
xtermColScroll(xw, one_if_default(0), False, screen->cur_col);
}
ResetState(sp);
break;
case CASE_DECBI:
TRACE(("CASE_BI - back index\n"));
if (screen->vtXX_level >= 4) {
xtermColIndex(xw, True);
}
ResetState(sp);
break;
case CASE_DECFI:
TRACE(("CASE_FI - forward index\n"));
if (screen->vtXX_level >= 4) {
xtermColIndex(xw, False);
}
ResetState(sp);
break;
case CASE_IND:
TRACE(("CASE_IND - index\n"));
xtermIndex(xw, 1);
do_xevents();
ResetState(sp);
break;
case CASE_CPL:
TRACE(("CASE_CPL - cursor prev line\n"));
CursorPrevLine(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_CNL:
TRACE(("CASE_CNL - cursor next line\n"));
CursorNextLine(xw, one_if_default(0));
ResetState(sp);
break;
case CASE_NEL:
TRACE(("CASE_NEL\n"));
xtermIndex(xw, 1);
CarriageReturn(xw);
ResetState(sp);
break;
case CASE_HTS:
TRACE(("CASE_HTS - horizontal tab set\n"));
TabSet(xw->tabs, screen->cur_col);
ResetState(sp);
break;
case CASE_RI:
TRACE(("CASE_RI - reverse index\n"));
RevIndex(xw, 1);
ResetState(sp);
break;
case CASE_SS2:
TRACE(("CASE_SS2\n"));
screen->curss = 2;
ResetState(sp);
break;
case CASE_SS3:
TRACE(("CASE_SS3\n"));
screen->curss = 3;
ResetState(sp);
break;
case CASE_CSI_STATE:
/* enter csi state */
InitParams();
SetParam(nparam++, DEFAULT);
sp->parsestate = csi_table;
break;
case CASE_ESC_SP_STATE:
/* esc space */
sp->parsestate = esc_sp_table;
break;
case CASE_CSI_EX_STATE:
/* csi exclamation */
sp->parsestate = csi_ex_table;
break;
#if OPT_DEC_LOCATOR
case CASE_CSI_TICK_STATE:
/* csi tick (') */
sp->parsestate = csi_tick_table;
break;
case CASE_DECEFR:
TRACE(("CASE_DECEFR - Enable Filter Rectangle\n"));
if (screen->send_mouse_pos == DEC_LOCATOR) {
MotionOff(screen, xw);
if ((screen->loc_filter_top = GetParam(0)) < 1)
screen->loc_filter_top = LOC_FILTER_POS;
if (nparam < 2
|| (screen->loc_filter_left = GetParam(1)) < 1)
screen->loc_filter_left = LOC_FILTER_POS;
if (nparam < 3
|| (screen->loc_filter_bottom = GetParam(2)) < 1)
screen->loc_filter_bottom = LOC_FILTER_POS;
if (nparam < 4
|| (screen->loc_filter_right = GetParam(3)) < 1)
screen->loc_filter_right = LOC_FILTER_POS;
InitLocatorFilter(xw);
}
ResetState(sp);
break;
case CASE_DECELR:
MotionOff(screen, xw);
if (GetParam(0) <= 0 || GetParam(0) > 2) {
screen->send_mouse_pos = MOUSE_OFF;
TRACE(("DECELR - Disable Locator Reports\n"));
} else {
TRACE(("DECELR - Enable Locator Reports\n"));
screen->send_mouse_pos = DEC_LOCATOR;
xtermShowPointer(xw, True);
if (GetParam(0) == 2) {
screen->locator_reset = True;
} else {
screen->locator_reset = False;
}
if (nparam < 2 || GetParam(1) != 1) {
screen->locator_pixels = False;
} else {
screen->locator_pixels = True;
}
screen->loc_filter = False;
}
ResetState(sp);
break;
case CASE_DECSLE:
TRACE(("DECSLE - Select Locator Events\n"));
for (count = 0; count < nparam; ++count) {
switch (zero_if_default(count)) {
case 0:
MotionOff(screen, xw);
screen->loc_filter = False;
screen->locator_events = 0;
break;
case 1:
screen->locator_events |= LOC_BTNS_DN;
break;
case 2:
UIntClr(screen->locator_events, LOC_BTNS_DN);
break;
case 3:
screen->locator_events |= LOC_BTNS_UP;
break;
case 4:
UIntClr(screen->locator_events, LOC_BTNS_UP);
break;
}
}
ResetState(sp);
break;
case CASE_DECRQLP:
TRACE(("DECRQLP - Request Locator Position\n"));
if (GetParam(0) < 2) {
/* Issue DECLRP Locator Position Report */
GetLocatorPosition(xw);
}
ResetState(sp);
break;
#endif /* OPT_DEC_LOCATOR */
#if OPT_DEC_RECTOPS
case CASE_CSI_DOLLAR_STATE:
TRACE(("CASE_CSI_DOLLAR_STATE\n"));
/* csi dollar ($) */
if (screen->vtXX_level >= 3)
sp->parsestate = csi_dollar_table;
else
sp->parsestate = eigtable;
break;
case CASE_CSI_STAR_STATE:
TRACE(("CASE_CSI_STAR_STATE\n"));
/* csi star (*) */
if (screen->vtXX_level >= 4)
sp->parsestate = csi_star_table;
else
sp->parsestate = eigtable;
break;
case CASE_DECRQCRA:
if (screen->vtXX_level >= 4) {
int checksum;
TRACE(("CASE_DECRQCRA - Request checksum of rectangular area\n"));
xtermCheckRect(xw, ParamPair(0), &checksum);
init_reply(ANSI_DCS);
count = 0;
reply.a_param[count++] = (ParmType) GetParam(1); /* PID */
reply.a_delim = "!~"; /* delimiter */
reply.a_radix[count] = 16;
reply.a_param[count++] = (ParmType) checksum;
reply.a_nparam = (ParmType) count;
unparseseq(xw, &reply);
}
ResetState(sp);
break;
case CASE_DECCRA:
if (screen->vtXX_level >= 4) {
TRACE(("CASE_DECCRA - Copy rectangular area\n"));
xtermParseRect(xw, ParamPair(0), &myRect);
ScrnCopyRectangle(xw, &myRect, ParamPair(5));
}
ResetState(sp);
break;
case CASE_DECERA:
if (screen->vtXX_level >= 4) {
TRACE(("CASE_DECERA - Erase rectangular area\n"));
xtermParseRect(xw, ParamPair(0), &myRect);
ScrnFillRectangle(xw, &myRect, ' ', 0, True);
}
ResetState(sp);
break;
case CASE_DECFRA:
if (screen->vtXX_level >= 4) {
value = zero_if_default(0);
TRACE(("CASE_DECFRA - Fill rectangular area\n"));
if (nparam > 0
&& ((value >= 32 && value <= 126)
|| (value >= 160 && value <= 255))) {
xtermParseRect(xw, ParamPair(1), &myRect);
ScrnFillRectangle(xw, &myRect, value, xw->flags, True);
}
}
ResetState(sp);
break;
case CASE_DECSERA:
if (screen->vtXX_level >= 4) {
TRACE(("CASE_DECSERA - Selective erase rectangular area\n"));
xtermParseRect(xw, ParamPair(0), &myRect);
ScrnWipeRectangle(xw, &myRect);
}
ResetState(sp);
break;
case CASE_DECSACE:
TRACE(("CASE_DECSACE - Select attribute change extent\n"));
screen->cur_decsace = zero_if_default(0);
ResetState(sp);
break;
case CASE_DECCARA:
if (screen->vtXX_level >= 4) {
TRACE(("CASE_DECCARA - Change attributes in rectangular area\n"));
xtermParseRect(xw, ParamPair(0), &myRect);
ScrnMarkRectangle(xw, &myRect, False, ParamPair(4));
}
ResetState(sp);
break;
case CASE_DECRARA:
if (screen->vtXX_level >= 4) {
TRACE(("CASE_DECRARA - Reverse attributes in rectangular area\n"));
xtermParseRect(xw, ParamPair(0), &myRect);
ScrnMarkRectangle(xw, &myRect, True, ParamPair(4));
}
ResetState(sp);
break;
case CASE_RQM:
TRACE(("CASE_RQM\n"));
do_rpm(xw, ParamPair(0));
ResetState(sp);
break;
case CASE_DECRQM:
TRACE(("CASE_DECRQM\n"));
do_decrpm(xw, ParamPair(0));
ResetState(sp);
break;
case CASE_CSI_DEC_DOLLAR_STATE:
TRACE(("CASE_CSI_DEC_DOLLAR_STATE\n"));
/* csi ? dollar ($) */
sp->parsestate = csi_dec_dollar_table;
break;
#else
case CASE_CSI_DOLLAR_STATE:
/* csi dollar ($) */
sp->parsestate = eigtable;
break;
case CASE_CSI_STAR_STATE:
/* csi dollar (*) */
sp->parsestate = eigtable;
break;
case CASE_CSI_DEC_DOLLAR_STATE:
/* csi ? dollar ($) */
sp->parsestate = eigtable;
break;
#endif /* OPT_DEC_RECTOPS */
case CASE_S7C1T:
TRACE(("CASE_S7C1T\n"));
if (screen->vtXX_level >= 2) {
show_8bit_control(False);
ResetState(sp);
}
break;
case CASE_S8C1T:
TRACE(("CASE_S8C1T\n"));
if (screen->vtXX_level >= 2) {
#if OPT_VT52_MODE
if (screen->vtXX_level <= 1)
break;
#endif
show_8bit_control(True);
ResetState(sp);
}
break;
case CASE_OSC:
TRACE(("CASE_OSC: Operating System Command\n"));
sp->parsestate = sos_table;
sp->string_mode = ANSI_OSC;
break;
case CASE_RIS:
TRACE(("CASE_RIS\n"));
VTReset(xw, True, True);
ResetState(sp);
break;
case CASE_DECSTR:
TRACE(("CASE_DECSTR\n"));
VTReset(xw, False, False);
ResetState(sp);
break;
case CASE_REP:
TRACE(("CASE_REP\n"));
if (sp->lastchar >= 0 &&
sp->lastchar < 256 &&
sp->groundtable[E2A(sp->lastchar)] == CASE_PRINT) {
IChar repeated[2];
count = one_if_default(0);
repeated[0] = (IChar) sp->lastchar;
while (count-- > 0) {
dotext(xw,
screen->gsets[(int) (screen->curgl)],
repeated, 1);
}
}
ResetState(sp);
break;
case CASE_LS2:
TRACE(("CASE_LS2\n"));
screen->curgl = 2;
ResetState(sp);
break;
case CASE_LS3:
TRACE(("CASE_LS3\n"));
screen->curgl = 3;
ResetState(sp);
break;
case CASE_LS3R:
TRACE(("CASE_LS3R\n"));
screen->curgr = 3;
ResetState(sp);
break;
case CASE_LS2R:
TRACE(("CASE_LS2R\n"));
screen->curgr = 2;
ResetState(sp);
break;
case CASE_LS1R:
TRACE(("CASE_LS1R\n"));
screen->curgr = 1;
ResetState(sp);
break;
case CASE_XTERM_SAVE:
savemodes(xw);
ResetState(sp);
break;
case CASE_XTERM_RESTORE:
restoremodes(xw);
ResetState(sp);
break;
case CASE_XTERM_WINOPS:
TRACE(("CASE_XTERM_WINOPS\n"));
window_ops(xw);
ResetState(sp);
break;
#if OPT_WIDE_CHARS
case CASE_ESC_PERCENT:
TRACE(("CASE_ESC_PERCENT\n"));
sp->parsestate = esc_pct_table;
break;
case CASE_UTF8:
/* If we did not set UTF-8 mode from resource or the
* command-line, allow it to be enabled/disabled by
* control sequence.
*/
if (screen->wide_chars
&& screen->utf8_mode != uAlways) {
if (!screen->wide_chars) {
WriteNow();
ChangeToWide(xw);
}
switchPtyData(screen, c == 'G');
TRACE(("UTF8 mode %s\n",
BtoS(screen->utf8_mode)));
} else {
TRACE(("UTF8 mode NOT turned %s (%s)\n",
BtoS(c == 'G'),
(screen->utf8_mode == uAlways)
? "UTF-8 mode set from command-line"
: "wideChars resource was not set"));
}
ResetState(sp);
break;
case CASE_SCS_PERCENT:
TRACE(("CASE_SCS_PERCENT\n"));
sp->parsestate = scs_pct_table;
break;
case CASE_GSETS_PERCENT:
TRACE(("CASE_GSETS_PERCENT(%d) = '%c'\n", sp->scstype, c));
decode_scs(xw, sp->scstype, '%', (int) c);
ResetState(sp);
break;
#endif
#if OPT_MOD_FKEYS
case CASE_SET_MOD_FKEYS:
TRACE(("CASE_SET_MOD_FKEYS\n"));
if (nparam >= 1) {
set_mod_fkeys(xw,
GetParam(0),
((nparam > 1)
? GetParam(1)
: DEFAULT),
True);
} else {
for (value = 1; value <= 5; ++value)
set_mod_fkeys(xw, value, DEFAULT, True);
}
break;
case CASE_SET_MOD_FKEYS0:
TRACE(("CASE_SET_MOD_FKEYS0\n"));
if (nparam >= 1 && GetParam(0) != DEFAULT) {
set_mod_fkeys(xw, GetParam(0), -1, False);
} else {
xw->keyboard.modify_now.function_keys = -1;
}
break;
#endif
case CASE_HIDE_POINTER:
TRACE(("CASE_HIDE_POINTER\n"));
if (nparam >= 1 && GetParam(0) != DEFAULT) {
screen->pointer_mode = GetParam(0);
} else {
screen->pointer_mode = DEF_POINTER_MODE;
}
break;
case CASE_SM_TITLE:
TRACE(("CASE_SM_TITLE\n"));
if (nparam >= 1) {
int n;
for (n = 0; n < nparam; ++n) {
if (GetParam(n) != DEFAULT)
screen->title_modes |= (1 << GetParam(n));
}
} else {
screen->title_modes = DEF_TITLE_MODES;
}
TRACE(("...title_modes %#x\n", screen->title_modes));
break;
case CASE_RM_TITLE:
TRACE(("CASE_RM_TITLE\n"));
if (nparam >= 1) {
int n;
for (n = 0; n < nparam; ++n) {
if (GetParam(n) != DEFAULT)
screen->title_modes &= ~(1 << GetParam(n));
}
} else {
screen->title_modes = DEF_TITLE_MODES;
}
TRACE(("...title_modes %#x\n", screen->title_modes));
break;
case CASE_CSI_IGNORE:
sp->parsestate = cigtable;
break;
case CASE_DECSWBV:
TRACE(("CASE_DECSWBV\n"));
switch (zero_if_default(0)) {
case 2:
case 3:
case 4:
screen->warningVolume = bvLow;
break;
case 5:
case 6:
case 7:
case 8:
screen->warningVolume = bvHigh;
break;
default:
screen->warningVolume = bvOff;
break;
}
TRACE(("...warningVolume %d\n", screen->warningVolume));
ResetState(sp);
break;
case CASE_DECSMBV:
TRACE(("CASE_DECSMBV\n"));
switch (zero_if_default(0)) {
case 2:
case 3:
case 4:
screen->marginVolume = bvLow;
break;
case 0:
case 5:
case 6:
case 7:
case 8:
screen->marginVolume = bvHigh;
break;
default:
screen->marginVolume = bvOff;
break;
}
TRACE(("...marginVolume %d\n", screen->marginVolume));
ResetState(sp);
break;
}
if (sp->parsestate == sp->groundtable)
sp->lastchar = thischar;
} while (0);
#if OPT_WIDE_CHARS
screen->utf8_inparse = (Boolean) ((screen->utf8_mode != uFalse)
&& (sp->parsestate != sos_table));
#endif
return True;
}
static void
VTparse(XtermWidget xw)
{
/* We longjmp back to this point in VTReset() */
(void) setjmp(vtjmpbuf);
init_parser(xw, &myState);
do {
} while (doparsing(xw, doinput(), &myState));
}
static Char *v_buffer; /* pointer to physical buffer */
static Char *v_bufstr = NULL; /* beginning of area to write */
static Char *v_bufptr; /* end of area to write */
static Char *v_bufend; /* end of physical buffer */
/* Write data to the pty as typed by the user, pasted with the mouse,
or generated by us in response to a query ESC sequence. */
void
v_write(int f, const Char *data, unsigned len)
{
int riten;
TRACE2(("v_write(%d:%s)\n", len, visibleChars(data, len)));
if (v_bufstr == NULL) {
if (len > 0) {
v_buffer = (Char *) XtMalloc((Cardinal) len);
v_bufstr = v_buffer;
v_bufptr = v_buffer;
v_bufend = v_buffer + len;
}
if (v_bufstr == NULL) {
return;
}
}
if_DEBUG({
fprintf(stderr, "v_write called with %d bytes (%ld left over)",
len, (long) (v_bufptr - v_bufstr));
if (len > 1 && len < 10)
fprintf(stderr, " \"%.*s\"", len, (const char *) data);
fprintf(stderr, "\n");
});
#ifdef VMS
if ((1 << f) != pty_mask) {
tt_write((const char *) data, len);
return;
}
#else /* VMS */
if (!FD_ISSET(f, &pty_mask)) {
IGNORE_RC(write(f, (const char *) data, (size_t) len));
return;
}
#endif /* VMS */
/*
* Append to the block we already have.
* Always doing this simplifies the code, and
* isn't too bad, either. If this is a short
* block, it isn't too expensive, and if this is
* a long block, we won't be able to write it all
* anyway.
*/
if (len > 0) {
#if OPT_DABBREV
TScreenOf(term)->dabbrev_working = False; /* break dabbrev sequence */
#endif
if (v_bufend < v_bufptr + len) { /* we've run out of room */
if (v_bufstr != v_buffer) {
/* there is unused space, move everything down */
/* possibly overlapping memmove here */
if_DEBUG({
fprintf(stderr, "moving data down %ld\n",
(long) (v_bufstr - v_buffer));
});
memmove(v_buffer, v_bufstr, (size_t) (v_bufptr - v_bufstr));
v_bufptr -= v_bufstr - v_buffer;
v_bufstr = v_buffer;
}
if (v_bufend < v_bufptr + len) {
/* still won't fit: get more space */
/* Don't use XtRealloc because an error is not fatal. */
unsigned size = (unsigned) (v_bufptr - v_buffer);
v_buffer = TypeRealloc(Char, size + len, v_buffer);
if (v_buffer) {
if_DEBUG({
fprintf(stderr, "expanded buffer to %d\n",
size + len);
});
v_bufstr = v_buffer;
v_bufptr = v_buffer + size;
v_bufend = v_bufptr + len;
} else {
/* no memory: ignore entire write request */
xtermWarning("cannot allocate buffer space\n");
v_buffer = v_bufstr; /* restore clobbered pointer */
}
}
}
if (v_bufend >= v_bufptr + len) {
/* new stuff will fit */
memmove(v_bufptr, data, (size_t) len);
v_bufptr += len;
}
}
/*
* Write out as much of the buffer as we can.
* Be careful not to overflow the pty's input silo.
* We are conservative here and only write
* a small amount at a time.
*
* If we can't push all the data into the pty yet, we expect write
* to return a non-negative number less than the length requested
* (if some data written) or -1 and set errno to EAGAIN,
* EWOULDBLOCK, or EINTR (if no data written).
*
* (Not all systems do this, sigh, so the code is actually
* a little more forgiving.)
*/
#define MAX_PTY_WRITE 128 /* 1/2 POSIX minimum MAX_INPUT */
if (v_bufptr > v_bufstr) {
#ifdef VMS
riten = tt_write(v_bufstr,
((v_bufptr - v_bufstr <= VMS_TERM_BUFFER_SIZE)
? v_bufptr - v_bufstr
: VMS_TERM_BUFFER_SIZE));
if (riten == 0)
return (riten);
#else /* VMS */
riten = (int) write(f, v_bufstr,
(size_t) ((v_bufptr - v_bufstr <= MAX_PTY_WRITE)
? v_bufptr - v_bufstr
: MAX_PTY_WRITE));
if (riten < 0)
#endif /* VMS */
{
if_DEBUG({
perror("write");
});
riten = 0;
}
if_DEBUG({
fprintf(stderr, "write called with %ld, wrote %d\n",
((long) ((v_bufptr - v_bufstr) <= MAX_PTY_WRITE)
? (long) (v_bufptr - v_bufstr)
: MAX_PTY_WRITE),
riten);
});
v_bufstr += riten;
if (v_bufstr >= v_bufptr) /* we wrote it all */
v_bufstr = v_bufptr = v_buffer;
}
/*
* If we have lots of unused memory allocated, return it
*/
if (v_bufend - v_bufptr > 1024) { /* arbitrary hysteresis */
/* save pointers across realloc */
int start = (int) (v_bufstr - v_buffer);
int size = (int) (v_bufptr - v_buffer);
unsigned allocsize = (unsigned) (size ? size : 1);
v_buffer = TypeRealloc(Char, allocsize, v_buffer);
if (v_buffer) {
v_bufstr = v_buffer + start;
v_bufptr = v_buffer + size;
v_bufend = v_buffer + allocsize;
if_DEBUG({
fprintf(stderr, "shrunk buffer to %d\n", allocsize);
});
} else {
/* should we print a warning if couldn't return memory? */
v_buffer = v_bufstr - start; /* restore clobbered pointer */
}
}
}
static void
updateCursor(TScreen *screen)
{
if (screen->cursor_set != screen->cursor_state) {
if (screen->cursor_set)
ShowCursor();
else
HideCursor();
}
}
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
static void
reallyStopBlinking(TScreen *screen)
{
if (screen->cursor_state == BLINKED_OFF) {
/* force cursor to display if it is enabled */
screen->cursor_state = !screen->cursor_set;
updateCursor(screen);
xevents();
}
}
#endif
#ifdef VMS
#define ptymask() (v_bufptr > v_bufstr ? pty_mask : 0)
static void
in_put(XtermWidget xw)
{
static PtySelect select_mask;
static PtySelect write_mask;
int update = VTbuffer->update;
int size;
int status;
Dimension replyWidth, replyHeight;
XtGeometryResult stat;
TScreen *screen = TScreenOf(xw);
char *cp;
int i;
select_mask = pty_mask; /* force initial read */
for (;;) {
/* if the terminal changed size, resize the widget */
if (tt_changed) {
tt_changed = False;
stat = REQ_RESIZE((Widget) xw,
((Dimension) FontWidth(screen)
* (tt_width)
+ 2 * screen->border
+ screen->fullVwin.sb_info.width),
((Dimension) FontHeight(screen)
* (tt_length)
+ 2 * screen->border),
&replyWidth, &replyHeight);
if (stat == XtGeometryYes || stat == XtGeometryDone) {
xw->core.width = replyWidth;
xw->core.height = replyHeight;
ScreenResize(xw, replyWidth, replyHeight, &xw->flags);
}
repairSizeHints();
}
if (screen->eventMode == NORMAL
&& readPtyData(xw, &select_mask, VTbuffer)) {
if (screen->scrollWidget
&& screen->scrollttyoutput
&& screen->topline < 0)
/* Scroll to bottom */
WindowScroll(xw, 0, False);
break;
}
if (screen->scroll_amt)
FlushScroll(xw);
if (screen->cursor_set && CursorMoved(screen)) {
if (screen->cursor_state)
HideCursor();
ShowCursor();
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
PreeditPosition(xw);
#endif
} else {
updateCursor(screen);
}
if (QLength(screen->display)) {
select_mask = X_mask;
} else {
write_mask = ptymask();
XFlush(screen->display);
select_mask = Select_mask;
if (screen->eventMode != NORMAL)
select_mask = X_mask;
}
if (write_mask & ptymask()) {
v_write(screen->respond, 0, 0); /* flush buffer */
}
if (select_mask & X_mask) {
xevents();
if (VTbuffer->update != update)
break;
}
}
}
#else /* VMS */
static void
in_put(XtermWidget xw)
{
static PtySelect select_mask;
static PtySelect write_mask;
TScreen *screen = TScreenOf(xw);
int i, time_select;
int size;
int update = VTbuffer->update;
#if OPT_DOUBLE_BUFFER
int should_wait = 1;
#endif
static struct timeval select_timeout;
#if OPT_BLINK_CURS
/*
* Compute the timeout for the blinking cursor to be much smaller than
* the "on" or "off" interval.
*/
int tick = ((screen->blink_on < screen->blink_off)
? screen->blink_on
: screen->blink_off);
tick *= (1000 / 8); /* 1000 for msec/usec, 8 for "much" smaller */
if (tick < 1)
tick = 1;
#endif
for (;;) {
if (screen->eventMode == NORMAL
&& (size = readPtyData(xw, &select_mask, VTbuffer)) != 0) {
if (screen->scrollWidget
&& screen->scrollttyoutput
&& screen->topline < 0)
WindowScroll(xw, 0, False); /* Scroll to bottom */
/* stop speed reading at some point to look for X stuff */
TRACE(("VTbuffer uses %ld/%d\n",
(long) (VTbuffer->last - VTbuffer->buffer),
BUF_SIZE));
if ((VTbuffer->last - VTbuffer->buffer) > BUF_SIZE) {
FD_CLR(screen->respond, &select_mask);
break;
}
#if OPT_DOUBLE_BUFFER
if (should_wait) {
/* wait 25 msec for potential extra data (avoids some bogus flickering) */
/* that's only 40 FPS but hey, it's still lower than the input lag on some consoles! :) */
usleep(25000);
should_wait = 0;
}
select_timeout.tv_sec = 0;
i = Select(max_plus1, &select_mask, &write_mask, 0,
&select_timeout);
if (i > 0 && FD_ISSET(screen->respond, &select_mask))
continue;
else
break;
#elif defined(HAVE_SCHED_YIELD)
/*
* If we've read a full (small/fragment) buffer, let the operating
* system have a turn, and we'll resume reading until we've either
* read only a fragment of the buffer, or we've filled the large
* buffer (see above). Doing this helps keep up with large bursts
* of output.
*/
if (size == FRG_SIZE) {
select_timeout.tv_sec = 0;
i = Select(max_plus1, &select_mask, &write_mask, 0,
&select_timeout);
if (i > 0 && FD_ISSET(screen->respond, &select_mask)) {
sched_yield();
} else
break;
} else {
break;
}
#else
(void) size; /* unused in this branch */
break;
#endif
}
/* update the screen */
if (screen->scroll_amt)
FlushScroll(xw);
if (screen->cursor_set && CursorMoved(screen)) {
if (screen->cursor_state)
HideCursor();
ShowCursor();
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
PreeditPosition(xw);
#endif
} else {
updateCursor(screen);
}
XFlush(screen->display); /* always flush writes before waiting */
/* Update the masks and, unless X events are already in the queue,
wait for I/O to be possible. */
XFD_COPYSET(&Select_mask, &select_mask);
/* in selection mode xterm does not read pty */
if (screen->eventMode != NORMAL)
FD_CLR(screen->respond, &select_mask);
if (v_bufptr > v_bufstr) {
XFD_COPYSET(&pty_mask, &write_mask);
} else
FD_ZERO(&write_mask);
select_timeout.tv_sec = 0;
time_select = 0;
/*
* if there's either an XEvent or an XtTimeout pending, just take
* a quick peek, i.e. timeout from the select() immediately. If
* there's nothing pending, let select() block a little while, but
* for a shorter interval than the arrow-style scrollbar timeout.
* The blocking is optional, because it tends to increase the load
* on the host.
*/
if (xtermAppPending()) {
select_timeout.tv_usec = 0;
time_select = 1;
} else if (screen->awaitInput) {
select_timeout.tv_usec = 50000;
time_select = 1;
#if OPT_BLINK_CURS
} else if ((screen->blink_timer != 0 &&
((screen->select & FOCUS) || screen->always_highlight)) ||
(screen->cursor_state == BLINKED_OFF)) {
select_timeout.tv_usec = tick;
while (select_timeout.tv_usec > 1000000) {
select_timeout.tv_usec -= 1000000;
select_timeout.tv_sec++;
}
time_select = 1;
#endif
#if OPT_SESSION_MGT
} else if (resource.sessionMgt) {
if (ice_fd >= 0)
FD_SET(ice_fd, &select_mask);
#endif
}
if (need_cleanup)
NormalExit();
#if OPT_DOUBLE_BUFFER
if (screen->needSwap) {
XdbeSwapInfo swap;
swap.swap_window = VWindow(screen);
swap.swap_action = XdbeCopied;
XdbeSwapBuffers(XtDisplay(term), &swap, 1);
XFlush(XtDisplay(xw));
screen->needSwap = 0;
}
#endif
i = Select(max_plus1, &select_mask, &write_mask, 0,
(time_select ? &select_timeout : 0));
if (i < 0) {
if (errno != EINTR)
SysError(ERROR_SELECT);
continue;
}
/* if there is room to write more data to the pty, go write more */
if (FD_ISSET(screen->respond, &write_mask)) {
v_write(screen->respond, (Char *) 0, 0); /* flush buffer */
}
/* if there are X events already in our queue, it
counts as being readable */
if (xtermAppPending() ||
FD_ISSET(ConnectionNumber(screen->display), &select_mask)) {
xevents();
if (VTbuffer->update != update) /* HandleInterpret */
break;
}
}
}
#endif /* VMS */
static IChar
doinput(void)
{
TScreen *screen = TScreenOf(term);
while (!morePtyData(screen, VTbuffer))
in_put(term);
return nextPtyData(screen, VTbuffer);
}
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
/*
* For OverTheSpot, client has to inform the position for XIM preedit.
*/
static void
PreeditPosition(XtermWidget xw)
{
TInput *input = lookupTInput(xw, (Widget) xw);
TScreen *screen = TScreenOf(xw);
LineData *ld;
XPoint spot;
XVaNestedList list;
if (input && input->xic
&& (ld = getLineData(screen, screen->cur_row)) != 0) {
spot.x = (short) LineCursorX(screen, ld, screen->cur_col);
spot.y = (short) (CursorY(screen, screen->cur_row) + xw->misc.xim_fs_ascent);
list = XVaCreateNestedList(0,
XNSpotLocation, &spot,
XNForeground, T_COLOR(screen, TEXT_FG),
XNBackground, T_COLOR(screen, TEXT_BG),
(void *) 0);
XSetICValues(input->xic, XNPreeditAttributes, list, (void *) 0);
XFree(list);
}
}
#endif
static void
WrapLine(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
LineData *ld = getLineData(screen, screen->cur_row);
if (ld != 0) {
/* mark that we had to wrap this line */
LineSetFlag(ld, LINEWRAPPED);
if (screen->show_wrap_marks) {
ShowWrapMarks(xw, screen->cur_row, ld);
}
xtermAutoPrint(xw, '\n');
xtermIndex(xw, 1);
set_cur_col(screen, ScrnLeftMargin(xw));
}
}
/*
* process a string of characters according to the character set indicated
* by charset. worry about end of line conditions (wraparound if selected).
*/
void
dotext(XtermWidget xw,
int charset,
IChar *buf, /* start of characters to process */
Cardinal len) /* end */
{
TScreen *screen = TScreenOf(xw);
#if OPT_WIDE_CHARS
Cardinal chars_chomped = 1;
int next_col = screen->cur_col;
#else
int next_col, last_col, this_col; /* must be signed */
#endif
Cardinal offset;
int right = ScrnRightMargin(xw);
/*
* It is possible to use CUP, etc., to move outside margins. In that
* case, the right-margin is ineffective.
*/
if (screen->cur_col > right) {
right = screen->max_col;
}
#if OPT_WIDE_CHARS
if (screen->vt100_graphics)
#endif
if (!xtermCharSetOut(xw, buf, buf + len, charset))
return;
if_OPT_XMC_GLITCH(screen, {
Cardinal n;
if (charset != '?') {
for (n = 0; n < len; n++) {
if (buf[n] == XMC_GLITCH)
buf[n] = XMC_GLITCH + 1;
}
}
});
#if OPT_WIDE_CHARS
for (offset = 0;
offset < len && (chars_chomped > 0 || screen->do_wrap);
offset += chars_chomped) {
int width_available = right + 1 - screen->cur_col;
int width_here = 0;
Boolean force_wrap;
Boolean need_wrap;
Boolean did_wrap;
int last_chomp = 0;
chars_chomped = 0;
do {
force_wrap = False;
need_wrap = False;
did_wrap = False;
if (screen->do_wrap) {
screen->do_wrap = False;
if ((xw->flags & WRAPAROUND)) {
WrapLine(xw);
width_available = right + 1 - screen->cur_col;
next_col = screen->cur_col;
did_wrap = True;
}
}
/*
* This can happen with left/right margins...
*/
if (width_available <= 0) {
break;
}
while (width_here <= width_available
&& chars_chomped < (len - offset)) {
if (!screen->utf8_mode
|| (screen->vt100_graphics && charset == '0')) {
last_chomp = 1;
} else {
last_chomp = my_wcwidth((wchar_t) buf[chars_chomped + offset]);
}
width_here += last_chomp;
chars_chomped++;
}
if (width_here > width_available) {
if (last_chomp > right + 1) {
break; /* give up - it is too big */
} else if (chars_chomped-- == 0) {
/* This can happen with left/right margins... */
break;
}
width_here -= last_chomp;
if (chars_chomped > 0) {
need_wrap = True;
}
} else if (width_here == width_available) {
need_wrap = True;
} else if (chars_chomped != (len - offset)) {
need_wrap = True;
}
if (chars_chomped != 0 && next_col <= screen->max_col) {
WriteText(xw, buf + offset, chars_chomped);
} else if (!did_wrap
&& (xw->flags & WRAPAROUND)
&& screen->cur_col > ScrnLeftMargin(xw)) {
force_wrap = True;
need_wrap = True;
}
next_col += width_here;
screen->do_wrap = need_wrap;
} while (force_wrap);
}
/*
* Remember that we wrote something to the screen, for use as a base of
* combining characters. The logic above may have called cursor-forward
* or carriage-return operations which resets this flag, so we set it at
* the very end.
*/
screen->char_was_written = True;
#else /* ! OPT_WIDE_CHARS */
for (offset = 0; offset < len; offset += (Cardinal) this_col) {
#if OPT_DEC_CHRSET
LineData *ld = getLineData(screen, screen->cur_row);
#endif
last_col = LineMaxCol(screen, ld);
if (last_col > (right + 1))
last_col = right + 1;
this_col = last_col - screen->cur_col + 1;
if (this_col <= 1) {
if (screen->do_wrap) {
screen->do_wrap = False;
if ((xw->flags & WRAPAROUND)) {
WrapLine(xw);
}
}
this_col = 1;
}
if (offset + (Cardinal) this_col > len) {
this_col = (int) (len - offset);
}
next_col = screen->cur_col + this_col;
WriteText(xw, buf + offset, (unsigned) this_col);
/*
* The call to WriteText updates screen->cur_col.
* If screen->cur_col is less than next_col, we must have
* hit the right margin - so set the do_wrap flag.
*/
screen->do_wrap = (Boolean) (screen->cur_col < next_col);
}
#endif /* OPT_WIDE_CHARS */
}
#if OPT_WIDE_CHARS
unsigned
visual_width(IChar *str, Cardinal len)
{
/* returns the visual width of a string (doublewide characters count
as 2, normalwide characters count as 1) */
unsigned my_len = 0;
while (len) {
int ch = (int) *str++;
if (isWide(ch))
my_len += 2;
else
my_len++;
len--;
}
return my_len;
}
#endif
#if HANDLE_STRUCT_NOTIFY
/* Flag icon name with "***" on window output when iconified.
*/
static void
HandleStructNotify(Widget w GCC_UNUSED,
XtPointer closure GCC_UNUSED,
XEvent * event,
Boolean *cont GCC_UNUSED)
{
XtermWidget xw = term;
switch (event->type) {
case MapNotify:
TRACE(("HandleStructNotify(MapNotify)\n"));
resetZIconBeep(xw);
mapstate = !IsUnmapped;
break;
case UnmapNotify:
TRACE(("HandleStructNotify(UnmapNotify)\n"));
mapstate = IsUnmapped;
break;
case ConfigureNotify:
if (event->xconfigure.window == XtWindow(toplevel)) {
#if !OPT_TOOLBAR
int height, width;
height = event->xconfigure.height;
width = event->xconfigure.width;
#endif
TRACE(("HandleStructNotify(ConfigureNotify) %d,%d %dx%d\n",
event->xconfigure.y, event->xconfigure.x,
event->xconfigure.height, event->xconfigure.width));
#if OPT_TOOLBAR
/*
* The notification is for the top-level widget, but we care about
* vt100 (ignore the tek4014 window).
*/
if (TScreenOf(xw)->Vshow) {
VTwin *Vwin = WhichVWin(TScreenOf(xw));
TbInfo *info = &(Vwin->tb_info);
TbInfo save = *info;
if (info->menu_bar) {
XtVaGetValues(info->menu_bar,
XtNheight, &info->menu_height,
XtNborderWidth, &info->menu_border,
(XtPointer) 0);
if (save.menu_height != info->menu_height
|| save.menu_border != info->menu_border) {
TRACE(("...menu_height %d\n", info->menu_height));
TRACE(("...menu_border %d\n", info->menu_border));
TRACE(("...had height %d, border %d\n",
save.menu_height,
save.menu_border));
/*
* Window manager still may be using the old values.
* Try to fool it.
*/
REQ_RESIZE((Widget) xw,
TScreenOf(xw)->fullVwin.fullwidth,
(Dimension) (info->menu_height
- save.menu_height
+ TScreenOf(xw)->fullVwin.fullheight),
NULL, NULL);
repairSizeHints();
}
}
}
#else
if (height != xw->hints.height || width != xw->hints.width)
RequestResize(xw, height, width, False);
#endif /* OPT_TOOLBAR */
}
break;
case ReparentNotify:
TRACE(("HandleStructNotify(ReparentNotify)\n"));
break;
default:
TRACE(("HandleStructNotify(event %s)\n",
visibleEventType(event->type)));
break;
}
}
#endif /* HANDLE_STRUCT_NOTIFY */
#if OPT_BLINK_CURS
static void
SetCursorBlink(TScreen *screen, Bool enable)
{
screen->cursor_blink = (Boolean) enable;
if (DoStartBlinking(screen)) {
StartBlinking(screen);
} else {
/* EMPTY */
#if OPT_BLINK_TEXT
reallyStopBlinking(screen);
#else
StopBlinking(screen);
#endif
}
update_cursorblink();
}
void
ToggleCursorBlink(TScreen *screen)
{
SetCursorBlink(screen, (Bool) (!(screen->cursor_blink)));
}
#endif
/*
* process ANSI modes set, reset
*/
static void
ansi_modes(XtermWidget xw, BitFunc func)
{
int i;
for (i = 0; i < nparam; ++i) {
switch (GetParam(i)) {
case 2: /* KAM (if set, keyboard locked */
(*func) (&xw->keyboard.flags, MODE_KAM);
break;
case 4: /* IRM */
(*func) (&xw->flags, INSERT);
break;
case 12: /* SRM (if set, local echo */
(*func) (&xw->keyboard.flags, MODE_SRM);
break;
case 20: /* LNM */
(*func) (&xw->flags, LINEFEED);
update_autolinefeed();
break;
}
}
}
#define IsSM() (func == bitset)
#define set_bool_mode(flag) \
flag = (Boolean) IsSM()
static void
really_set_mousemode(XtermWidget xw,
Bool enabled,
XtermMouseModes mode)
{
TScreenOf(xw)->send_mouse_pos = enabled ? mode : MOUSE_OFF;
if (TScreenOf(xw)->send_mouse_pos != MOUSE_OFF)
xtermShowPointer(xw, True);
}
#define set_mousemode(mode) really_set_mousemode(xw, IsSM(), mode)
#if OPT_READLINE
#define set_mouseflag(f) \
(IsSM() \
? SCREEN_FLAG_set(screen, f) \
: SCREEN_FLAG_unset(screen, f))
#endif
/*
* process DEC private modes set, reset
*/
static void
dpmodes(XtermWidget xw, BitFunc func)
{
TScreen *screen = TScreenOf(xw);
int i, j;
unsigned myflags;
TRACE(("changing %d DEC private modes\n", nparam));
for (i = 0; i < nparam; ++i) {
int code = GetParam(i);
TRACE(("%s %d\n", IsSM()? "DECSET" : "DECRST", code));
switch ((DECSET_codes) code) {
case srm_DECCKM:
(*func) (&xw->keyboard.flags, MODE_DECCKM);
update_appcursor();
break;
case srm_DECANM: /* ANSI/VT52 mode */
if (IsSM()) { /* ANSI (VT100) */
/*
* Setting DECANM should have no effect, since this function
* cannot be reached from vt52 mode.
*/
/* EMPTY */ ;
}
#if OPT_VT52_MODE
else if (screen->terminal_id >= 100) { /* VT52 */
TRACE(("DECANM terminal_id %d, vtXX_level %d\n",
screen->terminal_id,
screen->vtXX_level));
screen->vtXX_level = 0;
screen->vt52_save_curgl = screen->curgl;
screen->vt52_save_curgr = screen->curgr;
screen->vt52_save_curss = screen->curss;
memmove(screen->vt52_save_gsets, screen->gsets, sizeof(screen->gsets));
resetCharsets(screen);
InitParams(); /* ignore the remaining params, if any */
}
#endif
break;
case srm_DECCOLM:
if (screen->c132) {
if (!(xw->flags & NOCLEAR_COLM))
ClearScreen(xw);
CursorSet(screen, 0, 0, xw->flags);
if ((j = IsSM()? 132 : 80) !=
((xw->flags & IN132COLUMNS) ? 132 : 80) ||
j != MaxCols(screen))
RequestResize(xw, -1, j, True);
(*func) (&xw->flags, IN132COLUMNS);
if (xw->flags & IN132COLUMNS) {
UIntClr(xw->flags, LEFT_RIGHT);
reset_lr_margins(screen);
}
}
break;
case srm_DECSCLM: /* (slow scroll) */
if (IsSM()) {
screen->jumpscroll = 0;
if (screen->scroll_amt)
FlushScroll(xw);
} else
screen->jumpscroll = 1;
(*func) (&xw->flags, SMOOTHSCROLL);
update_jumpscroll();
break;
case srm_DECSCNM:
myflags = xw->flags;
(*func) (&xw->flags, REVERSE_VIDEO);
if ((xw->flags ^ myflags) & REVERSE_VIDEO)
ReverseVideo(xw);
/* update_reversevideo done in RevVid */
break;
case srm_DECOM:
(*func) (&xw->flags, ORIGIN);
CursorSet(screen, 0, 0, xw->flags);
break;
case srm_DECAWM:
(*func) (&xw->flags, WRAPAROUND);
update_autowrap();
break;
case srm_DECARM:
/* ignore autorepeat
* XAutoRepeatOn() and XAutoRepeatOff() can do this, but only
* for the whole display - not limited to a given window.
*/
break;
case srm_X10_MOUSE: /* MIT bogus sequence */
MotionOff(screen, xw);
set_mousemode(X10_MOUSE);
break;
#if OPT_TOOLBAR
case srm_RXVT_TOOLBAR:
ShowToolbar(IsSM());
break;
#endif
#if OPT_BLINK_CURS
case srm_ATT610_BLINK: /* att610: Start/stop blinking cursor */
if (screen->cursor_blink_res) {
set_bool_mode(screen->cursor_blink_esc);
UpdateCursorBlink(screen);
}
break;
#endif
case srm_DECPFF: /* print form feed */
set_bool_mode(PrinterOf(screen).printer_formfeed);
break;
case srm_DECPEX: /* print extent */
set_bool_mode(PrinterOf(screen).printer_extent);
break;
case srm_DECTCEM: /* Show/hide cursor (VT200) */
set_bool_mode(screen->cursor_set);
break;
case srm_RXVT_SCROLLBAR:
if (screen->fullVwin.sb_info.width != (IsSM()? ON : OFF))
ToggleScrollBar(xw);
break;
#if OPT_SHIFT_FONTS
case srm_RXVT_FONTSIZE:
set_bool_mode(xw->misc.shift_fonts);
break;
#endif
#if OPT_TEK4014
case srm_DECTEK:
if (IsSM() && !(screen->inhibit & I_TEK)) {
FlushLog(xw);
TEK4014_ACTIVE(xw) = True;
update_vttekmode();
}
break;
#endif
case srm_132COLS: /* 132 column mode */
set_bool_mode(screen->c132);
update_allow132();
break;
case srm_CURSES_HACK:
set_bool_mode(screen->curses);
update_cursesemul();
break;
case srm_DECNRCM: /* national charset (VT220) */
if (screen->vtXX_level >= 2) {
if ((*func) (&xw->flags, NATIONAL)) {
modified_DECNRCM(xw);
}
}
break;
case srm_MARGIN_BELL: /* margin bell */
set_bool_mode(screen->marginbell);
if (!screen->marginbell)
screen->bellArmed = -1;
update_marginbell();
break;
case srm_REVERSEWRAP: /* reverse wraparound */
(*func) (&xw->flags, REVERSEWRAP);
update_reversewrap();
break;
#ifdef ALLOWLOGGING
case srm_ALLOWLOGGING: /* logging */
#ifdef ALLOWLOGFILEONOFF
/*
* if this feature is enabled, logging may be
* enabled and disabled via escape sequences.
*/
if (IsSM())
StartLog(xw);
else
CloseLog(xw);
#else
Bell(xw, XkbBI_Info, 0);
Bell(xw, XkbBI_Info, 0);
#endif /* ALLOWLOGFILEONOFF */
break;
#endif
case srm_OPT_ALTBUF_CURSOR: /* alternate buffer & cursor */
if (!xw->misc.titeInhibit) {
if (IsSM()) {
CursorSave(xw);
ToAlternate(xw, True);
ClearScreen(xw);
} else {
FromAlternate(xw);
CursorRestore(xw);
}
} else if (IsSM()) {
do_ti_xtra_scroll(xw);
}
break;
case srm_OPT_ALTBUF:
/* FALLTHRU */
case srm_ALTBUF: /* alternate buffer */
if (!xw->misc.titeInhibit) {
if (IsSM()) {
ToAlternate(xw, False);
} else {
if (screen->whichBuf
&& (code == 1047))
ClearScreen(xw);
FromAlternate(xw);
}
} else if (IsSM()) {
do_ti_xtra_scroll(xw);
}
break;
case srm_DECNKM:
(*func) (&xw->keyboard.flags, MODE_DECKPAM);
update_appkeypad();
break;
case srm_DECBKM:
/* back-arrow mapped to backspace or delete(D) */
(*func) (&xw->keyboard.flags, MODE_DECBKM);
TRACE(("DECSET DECBKM %s\n",
BtoS(xw->keyboard.flags & MODE_DECBKM)));
update_decbkm();
break;
case srm_DECLRMM:
if (screen->vtXX_level >= 4) { /* VT420 */
(*func) (&xw->flags, LEFT_RIGHT);
if (IsLeftRightMode(xw)) {
xterm_ResetDouble(xw);
} else {
reset_lr_margins(screen);
}
}
break;
#if OPT_SIXEL_GRAPHICS
case srm_DECSDM: /* sixel scrolling */
if (screen->terminal_id == 240 ||
screen->terminal_id == 241 ||
screen->terminal_id == 330 ||
screen->terminal_id == 340) {
(*func) (&xw->keyboard.flags, MODE_DECSDM);
TRACE(("DECSET/DECRST DECSDM %s (resource default is %d)\n",
BtoS(xw->keyboard.flags & MODE_DECSDM),
TScreenOf(xw)->sixel_scrolling));
update_decsdm();
}
break;
#endif
case srm_DECNCSM:
if (screen->vtXX_level >= 5) { /* VT510 */
(*func) (&xw->flags, NOCLEAR_COLM);
}
break;
case srm_VT200_MOUSE: /* xterm bogus sequence */
MotionOff(screen, xw);
set_mousemode(VT200_MOUSE);
break;
case srm_VT200_HIGHLIGHT_MOUSE: /* xterm sequence w/hilite tracking */
MotionOff(screen, xw);
set_mousemode(VT200_HIGHLIGHT_MOUSE);
break;
case srm_BTN_EVENT_MOUSE:
MotionOff(screen, xw);
set_mousemode(BTN_EVENT_MOUSE);
break;
case srm_ANY_EVENT_MOUSE:
set_mousemode(ANY_EVENT_MOUSE);
if (screen->send_mouse_pos == MOUSE_OFF) {
MotionOff(screen, xw);
} else {
MotionOn(screen, xw);
}
break;
#if OPT_FOCUS_EVENT
case srm_FOCUS_EVENT_MOUSE:
set_bool_mode(screen->send_focus_pos);
break;
#endif
case srm_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_SGR_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_URXVT_EXT_MODE_MOUSE:
/*
* Rather than choose an arbitrary precedence among the coordinate
* modes, they are mutually exclusive. For consistency, a reset is
* only effective against the matching mode.
*/
if (IsSM()) {
screen->extend_coords = code;
} else if (screen->extend_coords == code) {
screen->extend_coords = 0;
}
break;
case srm_ALTERNATE_SCROLL:
set_bool_mode(screen->alternateScroll);
break;
case srm_RXVT_SCROLL_TTY_OUTPUT:
set_bool_mode(screen->scrollttyoutput);
update_scrollttyoutput();
break;
case srm_RXVT_SCROLL_TTY_KEYPRESS:
set_bool_mode(screen->scrollkey);
update_scrollkey();
break;
case srm_EIGHT_BIT_META:
if (screen->eight_bit_meta != ebNever) {
set_bool_mode(screen->eight_bit_meta);
}
break;
#if OPT_NUM_LOCK
case srm_REAL_NUMLOCK:
set_bool_mode(xw->misc.real_NumLock);
update_num_lock();
break;
case srm_META_SENDS_ESC:
set_bool_mode(screen->meta_sends_esc);
update_meta_esc();
break;
#endif
case srm_DELETE_IS_DEL:
set_bool_mode(screen->delete_is_del);
update_delete_del();
break;
#if OPT_NUM_LOCK
case srm_ALT_SENDS_ESC:
set_bool_mode(screen->alt_sends_esc);
update_alt_esc();
break;
#endif
case srm_KEEP_SELECTION:
set_bool_mode(screen->keepSelection);
update_keepSelection();
break;
case srm_SELECT_TO_CLIPBOARD:
set_bool_mode(screen->selectToClipboard);
update_selectToClipboard();
break;
case srm_BELL_IS_URGENT:
set_bool_mode(screen->bellIsUrgent);
update_bellIsUrgent();
break;
case srm_POP_ON_BELL:
set_bool_mode(screen->poponbell);
update_poponbell();
break;
case srm_TITE_INHIBIT:
if (!xw->misc.titeInhibit) {
if (IsSM())
CursorSave(xw);
else
CursorRestore(xw);
}
break;
#if OPT_TCAP_FKEYS
case srm_TCAP_FKEYS:
set_keyboard_type(xw, keyboardIsTermcap, IsSM());
break;
#endif
#if OPT_SUN_FUNC_KEYS
case srm_SUN_FKEYS:
set_keyboard_type(xw, keyboardIsSun, IsSM());
break;
#endif
#if OPT_HP_FUNC_KEYS
case srm_HP_FKEYS:
set_keyboard_type(xw, keyboardIsHP, IsSM());
break;
#endif
#if OPT_SCO_FUNC_KEYS
case srm_SCO_FKEYS:
set_keyboard_type(xw, keyboardIsSCO, IsSM());
break;
#endif
case srm_LEGACY_FKEYS:
set_keyboard_type(xw, keyboardIsLegacy, IsSM());
break;
#if OPT_SUNPC_KBD
case srm_VT220_FKEYS:
set_keyboard_type(xw, keyboardIsVT220, IsSM());
break;
#endif
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
set_mouseflag(click1_moves);
break;
case srm_BUTTON2_MOVE_POINT:
set_mouseflag(paste_moves);
break;
case srm_DBUTTON3_DELETE:
set_mouseflag(dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
set_mouseflag(paste_brackets);
break;
case srm_PASTE_QUOTE:
set_mouseflag(paste_quotes);
break;
case srm_PASTE_LITERAL_NL:
set_mouseflag(paste_literal_nl);
break;
#endif /* OPT_READLINE */
#if OPT_SIXEL_GRAPHICS
case srm_PRIVATE_COLOR_REGISTERS: /* private color registers for each graphic */
TRACE(("DECSET/DECRST PRIVATE_COLOR_REGISTERS %s\n",
BtoS(screen->privatecolorregisters)));
set_bool_mode(screen->privatecolorregisters);
update_privatecolorregisters();
break;
#endif
default:
TRACE(("DATA_ERROR: unknown private code %d\n", code));
break;
}
}
}
/*
* process xterm private modes save
*/
static void
savemodes(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int i;
for (i = 0; i < nparam; i++) {
int code = GetParam(i);
TRACE(("savemodes %d\n", code));
switch ((DECSET_codes) code) {
case srm_DECCKM:
DoSM(DP_DECCKM, xw->keyboard.flags & MODE_DECCKM);
break;
case srm_DECANM: /* ANSI/VT52 mode */
/* no effect */
break;
case srm_DECCOLM:
if (screen->c132)
DoSM(DP_DECCOLM, xw->flags & IN132COLUMNS);
break;
case srm_DECSCLM: /* (slow scroll) */
DoSM(DP_DECSCLM, xw->flags & SMOOTHSCROLL);
break;
case srm_DECSCNM:
DoSM(DP_DECSCNM, xw->flags & REVERSE_VIDEO);
break;
case srm_DECOM:
DoSM(DP_DECOM, xw->flags & ORIGIN);
break;
case srm_DECAWM:
DoSM(DP_DECAWM, xw->flags & WRAPAROUND);
break;
case srm_DECARM:
/* ignore autorepeat */
break;
case srm_X10_MOUSE: /* mouse bogus sequence */
DoSM(DP_X_X10MSE, screen->send_mouse_pos);
break;
#if OPT_TOOLBAR
case srm_RXVT_TOOLBAR:
DoSM(DP_TOOLBAR, resource.toolBar);
break;
#endif
#if OPT_BLINK_CURS
case srm_ATT610_BLINK: /* att610: Start/stop blinking cursor */
if (screen->cursor_blink_res) {
DoSM(DP_CRS_BLINK, screen->cursor_blink_esc);
}
break;
#endif
case srm_DECPFF: /* print form feed */
DoSM(DP_PRN_FORMFEED, PrinterOf(screen).printer_formfeed);
break;
case srm_DECPEX: /* print extent */
DoSM(DP_PRN_EXTENT, PrinterOf(screen).printer_extent);
break;
case srm_DECTCEM: /* Show/hide cursor (VT200) */
DoSM(DP_CRS_VISIBLE, screen->cursor_set);
break;
case srm_RXVT_SCROLLBAR:
DoSM(DP_RXVT_SCROLLBAR, (screen->fullVwin.sb_info.width != 0));
break;
#if OPT_SHIFT_FONTS
case srm_RXVT_FONTSIZE:
DoSM(DP_RXVT_FONTSIZE, xw->misc.shift_fonts);
break;
#endif
#if OPT_TEK4014
case srm_DECTEK:
DoSM(DP_DECTEK, TEK4014_ACTIVE(xw));
break;
#endif
case srm_132COLS: /* 132 column mode */
DoSM(DP_X_DECCOLM, screen->c132);
break;
case srm_CURSES_HACK: /* curses hack */
DoSM(DP_X_MORE, screen->curses);
break;
case srm_DECNRCM: /* national charset (VT220) */
if (screen->vtXX_level >= 2) {
DoSM(DP_DECNRCM, xw->flags & NATIONAL);
}
break;
case srm_MARGIN_BELL: /* margin bell */
DoSM(DP_X_MARGIN, screen->marginbell);
break;
case srm_REVERSEWRAP: /* reverse wraparound */
DoSM(DP_X_REVWRAP, xw->flags & REVERSEWRAP);
break;
#ifdef ALLOWLOGGING
case srm_ALLOWLOGGING: /* logging */
DoSM(DP_X_LOGGING, screen->logging);
break;
#endif
case srm_OPT_ALTBUF_CURSOR:
/* FALLTHRU */
case srm_OPT_ALTBUF:
/* FALLTHRU */
case srm_ALTBUF: /* alternate buffer */
DoSM(DP_X_ALTSCRN, screen->whichBuf);
break;
case srm_DECNKM:
DoSM(DP_DECKPAM, xw->keyboard.flags & MODE_DECKPAM);
break;
case srm_DECBKM: /* backarrow mapping */
DoSM(DP_DECBKM, xw->keyboard.flags & MODE_DECBKM);
break;
case srm_DECLRMM: /* left-right */
DoSM(DP_X_LRMM, LEFT_RIGHT);
break;
#if OPT_SIXEL_GRAPHICS
case srm_DECSDM: /* sixel scrolling */
DoSM(DP_DECSDM, xw->keyboard.flags & MODE_DECSDM);
update_decsdm();
break;
#endif
case srm_DECNCSM: /* noclear */
DoSM(DP_X_NCSM, NOCLEAR_COLM);
break;
case srm_VT200_MOUSE: /* mouse bogus sequence */
case srm_VT200_HIGHLIGHT_MOUSE:
case srm_BTN_EVENT_MOUSE:
case srm_ANY_EVENT_MOUSE:
DoSM(DP_X_MOUSE, screen->send_mouse_pos);
break;
#if OPT_FOCUS_EVENT
case srm_FOCUS_EVENT_MOUSE:
DoSM(DP_X_FOCUS, screen->send_focus_pos);
break;
#endif
case srm_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_SGR_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_URXVT_EXT_MODE_MOUSE:
DoSM(DP_X_EXT_MOUSE, screen->extend_coords);
break;
case srm_ALTERNATE_SCROLL:
DoSM(DP_ALTERNATE_SCROLL, screen->alternateScroll);
break;
case srm_RXVT_SCROLL_TTY_OUTPUT:
DoSM(DP_RXVT_SCROLL_TTY_OUTPUT, screen->scrollttyoutput);
break;
case srm_RXVT_SCROLL_TTY_KEYPRESS:
DoSM(DP_RXVT_SCROLL_TTY_KEYPRESS, screen->scrollkey);
break;
case srm_EIGHT_BIT_META:
DoSM(DP_EIGHT_BIT_META, screen->eight_bit_meta);
break;
#if OPT_NUM_LOCK
case srm_REAL_NUMLOCK:
DoSM(DP_REAL_NUMLOCK, xw->misc.real_NumLock);
break;
case srm_META_SENDS_ESC:
DoSM(DP_META_SENDS_ESC, screen->meta_sends_esc);
break;
#endif
case srm_DELETE_IS_DEL:
DoSM(DP_DELETE_IS_DEL, screen->delete_is_del);
break;
#if OPT_NUM_LOCK
case srm_ALT_SENDS_ESC:
DoSM(DP_ALT_SENDS_ESC, screen->alt_sends_esc);
break;
#endif
case srm_KEEP_SELECTION:
DoSM(DP_KEEP_SELECTION, screen->keepSelection);
break;
case srm_SELECT_TO_CLIPBOARD:
DoSM(DP_SELECT_TO_CLIPBOARD, screen->selectToClipboard);
break;
case srm_BELL_IS_URGENT:
DoSM(DP_BELL_IS_URGENT, screen->bellIsUrgent);
break;
case srm_POP_ON_BELL:
DoSM(DP_POP_ON_BELL, screen->poponbell);
break;
#if OPT_TCAP_FKEYS
case srm_TCAP_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SUN_FUNC_KEYS
case srm_SUN_FKEYS:
/* FALLTHRU */
#endif
#if OPT_HP_FUNC_KEYS
case srm_HP_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SCO_FUNC_KEYS
case srm_SCO_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SUNPC_KBD
case srm_VT220_FKEYS:
/* FALLTHRU */
#endif
case srm_LEGACY_FKEYS:
DoSM(DP_KEYBOARD_TYPE, xw->keyboard.type);
break;
case srm_TITE_INHIBIT:
if (!xw->misc.titeInhibit) {
CursorSave(xw);
}
break;
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
SCREEN_FLAG_save(screen, click1_moves);
break;
case srm_BUTTON2_MOVE_POINT:
SCREEN_FLAG_save(screen, paste_moves);
break;
case srm_DBUTTON3_DELETE:
SCREEN_FLAG_save(screen, dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_save(screen, paste_brackets);
break;
case srm_PASTE_QUOTE:
SCREEN_FLAG_save(screen, paste_quotes);
break;
case srm_PASTE_LITERAL_NL:
SCREEN_FLAG_save(screen, paste_literal_nl);
break;
#endif /* OPT_READLINE */
#if OPT_SIXEL_GRAPHICS
case srm_PRIVATE_COLOR_REGISTERS: /* private color registers for each graphic */
TRACE(("save PRIVATE_COLOR_REGISTERS %s\n",
BtoS(screen->privatecolorregisters)));
DoSM(DP_X_PRIVATE_COLOR_REGISTERS, screen->privatecolorregisters);
update_privatecolorregisters();
break;
#endif
}
}
}
/*
* process xterm private modes restore
*/
static void
restoremodes(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
int i, j;
for (i = 0; i < nparam; i++) {
int code = GetParam(i);
TRACE(("restoremodes %d\n", code));
switch ((DECSET_codes) code) {
case srm_DECCKM:
bitcpy(&xw->keyboard.flags,
screen->save_modes[DP_DECCKM], MODE_DECCKM);
update_appcursor();
break;
case srm_DECANM: /* ANSI/VT52 mode */
/* no effect */
break;
case srm_DECCOLM:
if (screen->c132) {
if (!(xw->flags & NOCLEAR_COLM))
ClearScreen(xw);
CursorSet(screen, 0, 0, xw->flags);
if ((j = (screen->save_modes[DP_DECCOLM] & IN132COLUMNS)
? 132 : 80) != ((xw->flags & IN132COLUMNS)
? 132 : 80) || j != MaxCols(screen))
RequestResize(xw, -1, j, True);
bitcpy(&xw->flags,
screen->save_modes[DP_DECCOLM],
IN132COLUMNS);
}
break;
case srm_DECSCLM: /* (slow scroll) */
if (screen->save_modes[DP_DECSCLM] & SMOOTHSCROLL) {
screen->jumpscroll = 0;
if (screen->scroll_amt)
FlushScroll(xw);
} else
screen->jumpscroll = 1;
bitcpy(&xw->flags, screen->save_modes[DP_DECSCLM], SMOOTHSCROLL);
update_jumpscroll();
break;
case srm_DECSCNM:
if ((screen->save_modes[DP_DECSCNM] ^ xw->flags) & REVERSE_VIDEO) {
bitcpy(&xw->flags, screen->save_modes[DP_DECSCNM], REVERSE_VIDEO);
ReverseVideo(xw);
/* update_reversevideo done in RevVid */
}
break;
case srm_DECOM:
bitcpy(&xw->flags, screen->save_modes[DP_DECOM], ORIGIN);
CursorSet(screen, 0, 0, xw->flags);
break;
case srm_DECAWM:
bitcpy(&xw->flags, screen->save_modes[DP_DECAWM], WRAPAROUND);
update_autowrap();
break;
case srm_DECARM:
/* ignore autorepeat */
break;
case srm_X10_MOUSE: /* MIT bogus sequence */
DoRM0(DP_X_X10MSE, screen->send_mouse_pos);
really_set_mousemode(xw,
screen->send_mouse_pos != MOUSE_OFF,
(XtermMouseModes) screen->send_mouse_pos);
break;
#if OPT_TOOLBAR
case srm_RXVT_TOOLBAR:
DoRM(DP_TOOLBAR, resource.toolBar);
ShowToolbar(resource.toolBar);
break;
#endif
#if OPT_BLINK_CURS
case srm_ATT610_BLINK: /* Start/stop blinking cursor */
if (screen->cursor_blink_res) {
DoRM(DP_CRS_BLINK, screen->cursor_blink_esc);
UpdateCursorBlink(screen);
}
break;
#endif
case srm_DECPFF: /* print form feed */
DoRM(DP_PRN_FORMFEED, PrinterOf(screen).printer_formfeed);
break;
case srm_DECPEX: /* print extent */
DoRM(DP_PRN_EXTENT, PrinterOf(screen).printer_extent);
break;
case srm_DECTCEM: /* Show/hide cursor (VT200) */
DoRM(DP_CRS_VISIBLE, screen->cursor_set);
break;
case srm_RXVT_SCROLLBAR:
if ((screen->fullVwin.sb_info.width != 0) !=
screen->save_modes[DP_RXVT_SCROLLBAR]) {
ToggleScrollBar(xw);
}
break;
#if OPT_SHIFT_FONTS
case srm_RXVT_FONTSIZE:
DoRM(DP_RXVT_FONTSIZE, xw->misc.shift_fonts);
break;
#endif
#if OPT_TEK4014
case srm_DECTEK:
if (!(screen->inhibit & I_TEK) &&
(TEK4014_ACTIVE(xw) != (Boolean) screen->save_modes[DP_DECTEK])) {
FlushLog(xw);
TEK4014_ACTIVE(xw) = (Boolean) screen->save_modes[DP_DECTEK];
update_vttekmode();
}
break;
#endif
case srm_132COLS: /* 132 column mode */
DoRM(DP_X_DECCOLM, screen->c132);
update_allow132();
break;
case srm_CURSES_HACK: /* curses hack */
DoRM(DP_X_MORE, screen->curses);
update_cursesemul();
break;
case srm_DECNRCM: /* national charset (VT220) */
if (screen->vtXX_level >= 2) {
if (bitcpy(&xw->flags, screen->save_modes[DP_DECNRCM], NATIONAL))
modified_DECNRCM(xw);
}
break;
case srm_MARGIN_BELL: /* margin bell */
if ((DoRM(DP_X_MARGIN, screen->marginbell)) == 0)
screen->bellArmed = -1;
update_marginbell();
break;
case srm_REVERSEWRAP: /* reverse wraparound */
bitcpy(&xw->flags, screen->save_modes[DP_X_REVWRAP], REVERSEWRAP);
update_reversewrap();
break;
#ifdef ALLOWLOGGING
case srm_ALLOWLOGGING: /* logging */
#ifdef ALLOWLOGFILEONOFF
if (screen->save_modes[DP_X_LOGGING])
StartLog(xw);
else
CloseLog(xw);
#endif /* ALLOWLOGFILEONOFF */
/* update_logging done by StartLog and CloseLog */
break;
#endif
case srm_OPT_ALTBUF_CURSOR: /* alternate buffer & cursor */
/* FALLTHRU */
case srm_OPT_ALTBUF:
/* FALLTHRU */
case srm_ALTBUF: /* alternate buffer */
if (!xw->misc.titeInhibit) {
if (screen->save_modes[DP_X_ALTSCRN])
ToAlternate(xw, False);
else
FromAlternate(xw);
/* update_altscreen done by ToAlt and FromAlt */
} else if (screen->save_modes[DP_X_ALTSCRN]) {
do_ti_xtra_scroll(xw);
}
break;
case srm_DECNKM:
bitcpy(&xw->flags, screen->save_modes[DP_DECKPAM], MODE_DECKPAM);
update_appkeypad();
break;
case srm_DECBKM: /* backarrow mapping */
bitcpy(&xw->flags, screen->save_modes[DP_DECBKM], MODE_DECBKM);
update_decbkm();
break;
case srm_DECLRMM: /* left-right */
bitcpy(&xw->flags, screen->save_modes[DP_X_LRMM], LEFT_RIGHT);
if (IsLeftRightMode(xw)) {
xterm_ResetDouble(xw);
} else {
reset_lr_margins(screen);
}
break;
#if OPT_SIXEL_GRAPHICS
case srm_DECSDM: /* sixel scrolling */
bitcpy(&xw->keyboard.flags, screen->save_modes[DP_DECSDM], MODE_DECSDM);
update_decsdm();
break;
#endif
case srm_DECNCSM: /* noclear */
bitcpy(&xw->flags, screen->save_modes[DP_X_NCSM], NOCLEAR_COLM);
break;
case srm_VT200_MOUSE: /* mouse bogus sequence */
case srm_VT200_HIGHLIGHT_MOUSE:
case srm_BTN_EVENT_MOUSE:
case srm_ANY_EVENT_MOUSE:
DoRM0(DP_X_MOUSE, screen->send_mouse_pos);
really_set_mousemode(xw,
screen->send_mouse_pos != MOUSE_OFF,
(XtermMouseModes) screen->send_mouse_pos);
break;
#if OPT_FOCUS_EVENT
case srm_FOCUS_EVENT_MOUSE:
DoRM(DP_X_FOCUS, screen->send_focus_pos);
break;
#endif
case srm_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_SGR_EXT_MODE_MOUSE:
/* FALLTHRU */
case srm_URXVT_EXT_MODE_MOUSE:
DoRM(DP_X_EXT_MOUSE, screen->extend_coords);
break;
case srm_TITE_INHIBIT:
if (!xw->misc.titeInhibit) {
CursorRestore(xw);
}
break;
case srm_ALTERNATE_SCROLL:
DoRM(DP_ALTERNATE_SCROLL, screen->alternateScroll);
break;
case srm_RXVT_SCROLL_TTY_OUTPUT:
DoRM(DP_RXVT_SCROLL_TTY_OUTPUT, screen->scrollttyoutput);
update_scrollttyoutput();
break;
case srm_RXVT_SCROLL_TTY_KEYPRESS:
DoRM(DP_RXVT_SCROLL_TTY_KEYPRESS, screen->scrollkey);
update_scrollkey();
break;
case srm_EIGHT_BIT_META:
DoRM(DP_EIGHT_BIT_META, screen->eight_bit_meta);
break;
#if OPT_NUM_LOCK
case srm_REAL_NUMLOCK:
DoRM(DP_REAL_NUMLOCK, xw->misc.real_NumLock);
update_num_lock();
break;
case srm_META_SENDS_ESC:
DoRM(DP_META_SENDS_ESC, screen->meta_sends_esc);
update_meta_esc();
break;
#endif
case srm_DELETE_IS_DEL:
DoRM(DP_DELETE_IS_DEL, screen->delete_is_del);
update_delete_del();
break;
#if OPT_NUM_LOCK
case srm_ALT_SENDS_ESC:
DoRM(DP_ALT_SENDS_ESC, screen->alt_sends_esc);
update_alt_esc();
break;
#endif
case srm_KEEP_SELECTION:
DoRM(DP_KEEP_SELECTION, screen->keepSelection);
update_keepSelection();
break;
case srm_SELECT_TO_CLIPBOARD:
DoRM(DP_SELECT_TO_CLIPBOARD, screen->selectToClipboard);
update_selectToClipboard();
break;
case srm_BELL_IS_URGENT:
DoRM(DP_BELL_IS_URGENT, screen->bellIsUrgent);
update_bellIsUrgent();
break;
case srm_POP_ON_BELL:
DoRM(DP_POP_ON_BELL, screen->poponbell);
update_poponbell();
break;
#if OPT_TCAP_FKEYS
case srm_TCAP_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SUN_FUNC_KEYS
case srm_SUN_FKEYS:
/* FALLTHRU */
#endif
#if OPT_HP_FUNC_KEYS
case srm_HP_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SCO_FUNC_KEYS
case srm_SCO_FKEYS:
/* FALLTHRU */
#endif
#if OPT_SUNPC_KBD
case srm_VT220_FKEYS:
/* FALLTHRU */
#endif
case srm_LEGACY_FKEYS:
xw->keyboard.type = (xtermKeyboardType) screen->save_modes[DP_KEYBOARD_TYPE];
break;
#if OPT_READLINE
case srm_BUTTON1_MOVE_POINT:
SCREEN_FLAG_restore(screen, click1_moves);
break;
case srm_BUTTON2_MOVE_POINT:
SCREEN_FLAG_restore(screen, paste_moves);
break;
case srm_DBUTTON3_DELETE:
SCREEN_FLAG_restore(screen, dclick3_deletes);
break;
case srm_PASTE_IN_BRACKET:
SCREEN_FLAG_restore(screen, paste_brackets);
break;
case srm_PASTE_QUOTE:
SCREEN_FLAG_restore(screen, paste_quotes);
break;
case srm_PASTE_LITERAL_NL:
SCREEN_FLAG_restore(screen, paste_literal_nl);
break;
#endif /* OPT_READLINE */
#if OPT_SIXEL_GRAPHICS
case srm_PRIVATE_COLOR_REGISTERS: /* private color registers for each graphic */
TRACE(("restore PRIVATE_COLOR_REGISTERS %s\n",
BtoS(screen->privatecolorregisters)));
DoRM(DP_X_PRIVATE_COLOR_REGISTERS, screen->privatecolorregisters);
update_privatecolorregisters();
break;
#endif
}
}
}
/*
* Convert an XTextProperty to a string.
*
* This frees the data owned by the XTextProperty, and returns in its place the
* string, which must be freed by the caller.
*/
static char *
property_to_string(XtermWidget xw, XTextProperty * text)
{
TScreen *screen = TScreenOf(xw);
Display *dpy = screen->display;
char *result = 0;
char **list;
int length = 0;
int rc;
TRACE(("property_to_string value %p, encoding %s, format %d, nitems %ld\n",
text->value,
XGetAtomName(dpy, text->encoding),
text->format,
text->nitems));
#if OPT_WIDE_CHARS
/*
* We will use the XmbTextPropertyToTextList call to extract UTF-8 data.
* The xtermUtf8ToTextList() call is used to convert UTF-8 explicitly to
* ISO-8859-1.
*/
if ((text->format != 8)
|| IsTitleMode(xw, tmGetUtf8)
|| (rc = xtermUtf8ToTextList(xw, text, &list, &length)) < 0)
#endif
if ((rc = XmbTextPropertyToTextList(dpy, text, &list, &length)) < 0)
rc = XTextPropertyToStringList(text, &list, &length);
if (rc >= 0) {
int n, c, pass;
size_t need = 0;
for (pass = 0; pass < 2; ++pass) {
for (n = 0, need = 0; n < length; n++) {
char *s = list[n];
while ((c = *s++) != '\0') {
if (pass)
result[need] = (char) c;
++need;
}
}
if (pass)
result[need] = '\0';
else
result = malloc(need + 1);
if (result == 0)
break;
}
XFreeStringList(list);
}
if (text->value != 0)
XFree(text->value);
return result;
}
static char *
get_icon_label(XtermWidget xw)
{
XTextProperty text;
char *result = 0;
if (XGetWMIconName(TScreenOf(xw)->display, VShellWindow(xw), &text)) {
result = property_to_string(xw, &text);
}
return result;
}
static char *
get_window_label(XtermWidget xw)
{
XTextProperty text;
char *result = 0;
if (XGetWMName(TScreenOf(xw)->display, VShellWindow(xw), &text)) {
result = property_to_string(xw, &text);
}
return result;
}
/*
* Report window label (icon or title) in dtterm protocol
* ESC ] code label ESC backslash
*/
static void
report_win_label(XtermWidget xw,
int code,
char *text)
{
unparseputc(xw, ANSI_ESC);
unparseputc(xw, ']');
unparseputc(xw, code);
if (text != 0) {
int copy = IsTitleMode(xw, tmGetBase16);
if (copy) {
TRACE(("Encoding hex:%s\n", text));
text = x_encode_hex(text);
}
unparseputs(xw, text);
if (copy)
free(text);
}
unparseputc(xw, ANSI_ESC);
unparseputc(xw, '\\'); /* should be ST */
unparse_end(xw);
}
/*
* Window operations (from CDE dtterm description, as well as extensions).
* See also "allowWindowOps" resource.
*/
static void
window_ops(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
XWindowChanges values;
XWindowAttributes win_attrs;
unsigned value_mask;
#if OPT_MAXIMIZE
unsigned root_width;
unsigned root_height;
#endif
int code = zero_if_default(0);
char *label;
TRACE(("window_ops %d\n", code));
switch (code) {
case ewRestoreWin: /* Restore (de-iconify) window */
if (AllowWindowOps(xw, ewRestoreWin)) {
TRACE(("...de-iconify window\n"));
XMapWindow(screen->display,
VShellWindow(xw));
}
break;
case ewMinimizeWin: /* Minimize (iconify) window */
if (AllowWindowOps(xw, ewMinimizeWin)) {
TRACE(("...iconify window\n"));
XIconifyWindow(screen->display,
VShellWindow(xw),
DefaultScreen(screen->display));
}
break;
case ewSetWinPosition: /* Move the window to the given position */
if (AllowWindowOps(xw, ewSetWinPosition)) {
values.x = zero_if_default(1);
values.y = zero_if_default(2);
TRACE(("...move window to %d,%d\n", values.x, values.y));
value_mask = (CWX | CWY);
XReconfigureWMWindow(screen->display,
VShellWindow(xw),
DefaultScreen(screen->display),
value_mask,
&values);
}
break;
case ewSetWinSizePixels: /* Resize the window to given size in pixels */
if (AllowWindowOps(xw, ewSetWinSizePixels)) {
RequestResize(xw, optional_param(1), optional_param(2), False);
}
break;
case ewRaiseWin: /* Raise the window to the front of the stack */
if (AllowWindowOps(xw, ewRaiseWin)) {
TRACE(("...raise window\n"));
XRaiseWindow(screen->display, VShellWindow(xw));
}
break;
case ewLowerWin: /* Lower the window to the bottom of the stack */
if (AllowWindowOps(xw, ewLowerWin)) {
TRACE(("...lower window\n"));
XLowerWindow(screen->display, VShellWindow(xw));
}
break;
case ewRefreshWin: /* Refresh the window */
if (AllowWindowOps(xw, ewRefreshWin)) {
TRACE(("...redraw window\n"));
Redraw();
}
break;
case ewSetWinSizeChars: /* Resize the text-area, in characters */
if (AllowWindowOps(xw, ewSetWinSizeChars)) {
RequestResize(xw, optional_param(1), optional_param(2), True);
}
break;
#if OPT_MAXIMIZE
case ewMaximizeWin: /* Maximize or restore */
if (AllowWindowOps(xw, ewMaximizeWin)) {
RequestMaximize(xw, zero_if_default(1));
}
break;
case ewFullscreenWin: /* Fullscreen or restore */
if (AllowWindowOps(xw, ewFullscreenWin)) {
FullScreen(xw, zero_if_default(1));
}
break;
#endif
case ewGetWinState: /* Report the window's state */
if (AllowWindowOps(xw, ewGetWinState)) {
TRACE(("...get window attributes\n"));
xtermGetWinAttrs(screen->display,
VWindow(screen),
&win_attrs);
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 1;
reply.a_param[0] = (ParmType) ((win_attrs.map_state == IsViewable)
? 1
: 2);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
}
break;
case ewGetWinPosition: /* Report the window's position */
if (AllowWindowOps(xw, ewGetWinPosition)) {
TRACE(("...get window position\n"));
xtermGetWinAttrs(screen->display,
WMFrameWindow(xw),
&win_attrs);
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 3;
reply.a_param[1] = (ParmType) win_attrs.x;
reply.a_param[2] = (ParmType) win_attrs.y;
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
}
break;
case ewGetWinSizePixels: /* Report the window's size in pixels */
if (AllowWindowOps(xw, ewGetWinSizePixels)) {
TRACE(("...get window size in pixels\n"));
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 4;
reply.a_param[1] = (ParmType) Height(screen);
reply.a_param[2] = (ParmType) Width(screen);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
}
break;
case ewGetWinSizeChars: /* Report the text's size in characters */
if (AllowWindowOps(xw, ewGetWinSizeChars)) {
TRACE(("...get window size in characters\n"));
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 8;
reply.a_param[1] = (ParmType) MaxRows(screen);
reply.a_param[2] = (ParmType) MaxCols(screen);
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
}
break;
#if OPT_MAXIMIZE
case ewGetScreenSizeChars: /* Report the screen's size, in characters */
if (AllowWindowOps(xw, ewGetScreenSizeChars)) {
TRACE(("...get screen size in characters\n"));
(void) QueryMaximize(xw, &root_height, &root_width);
init_reply(ANSI_CSI);
reply.a_pintro = 0;
reply.a_nparam = 3;
reply.a_param[0] = 9;
reply.a_param[1] = (ParmType) (root_height
/ (unsigned) FontHeight(screen));
reply.a_param[2] = (ParmType) (root_width
/ (unsigned) FontWidth(screen));
reply.a_inters = 0;
reply.a_final = 't';
unparseseq(xw, &reply);
}
break;
#endif
case ewGetIconTitle: /* Report the icon's label */
if (AllowWindowOps(xw, ewGetIconTitle)) {
TRACE(("...get icon's label\n"));
report_win_label(xw, 'L', label = get_icon_label(xw));
free(label);
}
break;
case ewGetWinTitle: /* Report the window's title */
if (AllowWindowOps(xw, ewGetWinTitle)) {
TRACE(("...get window's label\n"));
report_win_label(xw, 'l', label = get_window_label(xw));
free(label);
}
break;
case ewPushTitle: /* save the window's title(s) on stack */
if (AllowWindowOps(xw, ewPushTitle)) {
SaveTitle *last = screen->save_title;
SaveTitle *item = TypeCalloc(SaveTitle);
TRACE(("...push title onto stack\n"));
if (item != 0) {
switch (zero_if_default(1)) {
case 0:
item->iconName = get_icon_label(xw);
item->windowName = get_window_label(xw);
break;
case 1:
item->iconName = get_icon_label(xw);
break;
case 2:
item->windowName = get_window_label(xw);
break;
}
item->next = last;
if (item->iconName == 0) {
item->iconName = ((last == 0)
? get_icon_label(xw)
: x_strdup(last->iconName));
}
if (item->windowName == 0) {
item->windowName = ((last == 0)
? get_window_label(xw)
: x_strdup(last->windowName));
}
screen->save_title = item;
}
}
break;
case ewPopTitle: /* restore the window's title(s) from stack */
if (AllowWindowOps(xw, ewPopTitle)) {
SaveTitle *item = screen->save_title;
TRACE(("...pop title off stack\n"));
if (item != 0) {
switch (zero_if_default(1)) {
case 0:
ChangeIconName(xw, item->iconName);
ChangeTitle(xw, item->windowName);
break;
case 1:
ChangeIconName(xw, item->iconName);
break;
case 2:
ChangeTitle(xw, item->windowName);
break;
}
screen->save_title = item->next;
free(item->iconName);
free(item->windowName);
free(item);
}
}
break;
default: /* DECSLPP (24, 25, 36, 48, 72, 144) */
if (AllowWindowOps(xw, ewSetWinLines)) {
if (code >= 24)
RequestResize(xw, code, -1, True);
}
break;
}
}
/*
* set a bit in a word given a pointer to the word and a mask.
*/
static int
bitset(unsigned *p, unsigned mask)
{
unsigned before = *p;
*p |= mask;
return (before != *p);
}
/*
* clear a bit in a word given a pointer to the word and a mask.
*/
static int
bitclr(unsigned *p, unsigned mask)
{
unsigned before = *p;
*p &= ~mask;
return (before != *p);
}
/*
* Copy bits from one word to another, given a mask
*/
static int
bitcpy(unsigned *p, unsigned q, unsigned mask)
{
unsigned before = *p;
bitclr(p, mask);
bitset(p, q & mask);
return (before != *p);
}
void
unparseputc1(XtermWidget xw, int c)
{
if (c >= 0x80 && c <= 0x9F) {
if (!TScreenOf(xw)->control_eight_bits) {
unparseputc(xw, A2E(ANSI_ESC));
c = A2E(c - 0x40);
}
}
unparseputc(xw, c);
}
void
unparseseq(XtermWidget xw, ANSI *ap)
{
int c;
int i;
int inters;
unparseputc1(xw, c = ap->a_type);
if (c == ANSI_ESC
|| c == ANSI_DCS
|| c == ANSI_CSI
|| c == ANSI_OSC
|| c == ANSI_PM
|| c == ANSI_APC
|| c == ANSI_SS3) {
if (ap->a_pintro != 0)
unparseputc(xw, ap->a_pintro);
for (i = 0; i < ap->a_nparam; ++i) {
if (i != 0) {
if (ap->a_delim) {
unparseputs(xw, ap->a_delim);
} else {
unparseputc(xw, ';');
}
}
if (ap->a_radix[i]) {
char temp[8];
sprintf(temp, "%04X", ap->a_param[i] & 0xffff);
unparseputs(xw, temp);
} else {
unparseputn(xw, (unsigned int) ap->a_param[i]);
}
}
if ((inters = ap->a_inters) != 0) {
for (i = 3; i >= 0; --i) {
c = CharOf(inters >> (8 * i));
if (c != 0)
unparseputc(xw, c);
}
}
switch (ap->a_type) {
case ANSI_DCS:
case ANSI_OSC:
case ANSI_PM:
case ANSI_APC:
unparseputc1(xw, ANSI_ST);
break;
default:
unparseputc(xw, (char) ap->a_final);
break;
}
}
unparse_end(xw);
}
void
unparseputn(XtermWidget xw, unsigned int n)
{
unsigned int q;
q = n / 10;
if (q != 0)
unparseputn(xw, q);
unparseputc(xw, (char) ('0' + (n % 10)));
}
void
unparseputs(XtermWidget xw, const char *s)
{
if (s != 0) {
while (*s)
unparseputc(xw, *s++);
}
}
void
unparseputc(XtermWidget xw, int c)
{
TScreen *screen = TScreenOf(xw);
IChar *buf = screen->unparse_bfr;
unsigned len;
if ((screen->unparse_len + 2) >= sizeof(screen->unparse_bfr) / sizeof(IChar))
unparse_end(xw);
len = screen->unparse_len;
#if OPT_TCAP_QUERY
/*
* If we're returning a termcap string, it has to be translated since
* a DCS must not contain any characters except for the normal 7-bit
* printable ASCII (counting tab, carriage return, etc). For now,
* just use hexadecimal for the whole thing.
*/
if (screen->tc_query_code >= 0) {
char tmp[3];
sprintf(tmp, "%02X", c & 0xFF);
buf[len++] = CharOf(tmp[0]);
buf[len++] = CharOf(tmp[1]);
} else
#endif
if ((buf[len++] = (IChar) c) == '\r' && (xw->flags & LINEFEED)) {
buf[len++] = '\n';
}
screen->unparse_len = len;
/* If send/receive mode is reset, we echo characters locally */
if ((xw->keyboard.flags & MODE_SRM) == 0) {
(void) doparsing(xw, (unsigned) c, &myState);
}
}
void
unparse_end(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
if (screen->unparse_len) {
#ifdef VMS
tt_write(screen->unparse_bfr, screen->unparse_len);
#else /* VMS */
writePtyData(screen->respond, screen->unparse_bfr, screen->unparse_len);
#endif /* VMS */
screen->unparse_len = 0;
}
}
void
ToggleAlternate(XtermWidget xw)
{
if (TScreenOf(xw)->whichBuf)
FromAlternate(xw);
else
ToAlternate(xw, False);
}
static void
ToAlternate(XtermWidget xw, Bool clearFirst)
{
TScreen *screen = TScreenOf(xw);
if (screen->whichBuf == 0) {
TRACE(("ToAlternate\n"));
if (!screen->editBuf_index[1])
screen->editBuf_index[1] = allocScrnBuf(xw,
(unsigned) MaxRows(screen),
(unsigned) MaxCols(screen),
&screen->editBuf_data[1]);
SwitchBufs(xw, 1, clearFirst);
screen->whichBuf = 1;
#if OPT_SAVE_LINES
screen->visbuf = screen->editBuf_index[screen->whichBuf];
#endif
update_altscreen();
}
}
static void
FromAlternate(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
if (screen->whichBuf != 0) {
TRACE(("FromAlternate\n"));
if (screen->scroll_amt)
FlushScroll(xw);
screen->whichBuf = 0;
SwitchBufs(xw, 0, False);
#if OPT_SAVE_LINES
screen->visbuf = screen->editBuf_index[screen->whichBuf];
#endif
update_altscreen();
}
}
static void
SwitchBufs(XtermWidget xw, int toBuf, Bool clearFirst)
{
TScreen *screen = TScreenOf(xw);
int rows, top;
if (screen->cursor_state)
HideCursor();
rows = MaxRows(screen);
SwitchBufPtrs(screen, toBuf);
if ((top = INX2ROW(screen, 0)) < rows) {
if (screen->scroll_amt) {
FlushScroll(xw);
}
#if OPT_DOUBLE_BUFFER
XFillRectangle(screen->display,
VDrawable(screen),
ReverseGC(xw, screen),
(int) OriginX(screen),
(int) top * FontHeight(screen) + screen->border,
(unsigned) Width(screen),
(unsigned) ((rows - top) * FontHeight(screen)));
#else
XClearArea(screen->display,
VWindow(screen),
(int) OriginX(screen),
(int) top * FontHeight(screen) + screen->border,
(unsigned) Width(screen),
(unsigned) ((rows - top) * FontHeight(screen)),
False);
#endif
if (clearFirst) {
ClearBufRows(xw, top, rows);
}
}
ScrnUpdate(xw, 0, 0, rows, MaxCols(screen), False);
}
Bool
CheckBufPtrs(TScreen *screen)
{
return (screen->visbuf != 0
#if OPT_SAVE_LINES
&& screen->editBuf_index[0] != 0
#endif
&& screen->editBuf_index[1] != 0);
}
/*
* Swap buffer line pointers between alternate and regular screens.
*/
void
SwitchBufPtrs(TScreen *screen, int toBuf GCC_UNUSED)
{
if (CheckBufPtrs(screen)) {
#if OPT_SAVE_LINES
screen->visbuf = screen->editBuf_index[toBuf];
#else
size_t len = ScrnPointers(screen, (size_t) MaxRows(screen));
memcpy(screen->save_ptr, screen->visbuf, len);
memcpy(screen->visbuf, screen->editBuf_index[1], len);
memcpy(screen->editBuf_index[1], screen->save_ptr, len);
#endif
}
}
void
VTRun(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
TRACE(("VTRun ...\n"));
if (!screen->Vshow) {
set_vt_visibility(True);
}
update_vttekmode();
update_vtshow();
update_tekshow();
set_vthide_sensitivity();
ScrnAllocBuf(xw);
screen->cursor_state = OFF;
screen->cursor_set = ON;
#if OPT_BLINK_CURS
if (DoStartBlinking(screen))
StartBlinking(screen);
#endif
#if OPT_TEK4014
if (Tpushb > Tpushback) {
fillPtyData(xw, VTbuffer, (char *) Tpushback, (int) (Tpushb - Tpushback));
Tpushb = Tpushback;
}
#endif
screen->is_running = True;
if (screen->embed_high && screen->embed_wide) {
ScreenResize(xw, screen->embed_wide, screen->embed_high, &(xw->flags));
}
#if OPT_MAXIMIZE
else if (resource.fullscreen == esTrue || resource.fullscreen == esAlways)
FullScreen(term, True);
#endif
if (!setjmp(VTend))
VTparse(xw);
StopBlinking(screen);
HideCursor();
screen->cursor_set = OFF;
TRACE(("... VTRun\n"));
}
/*ARGSUSED*/
static void
VTExpose(Widget w GCC_UNUSED,
XEvent * event,
Region region GCC_UNUSED)
{
DEBUG_MSG("Expose\n");
if (event->type == Expose)
HandleExposure(term, event);
}
static void
VTGraphicsOrNoExpose(XEvent * event)
{
TScreen *screen = TScreenOf(term);
if (screen->incopy <= 0) {
screen->incopy = 1;
if (screen->scrolls > 0)
screen->scrolls--;
}
if (event->type == GraphicsExpose)
if (HandleExposure(term, event))
screen->cursor_state = OFF;
if ((event->type == NoExpose)
|| ((XGraphicsExposeEvent *) event)->count == 0) {
if (screen->incopy <= 0 && screen->scrolls > 0)
screen->scrolls--;
if (screen->scrolls)
screen->incopy = -1;
else
screen->incopy = 0;
}
}
/*ARGSUSED*/
static void
VTNonMaskableEvent(Widget w GCC_UNUSED,
XtPointer closure GCC_UNUSED,
XEvent * event,
Boolean *cont GCC_UNUSED)
{
switch (event->type) {
case GraphicsExpose:
case NoExpose:
VTGraphicsOrNoExpose(event);
break;
}
}
static void
VTResize(Widget w)
{
if (XtIsRealized(w)) {
XtermWidget xw = (XtermWidget) w;
ScreenResize(xw, xw->core.width, xw->core.height, &xw->flags);
}
}
#define okDimension(src,dst) ((src <= 32767) \
&& ((dst = (Dimension) src) == src))
static void
RequestResize(XtermWidget xw, int rows, int cols, Bool text)
{
TScreen *screen = TScreenOf(xw);
unsigned long value;
Dimension replyWidth, replyHeight;
Dimension askedWidth, askedHeight;
XtGeometryResult status;
XWindowAttributes attrs;
TRACE(("RequestResize(rows=%d, cols=%d, text=%d)\n", rows, cols, text));
if ((int) (askedWidth = (Dimension) cols) < cols
|| (int) (askedHeight = (Dimension) rows) < rows)
return;
if (askedHeight == 0
|| askedWidth == 0
|| xw->misc.limit_resize > 0) {
xtermGetWinAttrs(XtDisplay(xw),
RootWindowOfScreen(XtScreen(xw)), &attrs);
}
if (text) {
if ((value = (unsigned long) rows) != 0) {
if (rows < 0)
value = (unsigned long) MaxRows(screen);
value *= (unsigned long) FontHeight(screen);
value += (unsigned long) (2 * screen->border);
if (!okDimension(value, askedHeight))
return;
}
if ((value = (unsigned long) cols) != 0) {
if (cols < 0)
value = (unsigned long) MaxCols(screen);
value *= (unsigned long) FontWidth(screen);
value += (unsigned long) ((2 * screen->border)
+ ScrollbarWidth(screen));
if (!okDimension(value, askedWidth))
return;
}
} else {
if (rows < 0)
askedHeight = FullHeight(screen);
if (cols < 0)
askedWidth = FullWidth(screen);
}
if (rows == 0)
askedHeight = (Dimension) attrs.height;
if (cols == 0)
askedWidth = (Dimension) attrs.width;
if (xw->misc.limit_resize > 0) {
Dimension high = (Dimension) (xw->misc.limit_resize * attrs.height);
Dimension wide = (Dimension) (xw->misc.limit_resize * attrs.width);
if ((int) high < attrs.height)
high = (Dimension) attrs.height;
if (askedHeight > high)
askedHeight = high;
if ((int) wide < attrs.width)
wide = (Dimension) attrs.width;
if (askedWidth > wide)
askedWidth = wide;
}
#ifndef nothack
getXtermSizeHints(xw);
#endif
TRACE(("...requesting resize %dx%d\n", askedHeight, askedWidth));
status = REQ_RESIZE((Widget) xw,
askedWidth, askedHeight,
&replyWidth, &replyHeight);
if (status == XtGeometryYes ||
status == XtGeometryDone) {
ScreenResize(xw, replyWidth, replyHeight, &xw->flags);
}
#ifndef nothack
/*
* XtMakeResizeRequest() has the undesirable side-effect of clearing
* the window manager's hints, even on a failed request. This would
* presumably be fixed if the shell did its own work.
*/
if (xw->hints.flags
&& replyHeight
&& replyWidth) {
xw->hints.height = replyHeight;
xw->hints.width = replyWidth;
TRACE(("%s@%d -- ", __FILE__, __LINE__));
TRACE_HINTS(&xw->hints);
XSetWMNormalHints(screen->display, VShellWindow(xw), &xw->hints);
TRACE(("%s@%d -- ", __FILE__, __LINE__));
TRACE_WM_HINTS(xw);
}
#endif
XSync(screen->display, False); /* synchronize */
if (xtermAppPending())
xevents();
TRACE(("...RequestResize done\n"));
}
static String xterm_trans =
"WM_PROTOCOLS: DeleteWindow()\n\
: KeyboardMapping()\n";
int
VTInit(XtermWidget xw)
{
Widget vtparent = SHELL_OF(xw);
TRACE(("VTInit {{\n"));
XtRealizeWidget(vtparent);
XtOverrideTranslations(vtparent, XtParseTranslationTable(xterm_trans));
(void) XSetWMProtocols(XtDisplay(vtparent), XtWindow(vtparent),
&wm_delete_window, 1);
TRACE_TRANS("shell", vtparent);
TRACE_TRANS("vt100", (Widget) (xw));
ScrnAllocBuf(xw);
TRACE(("...}} VTInit\n"));
return (1);
}
static void
VTClassInit(void)
{
XtAddConverter(XtRString, XtRGravity, XmuCvtStringToGravity,
(XtConvertArgList) NULL, (Cardinal) 0);
}
#if OPT_COLOR_RES
/*
* Override the use of XtDefaultForeground/XtDefaultBackground to make some
* colors, such as cursor color, use the actual foreground/background value
* if there is no explicit resource value used.
*/
static Pixel
fill_Tres(XtermWidget target, XtermWidget source, int offset)
{
char *name;
ScrnColors temp;
TScreen *src = TScreenOf(source);
TScreen *dst = TScreenOf(target);
dst->Tcolors[offset] = src->Tcolors[offset];
dst->Tcolors[offset].mode = False;
if ((name = x_strtrim(dst->Tcolors[offset].resource)) != 0)
dst->Tcolors[offset].resource = name;
if (name == 0) {
dst->Tcolors[offset].value = target->dft_foreground;
} else if (isDefaultForeground(name)) {
dst->Tcolors[offset].value = ((offset == TEXT_FG || offset == TEXT_BG)
? target->dft_foreground
: dst->Tcolors[TEXT_FG].value);
} else if (isDefaultBackground(name)) {
dst->Tcolors[offset].value = ((offset == TEXT_FG || offset == TEXT_BG)
? target->dft_background
: dst->Tcolors[TEXT_BG].value);
} else {
memset(&temp, 0, sizeof(temp));
if (AllocateTermColor(target, &temp, offset, name, True)) {
if (COLOR_DEFINED(&(temp), offset))
free(temp.names[offset]);
dst->Tcolors[offset].value = temp.colors[offset];
} else if (offset == TEXT_FG || offset == TEXT_BG) {
free(name);
dst->Tcolors[offset].resource = 0;
}
}
return dst->Tcolors[offset].value;
}
/*
* If one or both of the foreground/background colors cannot be allocated,
* e.g., due to gross misconfiguration, recover by setting both to the
* display's default values.
*/
static void
repairColors(XtermWidget target)
{
TScreen *screen = TScreenOf(target);
if (screen->Tcolors[TEXT_FG].resource == 0 ||
screen->Tcolors[TEXT_BG].resource == 0) {
xtermWarning("unable to allocate fg/bg colors\n");
screen->Tcolors[TEXT_FG].resource = x_strdup(XtDefaultForeground);
screen->Tcolors[TEXT_BG].resource = x_strdup(XtDefaultBackground);
if (screen->Tcolors[TEXT_FG].resource == 0 ||
screen->Tcolors[TEXT_BG].resource == 0) {
Exit(1);
}
screen->Tcolors[TEXT_FG].value = target->dft_foreground;
screen->Tcolors[TEXT_BG].value = target->dft_background;
}
}
#else
#define fill_Tres(target, source, offset) \
TScreenOf(target)->Tcolors[offset] = TScreenOf(source)->Tcolors[offset]
#define repairColors(target) /* nothing */
#endif
#if OPT_WIDE_CHARS
static void
VTInitialize_locale(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
Bool is_utf8 = xtermEnvUTF8();
TRACE(("VTInitialize_locale\n"));
TRACE(("... request screen.utf8_mode = %d\n", screen->utf8_mode));
TRACE(("... request screen.utf8_fonts = %d\n", screen->utf8_fonts));
if (screen->utf8_mode < 0)
screen->utf8_mode = uFalse;
if (screen->utf8_mode > 3)
screen->utf8_mode = uDefault;
screen->latin9_mode = 0;
screen->unicode_font = 0;
#if OPT_LUIT_PROG
xw->misc.callfilter = 0;
xw->misc.use_encoding = 0;
TRACE(("... setup for luit:\n"));
TRACE(("... request misc.locale_str = \"%s\"\n", xw->misc.locale_str));
if (screen->utf8_mode == uFalse) {
TRACE(("... command-line +u8 overrides\n"));
} else
#if OPT_MINI_LUIT
if (x_strcasecmp(xw->misc.locale_str, "CHECKFONT") == 0) {
int fl = (xw->misc.default_font.f_n
? (int) strlen(xw->misc.default_font.f_n)
: 0);
if (fl > 11
&& x_strcasecmp(xw->misc.default_font.f_n + fl - 11,
"-ISO10646-1") == 0) {
screen->unicode_font = 1;
/* unicode font, use True */
#ifdef HAVE_LANGINFO_CODESET
if (!strcmp(xtermEnvEncoding(), "ANSI_X3.4-1968")
|| !strcmp(xtermEnvEncoding(), "ISO-8859-1")) {
if (screen->utf8_mode == uDefault)
screen->utf8_mode = uFalse;
} else if (!strcmp(xtermEnvEncoding(), "ISO-8859-15")) {
if (screen->utf8_mode == uDefault)
screen->utf8_mode = uFalse;
screen->latin9_mode = 1;
} else {
xw->misc.callfilter = (Boolean) (is_utf8 ? 0 : 1);
screen->utf8_mode = uAlways;
}
#else
xw->misc.callfilter = is_utf8 ? 0 : 1;
screen->utf8_mode = uAlways;
#endif
} else {
/* other encoding, use False */
if (screen->utf8_mode == uDefault) {
screen->utf8_mode = is_utf8 ? uAlways : uFalse;
}
}
} else
#endif /* OPT_MINI_LUIT */
if (x_strcasecmp(xw->misc.locale_str, "TRUE") == 0 ||
x_strcasecmp(xw->misc.locale_str, "ON") == 0 ||
x_strcasecmp(xw->misc.locale_str, "YES") == 0 ||
x_strcasecmp(xw->misc.locale_str, "AUTO") == 0 ||
strcmp(xw->misc.locale_str, "1") == 0) {
/* when true ... fully obeying LC_CTYPE locale */
xw->misc.callfilter = (Boolean) (is_utf8 ? 0 : 1);
screen->utf8_mode = uAlways;
} else if (x_strcasecmp(xw->misc.locale_str, "FALSE") == 0 ||
x_strcasecmp(xw->misc.locale_str, "OFF") == 0 ||
x_strcasecmp(xw->misc.locale_str, "NO") == 0 ||
strcmp(xw->misc.locale_str, "0") == 0) {
/* when false ... original value of utf8_mode is effective */
if (screen->utf8_mode == uDefault) {
screen->utf8_mode = is_utf8 ? uAlways : uFalse;
}
} else if (x_strcasecmp(xw->misc.locale_str, "MEDIUM") == 0 ||
x_strcasecmp(xw->misc.locale_str, "SEMIAUTO") == 0) {
/* when medium ... obeying locale only for UTF-8 and Asian */
if (is_utf8) {
screen->utf8_mode = uAlways;
} else if (
#ifdef MB_CUR_MAX
MB_CUR_MAX > 1 ||
#else
!strncmp(xtermEnvLocale(), "ja", (size_t) 2) ||
!strncmp(xtermEnvLocale(), "ko", (size_t) 2) ||
!strncmp(xtermEnvLocale(), "zh", (size_t) 2) ||
#endif
!strncmp(xtermEnvLocale(), "th", (size_t) 2) ||
!strncmp(xtermEnvLocale(), "vi", (size_t) 2)) {
xw->misc.callfilter = 1;
screen->utf8_mode = uAlways;
} else {
screen->utf8_mode = uFalse;
}
} else if (x_strcasecmp(xw->misc.locale_str, "UTF-8") == 0 ||
x_strcasecmp(xw->misc.locale_str, "UTF8") == 0) {
/* when UTF-8 ... UTF-8 mode */
screen->utf8_mode = uAlways;
} else {
/* other words are regarded as encoding name passed to luit */
xw->misc.callfilter = 1;
screen->utf8_mode = uAlways;
xw->misc.use_encoding = 1;
}
TRACE(("... updated misc.callfilter = %s\n", BtoS(xw->misc.callfilter)));
TRACE(("... updated misc.use_encoding = %s\n", BtoS(xw->misc.use_encoding)));
#else
if (screen->utf8_mode == uDefault) {
screen->utf8_mode = is_utf8 ? uAlways : uFalse;
}
#endif /* OPT_LUIT_PROG */
if (screen->utf8_fonts == uDefault) {
switch (screen->utf8_mode) {
case uFalse:
case uTrue:
screen->utf8_fonts = screen->utf8_mode;
break;
case uDefault:
/* should not happen */
screen->utf8_fonts = uTrue;
break;
case uAlways:
/* use this to disable menu entry */
break;
}
}
screen->utf8_inparse = (Boolean) (screen->utf8_mode != uFalse);
TRACE(("... updated screen.utf8_mode = %d\n", screen->utf8_mode));
TRACE(("... updated screen.utf8_fonts = %d\n", screen->utf8_fonts));
TRACE(("...VTInitialize_locale done\n"));
}
#endif
void
lookupSelectUnit(XtermWidget xw, Cardinal item, String value)
{
/* *INDENT-OFF* */
static struct {
const char * name;
SelectUnit code;
} table[] = {
{ "char", Select_CHAR },
{ "word", Select_WORD },
{ "line", Select_LINE },
{ "group", Select_GROUP },
{ "page", Select_PAGE },
{ "all", Select_ALL },
#if OPT_SELECT_REGEX
{ "regex", Select_REGEX },
#endif
};
/* *INDENT-ON* */
TScreen *screen = TScreenOf(xw);
String next = x_skip_nonblanks(value);
Cardinal n;
screen->selectMap[item] = NSELECTUNITS;
for (n = 0; n < XtNumber(table); ++n) {
if (!x_strncasecmp(table[n].name, value, (unsigned) (next - value))) {
screen->selectMap[item] = table[n].code;
#if OPT_SELECT_REGEX
if (table[n].code == Select_REGEX) {
screen->selectExpr[item] = x_strtrim(next);
TRACE(("Parsed regex \"%s\"\n", screen->selectExpr[item]));
}
#endif
break;
}
}
}
static void
ParseOnClicks(XtermWidget wnew, XtermWidget wreq, Cardinal item)
{
lookupSelectUnit(wnew, item, TScreenOf(wreq)->onClick[item]);
}
/*
* Parse a comma-separated list, returning a string which the caller must
* free, and updating the source pointer.
*/
static char *
ParseList(const char **source)
{
const char *base = *source;
const char *next;
size_t size;
char *value = 0;
char *result;
/* ignore empty values */
while (*base == ',')
++base;
if (*base != '\0') {
next = base;
while (*next != '\0' && *next != ',')
++next;
size = (size_t) (1 + next - base);
value = malloc(size);
if (value != 0) {
memcpy(value, base, size);
value[size - 1] = '\0';
}
*source = next;
} else {
*source = base;
}
result = x_strtrim(value);
free(value);
return result;
}
static void
set_flags_from_list(char *target,
const char *source,
FlagList * list,
Cardinal limit)
{
Cardinal n;
int value = -1;
while (!IsEmpty(source)) {
char *next = ParseList(&source);
Boolean found = False;
if (next == 0)
break;
if (isdigit(CharOf(*next))) {
char *temp;
value = (int) strtol(next, &temp, 0);
if (!IsEmpty(temp)) {
xtermWarning("Expected a number: %s\n", next);
} else {
for (n = 0; n < limit; ++n) {
if (list[n].code == value) {
target[value] = 1;
found = True;
break;
}
}
}
} else {
for (n = 0; n < limit; ++n) {
if (!x_strcasecmp(next, list[n].name)) {
value = list[n].code;
target[value] = 1;
found = True;
break;
}
}
}
if (!found) {
xtermWarning("Unrecognized keyword: %s\n", next);
} else {
TRACE(("...found %s (%d)\n", next, value));
}
free(next);
}
}
#if OPT_RENDERFONT
static void
trimSizeFromFace(char *face_name, float *face_size)
{
char *first = strstr(face_name, ":size=");
if (first == 0) {
first = face_name;
} else {
first++;
}
if (!strncmp(first, "size=", (size_t) 5)) {
char *last = strchr(first, ':');
char mark;
float value;
char extra;
if (last == 0)
last = first + strlen(first);
mark = *last;
*last = '\0';
if (sscanf(first, "size=%g%c", &value, &extra) == 1) {
TRACE(("...trimmed size from font: %g\n", value));
if (face_size != 0)
*face_size = value;
}
if (mark) {
while ((*first++ = *++last) != '\0') {
;
}
} else {
if (first != face_name)
--first;
*first = '\0';
}
TRACE(("...after trimming, font = \"%s\"\n", face_name));
}
}
#endif
/* ARGSUSED */
static void
VTInitialize(Widget wrequest,
Widget new_arg,
ArgList args GCC_UNUSED,
Cardinal *num_args GCC_UNUSED)
{
#define Kolor(name) TScreenOf(wnew)->name.resource
#define TxtFg(name) !x_strcasecmp(Kolor(Tcolors[TEXT_FG]), Kolor(name))
#define TxtBg(name) !x_strcasecmp(Kolor(Tcolors[TEXT_BG]), Kolor(name))
#define DftFg(name) isDefaultForeground(Kolor(name))
#define DftBg(name) isDefaultBackground(Kolor(name))
#define DATA(name) { #name, ec##name }
static FlagList tblColorOps[] =
{
DATA(SetColor)
,DATA(GetColor)
,DATA(GetAnsiColor)
};
#undef DATA
#define DATA(name) { #name, ef##name }
static FlagList tblFontOps[] =
{
DATA(SetFont)
,DATA(GetFont)
};
#undef DATA
#define DATA(name) { #name, et##name }
static FlagList tblTcapOps[] =
{
DATA(SetTcap)
,DATA(GetTcap)
};
#undef DATA
#define DATA(name) { #name, ew##name }
static FlagList tblWindowOps[] =
{
DATA(RestoreWin)
,DATA(MinimizeWin)
,DATA(SetWinPosition)
,DATA(SetWinSizePixels)
,DATA(RaiseWin)
,DATA(LowerWin)
,DATA(RefreshWin)
,DATA(SetWinSizeChars)
#if OPT_MAXIMIZE
,DATA(MaximizeWin)
,DATA(FullscreenWin)
#endif
,DATA(GetWinState)
,DATA(GetWinPosition)
,DATA(GetWinSizePixels)
,DATA(GetWinSizeChars)
#if OPT_MAXIMIZE
,DATA(GetScreenSizeChars)
#endif
,DATA(GetIconTitle)
,DATA(GetWinTitle)
,DATA(PushTitle)
,DATA(PopTitle)
,DATA(SetWinLines)
,DATA(SetXprop)
,DATA(GetSelection)
,DATA(SetSelection)
};
#undef DATA
#if OPT_RENDERFONT
#define DATA(name) { #name, er##name }
static FlagList tblRenderFont[] =
{
DATA(Default)
};
#undef DATA
#endif
#if OPT_WIDE_CHARS
#define DATA(name) { #name, u##name }
static FlagList tblUtf8Mode[] =
{
DATA(Always)
,DATA(Default)
};
#undef DATA
#endif
#ifndef NO_ACTIVE_ICON
#define DATA(name) { #name, ei##name }
static FlagList tblAIconOps[] =
{
DATA(Default)
};
#undef DATA
#endif
#define DATA(name) { #name, eb##name }
static FlagList tbl8BitMeta[] =
{
DATA(Never)
,DATA(Locale)
};
#undef DATA
XtermWidget request = (XtermWidget) wrequest;
XtermWidget wnew = (XtermWidget) new_arg;
Widget my_parent = SHELL_OF(wnew);
int i;
const char *s;
#if OPT_ISO_COLORS
Bool color_ok;
#endif
#if OPT_COLOR_RES2
static XtResource fake_resources[] =
{
#if OPT_256_COLORS
# include <256colres.h>
#elif OPT_88_COLORS
# include <88colres.h>
#endif
};
#endif /* OPT_COLOR_RES2 */
TRACE(("VTInitialize wnew %p, %d / %d resources\n",
(void *) wnew, XtNumber(xterm_resources), MAXRESOURCES));
assert(XtNumber(xterm_resources) < MAXRESOURCES);
/* Zero out the entire "screen" component of "wnew" widget, then do
* field-by-field assignment of "screen" fields that are named in the
* resource list.
*/
memset(TScreenOf(wnew), 0, sizeof(wnew->screen));
/* DESCO Sys#67660
* Zero out the entire "keyboard" component of "wnew" widget.
*/
memset(&wnew->keyboard, 0, sizeof(wnew->keyboard));
/*
* The workspace has no resources - clear it.
*/
memset(&wnew->work, 0, sizeof(wnew->work));
/* dummy values so that we don't try to Realize the parent shell with height
* or width of 0, which is illegal in X. The real size is computed in the
* xtermWidget's Realize proc, but the shell's Realize proc is called first,
* and must see a valid size.
*/
wnew->core.height = wnew->core.width = 1;
/*
* The definition of -rv now is that it changes the definition of
* XtDefaultForeground and XtDefaultBackground. So, we no longer
* need to do anything special.
*/
TScreenOf(wnew)->display = wnew->core.screen->display;
/*
* We use the default foreground/background colors to compare/check if a
* color-resource has been set.
*/
#define MyBlackPixel(dpy) BlackPixel(dpy,DefaultScreen(dpy))
#define MyWhitePixel(dpy) WhitePixel(dpy,DefaultScreen(dpy))
if (request->misc.re_verse) {
wnew->dft_foreground = MyWhitePixel(TScreenOf(wnew)->display);
wnew->dft_background = MyBlackPixel(TScreenOf(wnew)->display);
} else {
wnew->dft_foreground = MyBlackPixel(TScreenOf(wnew)->display);
wnew->dft_background = MyWhitePixel(TScreenOf(wnew)->display);
}
init_Tres(TEXT_FG);
init_Tres(TEXT_BG);
repairColors(wnew);
wnew->old_foreground = T_COLOR(TScreenOf(wnew), TEXT_FG);
wnew->old_background = T_COLOR(TScreenOf(wnew), TEXT_BG);
TRACE(("Color resource initialization:\n"));
TRACE((" Default foreground 0x%06lx\n", wnew->dft_foreground));
TRACE((" Default background 0x%06lx\n", wnew->dft_background));
TRACE((" Screen foreground 0x%06lx\n", T_COLOR(TScreenOf(wnew), TEXT_FG)));
TRACE((" Screen background 0x%06lx\n", T_COLOR(TScreenOf(wnew), TEXT_BG)));
TRACE((" Actual foreground 0x%06lx\n", wnew->old_foreground));
TRACE((" Actual background 0x%06lx\n", wnew->old_background));
TScreenOf(wnew)->mouse_button = 0;
TScreenOf(wnew)->mouse_row = -1;
TScreenOf(wnew)->mouse_col = -1;
#if OPT_BOX_CHARS
init_Bres(screen.force_box_chars);
init_Bres(screen.force_packed);
init_Bres(screen.force_all_chars);
init_Bres(screen.assume_all_chars);
#endif
init_Bres(screen.free_bold_box);
init_Bres(screen.allowBoldFonts);
init_Bres(screen.c132);
init_Bres(screen.curses);
init_Bres(screen.hp_ll_bc);
#if OPT_XMC_GLITCH
init_Ires(screen.xmc_glitch);
init_Ires(screen.xmc_attributes);
init_Bres(screen.xmc_inline);
init_Bres(screen.move_sgr_ok);
#endif
#if OPT_BLINK_CURS
init_Bres(screen.cursor_blink);
init_Ires(screen.blink_on);
init_Ires(screen.blink_off);
TScreenOf(wnew)->cursor_blink_res = TScreenOf(wnew)->cursor_blink;
#endif
/* resources allow for underline or block, not (yet) bar */
TScreenOf(wnew)->cursor_shape = request->screen.cursor_underline
? CURSOR_UNDERLINE
: CURSOR_BLOCK;
#if OPT_BLINK_TEXT
init_Ires(screen.blink_as_bold);
#endif
init_Ires(screen.border);
init_Bres(screen.jumpscroll);
init_Bres(screen.fastscroll);
init_Bres(screen.old_fkeys);
init_Bres(screen.delete_is_del);
wnew->keyboard.type = TScreenOf(wnew)->old_fkeys
? keyboardIsLegacy
: keyboardIsDefault;
#ifdef ALLOWLOGGING
init_Bres(misc.logInhibit);
init_Bres(misc.log_on);
init_Sres(screen.logfile);
#endif
init_Bres(screen.bellIsUrgent);
init_Bres(screen.bellOnReset);
init_Bres(screen.marginbell);
init_Bres(screen.multiscroll);
init_Ires(screen.nmarginbell);
init_Ires(screen.savelines);
init_Ires(screen.scrollBarBorder);
init_Ires(screen.scrolllines);
init_Bres(screen.alternateScroll);
init_Bres(screen.scrollttyoutput);
init_Bres(screen.scrollkey);
init_Dres(screen.scale_height);
if (TScreenOf(wnew)->scale_height < 0.9)
TScreenOf(wnew)->scale_height = (float) 0.9;
if (TScreenOf(wnew)->scale_height > 1.5)
TScreenOf(wnew)->scale_height = (float) 1.5;
init_Bres(misc.autoWrap);
init_Bres(misc.login_shell);
init_Bres(misc.reverseWrap);
init_Bres(misc.scrollbar);
init_Sres(misc.geo_metry);
init_Sres(misc.T_geometry);
init_Sres(screen.term_id);
for (s = TScreenOf(request)->term_id; *s; s++) {
if (!isalpha(CharOf(*s)))
break;
}
TScreenOf(wnew)->terminal_id = atoi(s);
if (TScreenOf(wnew)->terminal_id < MIN_DECID)
TScreenOf(wnew)->terminal_id = MIN_DECID;
if (TScreenOf(wnew)->terminal_id > MAX_DECID)
TScreenOf(wnew)->terminal_id = MAX_DECID;
TRACE(("term_id '%s' -> terminal_id %d\n",
TScreenOf(wnew)->term_id,
TScreenOf(wnew)->terminal_id));
TScreenOf(wnew)->vtXX_level = (TScreenOf(wnew)->terminal_id / 100);
init_Ires(screen.title_modes);
init_Bres(screen.visualbell);
init_Bres(screen.flash_line);
init_Ires(screen.visualBellDelay);
init_Bres(screen.poponbell);
init_Ires(misc.limit_resize);
#if OPT_NUM_LOCK
init_Bres(misc.real_NumLock);
init_Bres(misc.alwaysUseMods);
#endif
#if OPT_INPUT_METHOD
init_Bres(misc.open_im);
init_Ires(misc.retry_im);
init_Sres(misc.f_x);
init_Sres(misc.input_method);
init_Sres(misc.preedit_type);
#endif
#if OPT_SHIFT_FONTS
init_Bres(misc.shift_fonts);
#endif
#if OPT_SUNPC_KBD
init_Ires(misc.ctrl_fkeys);
#endif
#if OPT_TEK4014
TEK4014_SHOWN(wnew) = False; /* not a resource... */
init_Bres(misc.tekInhibit);
init_Bres(misc.tekSmall);
init_Bres(misc.TekEmu);
#endif
#if OPT_TCAP_QUERY
TScreenOf(wnew)->tc_query_code = -1;
#endif
wnew->misc.re_verse0 = request->misc.re_verse;
init_Bres(misc.re_verse);
init_Ires(screen.multiClickTime);
init_Ires(screen.bellSuppressTime);
init_Sres(screen.charClass);
init_Bres(screen.always_highlight);
init_Bres(screen.brokenSelections);
init_Bres(screen.cutNewline);
init_Bres(screen.cutToBeginningOfLine);
init_Bres(screen.highlight_selection);
init_Bres(screen.show_wrap_marks);
init_Bres(screen.i18nSelections);
init_Bres(screen.keepSelection);
init_Bres(screen.selectToClipboard);
init_Bres(screen.trim_selection);
TScreenOf(wnew)->pointer_cursor = TScreenOf(request)->pointer_cursor;
init_Ires(screen.pointer_mode);
init_Sres(screen.answer_back);
wnew->SPS.printer_checked = False;
init_Sres(SPS.printer_command);
init_Bres(SPS.printer_autoclose);
init_Bres(SPS.printer_extent);
init_Bres(SPS.printer_formfeed);
init_Bres(SPS.printer_newline);
init_Ires(SPS.printer_controlmode);
#if OPT_PRINT_COLORS
init_Ires(SPS.print_attributes);
#endif
init_Sres(screen.keyboard_dialect);
init_Bres(screen.input_eight_bits);
init_Bres(screen.output_eight_bits);
init_Bres(screen.control_eight_bits);
init_Bres(screen.backarrow_key);
init_Bres(screen.alt_is_not_meta);
init_Bres(screen.alt_sends_esc);
init_Bres(screen.meta_sends_esc);
init_Bres(screen.allowPasteControls);
init_Bres(screen.allowSendEvent0);
init_Bres(screen.allowColorOp0);
init_Bres(screen.allowFontOp0);
init_Bres(screen.allowTcapOp0);
init_Bres(screen.allowTitleOp0);
init_Bres(screen.allowWindowOp0);
#if OPT_SCROLL_LOCK
init_Bres(screen.allowScrollLock0);
#endif
init_Sres(screen.disallowedColorOps);
set_flags_from_list(TScreenOf(wnew)->disallow_color_ops,
TScreenOf(wnew)->disallowedColorOps,
tblColorOps,
ecLAST);
init_Sres(screen.disallowedFontOps);
set_flags_from_list(TScreenOf(wnew)->disallow_font_ops,
TScreenOf(wnew)->disallowedFontOps,
tblFontOps,
efLAST);
init_Sres(screen.disallowedTcapOps);
set_flags_from_list(TScreenOf(wnew)->disallow_tcap_ops,
TScreenOf(wnew)->disallowedTcapOps,
tblTcapOps,
etLAST);
init_Sres(screen.disallowedWinOps);
set_flags_from_list(TScreenOf(wnew)->disallow_win_ops,
TScreenOf(wnew)->disallowedWinOps,
tblWindowOps,
ewLAST);
init_Sres(screen.default_string);
init_Sres(screen.eightbit_select_types);
#if OPT_WIDE_CHARS
init_Sres(screen.utf8_select_types);
#endif
/* make a copy so that editres cannot change the resource after startup */
TScreenOf(wnew)->allowSendEvents = TScreenOf(wnew)->allowSendEvent0;
TScreenOf(wnew)->allowColorOps = TScreenOf(wnew)->allowColorOp0;
TScreenOf(wnew)->allowFontOps = TScreenOf(wnew)->allowFontOp0;
TScreenOf(wnew)->allowTcapOps = TScreenOf(wnew)->allowTcapOp0;
TScreenOf(wnew)->allowTitleOps = TScreenOf(wnew)->allowTitleOp0;
TScreenOf(wnew)->allowWindowOps = TScreenOf(wnew)->allowWindowOp0;
#if OPT_SCROLL_LOCK
TScreenOf(wnew)->allowScrollLock = TScreenOf(wnew)->allowScrollLock0;
#endif
init_Bres(screen.quiet_grab);
#ifndef NO_ACTIVE_ICON
init_Sres(screen.icon_fontname);
TScreenOf(wnew)->fnt_icon.fs = XLoadQueryFont(TScreenOf(wnew)->display,
TScreenOf(wnew)->icon_fontname);
TRACE(("iconFont '%s' %sloaded successfully\n",
TScreenOf(wnew)->icon_fontname,
TScreenOf(wnew)->fnt_icon.fs ? "" : "NOT "));
init_Sres(misc.active_icon_s);
wnew->work.active_icon =
(Boolean) extendedBoolean(wnew->misc.active_icon_s,
tblAIconOps, eiLAST);
init_Ires(misc.icon_border_width);
wnew->misc.icon_border_pixel = request->misc.icon_border_pixel;
#endif /* NO_ACTIVE_ICON */
init_Bres(misc.signalInhibit);
init_Bres(misc.titeInhibit);
init_Bres(misc.tiXtraScroll);
init_Bres(misc.cdXtraScroll);
init_Bres(misc.dynamicColors);
for (i = fontMenu_font1; i <= fontMenu_lastBuiltin; i++) {
init_Sres2(screen.MenuFontName, i);
}
init_Ires(misc.fontWarnings);
#define DefaultFontNames TScreenOf(wnew)->menu_font_names[fontMenu_default]
init_Sres(misc.default_font.f_n);
init_Sres(misc.default_font.f_b);
DefaultFontNames[fNorm] = x_strdup(wnew->misc.default_font.f_n);
DefaultFontNames[fBold] = x_strdup(wnew->misc.default_font.f_b);
#if OPT_WIDE_CHARS
init_Sres(misc.default_font.f_w);
init_Sres(misc.default_font.f_wb);
DefaultFontNames[fWide] = x_strdup(wnew->misc.default_font.f_w);
DefaultFontNames[fWBold] = x_strdup(wnew->misc.default_font.f_wb);
#endif
TScreenOf(wnew)->MenuFontName(fontMenu_fontescape) = NULL;
TScreenOf(wnew)->MenuFontName(fontMenu_fontsel) = NULL;
TScreenOf(wnew)->menu_font_number = fontMenu_default;
init_Sres(screen.initial_font);
if (TScreenOf(wnew)->initial_font != 0) {
int result = xtermGetFont(TScreenOf(wnew)->initial_font);
if (result >= 0)
TScreenOf(wnew)->menu_font_number = result;
}
#if OPT_BROKEN_OSC
init_Bres(screen.brokenLinuxOSC);
#endif
#if OPT_BROKEN_ST
init_Bres(screen.brokenStringTerm);
#endif
#if OPT_C1_PRINT
init_Bres(screen.c1_printable);
#endif
#if OPT_CLIP_BOLD
init_Bres(screen.use_clipping);
#endif
#if OPT_DEC_CHRSET
init_Bres(screen.font_doublesize);
init_Ires(screen.cache_doublesize);
if (TScreenOf(wnew)->cache_doublesize > NUM_CHRSET)
TScreenOf(wnew)->cache_doublesize = NUM_CHRSET;
if (TScreenOf(wnew)->cache_doublesize == 0)
TScreenOf(wnew)->font_doublesize = False;
TRACE(("Doublesize%s enabled, up to %d fonts\n",
TScreenOf(wnew)->font_doublesize ? "" : " not",
TScreenOf(wnew)->cache_doublesize));
#endif
#if OPT_ISO_COLORS
init_Ires(screen.veryBoldColors);
init_Bres(screen.boldColors);
init_Bres(screen.colorAttrMode);
init_Bres(screen.colorBDMode);
init_Bres(screen.colorBLMode);
init_Bres(screen.colorMode);
init_Bres(screen.colorULMode);
init_Bres(screen.italicULMode);
init_Bres(screen.colorRVMode);
#if OPT_COLOR_RES2
TRACE(("...will fake resources for color%d to color%d\n",
MIN_ANSI_COLORS,
NUM_ANSI_COLORS - 1));
#endif
for (i = 0, color_ok = False; i < MAXCOLORS; i++) {
#if OPT_COLOR_RES2
/*
* Xt has a hardcoded limit on the maximum number of resources that can
* be used in a widget. If we configure both luit (which implies
* wide-characters) and 256-colors, it goes over that limit. Most
* people would not need a resource-file with 256-colors; the default
* values in our table are sufficient. In that case, fake the resource
* setting by copying the default value from the table. The #define's
* can be overridden to make these true resources.
*/
if (i >= MIN_ANSI_COLORS && i < NUM_ANSI_COLORS) {
TScreenOf(wnew)->Acolors[i].resource =
x_strtrim(fake_resources[i - MIN_ANSI_COLORS].default_addr);
if (TScreenOf(wnew)->Acolors[i].resource == 0)
TScreenOf(wnew)->Acolors[i].resource = XtDefaultForeground;
} else
#endif /* OPT_COLOR_RES2 */
{
TScreenOf(wnew)->Acolors[i] = TScreenOf(request)->Acolors[i];
TScreenOf(wnew)->Acolors[i].resource =
x_strtrim(TScreenOf(wnew)->Acolors[i].resource);
}
#if OPT_COLOR_RES
TRACE(("Acolors[%d] = %s\n", i, TScreenOf(wnew)->Acolors[i].resource));
TScreenOf(wnew)->Acolors[i].mode = False;
if (DftFg(Acolors[i])) {
TScreenOf(wnew)->Acolors[i].value = T_COLOR(TScreenOf(wnew), TEXT_FG);
TScreenOf(wnew)->Acolors[i].mode = True;
} else if (DftBg(Acolors[i])) {
TScreenOf(wnew)->Acolors[i].value = T_COLOR(TScreenOf(wnew), TEXT_BG);
TScreenOf(wnew)->Acolors[i].mode = True;
} else {
color_ok = True;
}
#else
TRACE(("Acolors[%d] = %#lx\n", i, TScreenOf(request)->Acolors[i]));
if (TScreenOf(wnew)->Acolors[i] != wnew->dft_foreground &&
TScreenOf(wnew)->Acolors[i] != T_COLOR(TScreenOf(wnew), TEXT_FG) &&
TScreenOf(wnew)->Acolors[i] != T_COLOR(TScreenOf(wnew), TEXT_BG))
color_ok = True;
#endif
}
/*
* Check if we're trying to use color in a monochrome screen. Disable
* color in that case, since that would make ANSI colors unusable. A 4-bit
* or 8-bit display is usable, so we do not have to check for anything more
* specific.
*/
if (color_ok) {
if (getVisualDepth(wnew) <= 1) {
TRACE(("disabling color since screen is monochrome\n"));
color_ok = False;
}
}
/* If none of the colors are anything other than the foreground or
* background, we'll assume this isn't color, no matter what the colorMode
* resource says. (There doesn't seem to be any good way to determine if
* the resource lookup failed versus the user having misconfigured this).
*/
if (!color_ok) {
TScreenOf(wnew)->colorMode = False;
TRACE(("All colors are foreground or background: disable colorMode\n"));
}
wnew->sgr_foreground = -1;
wnew->sgr_background = -1;
wnew->sgr_extended = False;
#endif /* OPT_ISO_COLORS */
/*
* Decode the resources that control the behavior on multiple mouse clicks.
* A single click is always bound to normal character selection, but the
* other flavors can be changed.
*/
for (i = 0; i < NSELECTUNITS; ++i) {
int ck = (i + 1);
TScreenOf(wnew)->maxClicks = ck;
if (i == Select_CHAR)
TScreenOf(wnew)->selectMap[i] = Select_CHAR;
else if (TScreenOf(request)->onClick[i] != 0)
ParseOnClicks(wnew, request, (unsigned) i);
else if (i <= Select_LINE)
TScreenOf(wnew)->selectMap[i] = (SelectUnit) i;
else
break;
TRACE(("on%dClicks %s=%d\n", ck,
NonNull(TScreenOf(request)->onClick[i]),
TScreenOf(wnew)->selectMap[i]));
if (TScreenOf(wnew)->selectMap[i] == NSELECTUNITS)
break;
}
TRACE(("maxClicks %d\n", TScreenOf(wnew)->maxClicks));
init_Tres(MOUSE_FG);
init_Tres(MOUSE_BG);
init_Tres(TEXT_CURSOR);
#if OPT_HIGHLIGHT_COLOR
init_Tres(HIGHLIGHT_BG);
init_Tres(HIGHLIGHT_FG);
init_Bres(screen.hilite_reverse);
init_Bres(screen.hilite_color);
if (TScreenOf(wnew)->hilite_color == Maybe) {
TScreenOf(wnew)->hilite_color = False;
#if OPT_COLOR_RES
/*
* If the highlight text/background are both set, and if they are
* not equal to either the text/background or background/text, then
* set the highlightColorMode automatically.
*/
if (!DftFg(Tcolors[HIGHLIGHT_BG])
&& !DftBg(Tcolors[HIGHLIGHT_FG])
&& !TxtFg(Tcolors[HIGHLIGHT_BG])
&& !TxtBg(Tcolors[HIGHLIGHT_FG])
&& !TxtBg(Tcolors[HIGHLIGHT_BG])
&& !TxtFg(Tcolors[HIGHLIGHT_FG])) {
TRACE(("...setting hilite_color automatically\n"));
TScreenOf(wnew)->hilite_color = True;
}
#endif
}
#endif
#if OPT_TEK4014
/*
* The Tek4014 window has no separate resources for foreground, background
* and cursor color. Since xterm always creates the vt100 widget first, we
* can set the Tektronix colors here. That lets us use escape sequences to
* set its dynamic colors and get consistent behavior whether or not the
* window is displayed.
*/
TScreenOf(wnew)->Tcolors[TEK_BG] = TScreenOf(wnew)->Tcolors[TEXT_BG];
TScreenOf(wnew)->Tcolors[TEK_FG] = TScreenOf(wnew)->Tcolors[TEXT_FG];
TScreenOf(wnew)->Tcolors[TEK_CURSOR] = TScreenOf(wnew)->Tcolors[TEXT_CURSOR];
#endif
#ifdef SCROLLBAR_RIGHT
init_Bres(misc.useRight);
#endif
#if OPT_RENDERFONT
for (i = 0; i <= fontMenu_lastBuiltin; ++i) {
init_Dres2(misc.face_size, i);
}
init_Sres(misc.face_name);
init_Sres(misc.face_wide_name);
trimSizeFromFace(wnew->misc.face_wide_name, (float *) 0);
trimSizeFromFace(wnew->misc.face_name, &(wnew->misc.face_size[0]));
init_Sres(misc.render_font_s);
wnew->work.render_font =
(Boolean) extendedBoolean(wnew->misc.render_font_s,
tblRenderFont, erLast);
if (wnew->work.render_font == erDefault) {
if (IsEmpty(wnew->misc.face_name)) {
free(wnew->misc.face_name);
wnew->misc.face_name = x_strdup(DEFFACENAME_AUTO);
TRACE(("will allow runtime switch to render_font using \"%s\"\n",
wnew->misc.face_name));
} else {
wnew->work.render_font = erTrue;
TRACE(("initially using TrueType font\n"));
}
}
/* minor tweak to make debug traces consistent: */
if (wnew->work.render_font) {
if (IsEmpty(wnew->misc.face_name)) {
wnew->work.render_font = False;
TRACE(("reset render_font since there is no face_name\n"));
}
}
#endif
#if OPT_WIDE_CHARS
/* setup data for next call */
request->screen.utf8_mode =
extendedBoolean(request->screen.utf8_mode_s, tblUtf8Mode, uLast);
request->screen.utf8_fonts =
extendedBoolean(request->screen.utf8_fonts_s, tblUtf8Mode, uLast);
VTInitialize_locale(request);
init_Bres(screen.normalized_c);
init_Bres(screen.utf8_latin1);
init_Bres(screen.utf8_title);
#if OPT_LUIT_PROG
init_Bres(misc.callfilter);
init_Bres(misc.use_encoding);
init_Sres(misc.locale_str);
init_Sres(misc.localefilter);
#endif
init_Ires(screen.utf8_inparse);
init_Ires(screen.utf8_mode);
init_Ires(screen.utf8_fonts);
init_Ires(screen.max_combining);
if (TScreenOf(wnew)->max_combining < 0) {
TScreenOf(wnew)->max_combining = 0;
}
if (TScreenOf(wnew)->max_combining > 5) {
TScreenOf(wnew)->max_combining = 5;
}
init_Bres(screen.vt100_graphics);
init_Bres(screen.wide_chars);
init_Bres(misc.mk_width);
init_Bres(misc.cjk_width);
init_Ires(misc.mk_samplesize);
init_Ires(misc.mk_samplepass);
if (wnew->misc.mk_samplesize > 0xffff)
wnew->misc.mk_samplesize = 0xffff;
if (wnew->misc.mk_samplesize < 0)
wnew->misc.mk_samplesize = 0;
if (wnew->misc.mk_samplepass > wnew->misc.mk_samplesize)
wnew->misc.mk_samplepass = wnew->misc.mk_samplesize;
if (wnew->misc.mk_samplepass < 0)
wnew->misc.mk_samplepass = 0;
if (TScreenOf(request)->utf8_mode) {
TRACE(("setting wide_chars on\n"));
TScreenOf(wnew)->wide_chars = True;
} else {
TRACE(("setting utf8_mode to 0\n"));
TScreenOf(wnew)->utf8_mode = uFalse;
}
TRACE(("initialized UTF-8 mode to %d\n", TScreenOf(wnew)->utf8_mode));
#if OPT_MINI_LUIT
if (TScreenOf(request)->latin9_mode) {
TScreenOf(wnew)->latin9_mode = True;
}
if (TScreenOf(request)->unicode_font) {
TScreenOf(wnew)->unicode_font = True;
}
TRACE(("initialized Latin9 mode to %d\n", TScreenOf(wnew)->latin9_mode));
TRACE(("initialized unicode_font to %d\n", TScreenOf(wnew)->unicode_font));
#endif
decode_wcwidth(wnew);
xtermSaveVTFonts(wnew);
#endif /* OPT_WIDE_CHARS */
init_Sres(screen.eight_bit_meta_s);
wnew->screen.eight_bit_meta =
extendedBoolean(request->screen.eight_bit_meta_s, tbl8BitMeta, uLast);
if (wnew->screen.eight_bit_meta == ebLocale) {
#if OPT_WIDE_CHARS
if (xtermEnvUTF8()) {
wnew->screen.eight_bit_meta = ebFalse;
TRACE(("...eightBitMeta is false due to locale\n"));
} else
#endif /* OPT_WIDE_CHARS */
{
wnew->screen.eight_bit_meta = ebTrue;
TRACE(("...eightBitMeta is true due to locale\n"));
}
}
init_Bres(screen.always_bold_mode);
init_Bres(screen.bold_mode);
init_Bres(screen.underline);
wnew->cur_foreground = 0;
wnew->cur_background = 0;
wnew->keyboard.flags = MODE_SRM;
if (TScreenOf(wnew)->backarrow_key)
wnew->keyboard.flags |= MODE_DECBKM;
TRACE(("initialized DECBKM %s\n",
BtoS(wnew->keyboard.flags & MODE_DECBKM)));
#if OPT_SIXEL_GRAPHICS
init_Bres(screen.sixel_scrolling);
if (TScreenOf(wnew)->sixel_scrolling) /* FIXME: should this be off unconditionally here? */
wnew->keyboard.flags |= MODE_DECSDM;
TRACE(("initialized DECSDM %s (resource default is %d)\n",
BtoS(wnew->keyboard.flags & MODE_DECSDM),
TScreenOf(wnew)->sixel_scrolling));
init_Bres(screen.privatecolorregisters); /* FIXME: should this be off unconditionally here? */
TRACE(("initialized PRIVATE_COLOR_REGISTERS to resource default %s\n",
BtoS(TScreenOf(wnew)->privatecolorregisters)));
#endif
/* look for focus related events on the shell, because we need
* to care about the shell's border being part of our focus.
*/
TRACE(("adding event handlers for my_parent %p\n", (void *) my_parent));
XtAddEventHandler(my_parent, EnterWindowMask, False,
HandleEnterWindow, (Opaque) NULL);
XtAddEventHandler(my_parent, LeaveWindowMask, False,
HandleLeaveWindow, (Opaque) NULL);
XtAddEventHandler(my_parent, FocusChangeMask, False,
HandleFocusChange, (Opaque) NULL);
XtAddEventHandler((Widget) wnew, 0L, True,
VTNonMaskableEvent, (Opaque) NULL);
XtAddEventHandler((Widget) wnew, PropertyChangeMask, False,
HandleBellPropertyChange, (Opaque) NULL);
#if HANDLE_STRUCT_NOTIFY
#if OPT_TOOLBAR
wnew->VT100_TB_INFO(menu_bar) = request->VT100_TB_INFO(menu_bar);
init_Ires(VT100_TB_INFO(menu_height));
#else
/* Flag icon name with "***" on window output when iconified.
* Put in a handler that will tell us when we get Map/Unmap events.
*/
if (resource.zIconBeep)
#endif
XtAddEventHandler(my_parent, StructureNotifyMask, False,
HandleStructNotify, (Opaque) 0);
#endif /* HANDLE_STRUCT_NOTIFY */
TScreenOf(wnew)->bellInProgress = False;
set_character_class(TScreenOf(wnew)->charClass);
/* create it, but don't realize it */
ScrollBarOn(wnew, True);
/* make sure that the resize gravity acceptable */
if (!GravityIsNorthWest(wnew) &&
!GravityIsSouthWest(wnew)) {
char value[80];
String temp[2];
Cardinal nparams = 1;
sprintf(value, "%d", wnew->misc.resizeGravity);
temp[0] = value;
temp[1] = 0;
XtAppWarningMsg(app_con, "rangeError", "resizeGravity", "XTermError",
"unsupported resizeGravity resource value (%s)",
temp, &nparams);
wnew->misc.resizeGravity = SouthWestGravity;
}
#ifndef NO_ACTIVE_ICON
TScreenOf(wnew)->whichVwin = &TScreenOf(wnew)->fullVwin;
#endif /* NO_ACTIVE_ICON */
if (TScreenOf(wnew)->savelines < 0)
TScreenOf(wnew)->savelines = 0;
init_Bres(screen.awaitInput);
wnew->flags = 0;
if (!TScreenOf(wnew)->jumpscroll)
wnew->flags |= SMOOTHSCROLL;
if (wnew->misc.reverseWrap)
wnew->flags |= REVERSEWRAP;
if (wnew->misc.autoWrap)
wnew->flags |= WRAPAROUND;
if (wnew->misc.re_verse != wnew->misc.re_verse0)
wnew->flags |= REVERSE_VIDEO;
if (TScreenOf(wnew)->c132)
wnew->flags |= IN132COLUMNS;
wnew->initflags = wnew->flags;
#if OPT_MOD_FKEYS
init_Ires(keyboard.modify_1st.allow_keys);
init_Ires(keyboard.modify_1st.cursor_keys);
init_Ires(keyboard.modify_1st.function_keys);
init_Ires(keyboard.modify_1st.keypad_keys);
init_Ires(keyboard.modify_1st.other_keys);
init_Ires(keyboard.modify_1st.string_keys);
init_Ires(keyboard.format_keys);
wnew->keyboard.modify_now = wnew->keyboard.modify_1st;
#endif
init_Ires(misc.appcursorDefault);
if (wnew->misc.appcursorDefault)
wnew->keyboard.flags |= MODE_DECCKM;
init_Ires(misc.appkeypadDefault);
if (wnew->misc.appkeypadDefault)
wnew->keyboard.flags |= MODE_DECKPAM;
initLineData(wnew);
return;
}
void
releaseCursorGCs(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
VTwin *win = WhichVWin(screen);
int n;
for_each_curs_gc(n) {
freeCgs(xw, win, (CgsEnum) n);
}
}
void
releaseWindowGCs(XtermWidget xw, VTwin * win)
{
int n;
for_each_text_gc(n) {
freeCgs(xw, win, (CgsEnum) n);
}
}
#define TRACE_FREE_LEAK(name) \
if (name) { \
TRACE(("freed " #name ": %p\n", (const void *) name)); \
free((void *) name); \
name = 0; \
}
#define FREE_LEAK(name) \
if (name) { \
free((void *) name); \
name = 0; \
}
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
static void
cleanupInputMethod(XtermWidget xw)
{
TInput *input = lookupTInput(xw, (Widget) xw);
if (input && input->xim) {
XCloseIM(input->xim);
input->xim = 0;
TRACE(("freed screen->xim\n"));
}
}
#endif
static void
VTDestroy(Widget w GCC_UNUSED)
{
#ifdef NO_LEAKS
XtermWidget xw = (XtermWidget) w;
TScreen *screen = TScreenOf(xw);
Cardinal n;
StopBlinking(screen);
if (screen->scrollWidget) {
XtUninstallTranslations(screen->scrollWidget);
XtDestroyWidget(screen->scrollWidget);
}
#if OPT_FIFO_LINES
while (screen->saved_fifo > 0) {
deleteScrollback(screen);
}
#endif
while (screen->save_title != 0) {
SaveTitle *last = screen->save_title;
screen->save_title = last->next;
free(last->iconName);
free(last->windowName);
free(last);
}
#if OPT_ISO_COLORS
TRACE_FREE_LEAK(screen->cmap_data);
for (n = 0; n < MAXCOLORS; n++) {
TRACE_FREE_LEAK(screen->Acolors[n].resource);
}
#endif
#if OPT_COLOR_RES
for (n = 0; n < NCOLORS; n++) {
switch (n) {
#if OPT_TEK4014
case TEK_BG:
case TEK_FG:
case TEK_CURSOR:
break;
#endif
default:
TRACE_FREE_LEAK(screen->Tcolors[n].resource);
break;
}
}
#endif
TRACE_FREE_LEAK(screen->save_ptr);
TRACE_FREE_LEAK(screen->saveBuf_data);
TRACE_FREE_LEAK(screen->saveBuf_index);
for (n = 0; n < 2; ++n) {
TRACE_FREE_LEAK(screen->editBuf_data[n]);
TRACE_FREE_LEAK(screen->editBuf_index[n]);
}
TRACE_FREE_LEAK(screen->keyboard_dialect);
TRACE_FREE_LEAK(screen->term_id);
#if OPT_WIDE_CHARS
#if OPT_LUIT_PROG
TRACE_FREE_LEAK(xw->misc.locale_str);
TRACE_FREE_LEAK(xw->misc.localefilter);
#endif
#endif
TRACE_FREE_LEAK(xw->misc.T_geometry);
TRACE_FREE_LEAK(xw->misc.geo_metry);
TRACE_FREE_LEAK(xw->screen.term_id);
#if OPT_INPUT_METHOD
cleanupInputMethod(xw);
TRACE_FREE_LEAK(xw->misc.f_x);
TRACE_FREE_LEAK(xw->misc.input_method);
TRACE_FREE_LEAK(xw->misc.preedit_type);
#endif
releaseCursorGCs(xw);
releaseWindowGCs(xw, &(screen->fullVwin));
#ifndef NO_ACTIVE_ICON
releaseWindowGCs(xw, &(screen->iconVwin));
#endif
XtUninstallTranslations((Widget) xw);
#if OPT_TOOLBAR
XtUninstallTranslations((Widget) XtParent(xw));
#endif
XtUninstallTranslations((Widget) SHELL_OF(xw));
if (screen->hidden_cursor)
XFreeCursor(screen->display, screen->hidden_cursor);
xtermCloseFonts(xw, screen->fnts);
noleaks_cachedCgs(xw);
TRACE_FREE_LEAK(screen->selection_targets_8bit);
#if OPT_SELECT_REGEX
for (n = 0; n < NSELECTUNITS; ++n) {
if (screen->selectMap[n] == Select_REGEX) {
TRACE_FREE_LEAK(screen->selectExpr[n]);
}
}
#endif
#if OPT_RENDERFONT
for (n = 0; n < NMENUFONTS; ++n) {
xtermCloseXft(screen, &(screen->renderFontNorm[n]));
xtermCloseXft(screen, &(screen->renderFontBold[n]));
xtermCloseXft(screen, &(screen->renderFontItal[n]));
#if OPT_RENDERWIDE
xtermCloseXft(screen, &(screen->renderWideNorm[n]));
xtermCloseXft(screen, &(screen->renderWideBold[n]));
xtermCloseXft(screen, &(screen->renderWideItal[n]));
#endif
}
#endif
/* free things allocated via init_Sres or Init_Sres2 */
#ifndef NO_ACTIVE_ICON
TRACE_FREE_LEAK(screen->icon_fontname);
#endif
#ifdef ALLOWLOGGING
TRACE_FREE_LEAK(screen->logfile);
#endif
TRACE_FREE_LEAK(screen->eight_bit_meta_s);
TRACE_FREE_LEAK(screen->term_id);
TRACE_FREE_LEAK(screen->charClass);
TRACE_FREE_LEAK(screen->answer_back);
TRACE_FREE_LEAK(screen->printer_state.printer_command);
TRACE_FREE_LEAK(screen->keyboard_dialect);
TRACE_FREE_LEAK(screen->disallowedColorOps);
TRACE_FREE_LEAK(screen->disallowedFontOps);
TRACE_FREE_LEAK(screen->disallowedTcapOps);
TRACE_FREE_LEAK(screen->disallowedWinOps);
TRACE_FREE_LEAK(screen->default_string);
TRACE_FREE_LEAK(screen->eightbit_select_types);
#if OPT_WIDE_CHARS
TRACE_FREE_LEAK(screen->utf8_select_types);
#endif
#if 0
for (n = fontMenu_font1; n <= fontMenu_lastBuiltin; n++) {
TRACE_FREE_LEAK(screen->MenuFontName(n));
}
#endif
TRACE_FREE_LEAK(screen->initial_font);
#if OPT_LUIT_PROG
TRACE_FREE_LEAK(xw->misc.locale_str);
TRACE_FREE_LEAK(xw->misc.localefilter);
#endif
#if OPT_RENDERFONT
TRACE_FREE_LEAK(xw->misc.face_name);
TRACE_FREE_LEAK(xw->misc.face_wide_name);
TRACE_FREE_LEAK(xw->misc.render_font_s);
#endif
#if OPT_SELECT_REGEX
for (n = 0; n < NSELECTUNITS; ++n) {
FREE_LEAK(screen->selectExpr[n]);
}
#endif
if (screen->selection_atoms)
XtFree((char *) (screen->selection_atoms));
XtFree((char *) (screen->selection_data));
TRACE_FREE_LEAK(xtermClassRec.core_class.tm_table);
TRACE_FREE_LEAK(xw->keyboard.extra_translations);
TRACE_FREE_LEAK(xw->keyboard.shell_translations);
TRACE_FREE_LEAK(xw->keyboard.xterm_translations);
#if OPT_WIDE_CHARS
FreeTypedBuffer(XChar2b);
FreeTypedBuffer(char);
#endif
#if OPT_RENDERFONT
#if OPT_RENDERWIDE
FreeTypedBuffer(XftCharSpec);
#else
FreeTypedBuffer(XftChar8);
#endif
#endif
TRACE_FREE_LEAK(myState.print_area);
TRACE_FREE_LEAK(myState.string_area);
memset(&myState, 0, sizeof(myState));
#endif /* defined(NO_LEAKS) */
}
static void *
getProperty(Display *dpy,
Window w,
Atom req_type,
const char *prop_name)
{
Atom property;
Atom actual_return_type;
int actual_format_return = 0;
unsigned long nitems_return = 0;
unsigned long bytes_after_return = 0;
unsigned char *prop_return = 0;
long long_length = 1024;
size_t limit;
char *result = 0;
TRACE(("getProperty %s(%s)\n", prop_name,
req_type ? XGetAtomName(dpy, req_type) : "?"));
property = XInternAtom(dpy, prop_name, False);
if (!xtermGetWinProp(dpy,
w,
property,
0L,
long_length,
req_type,
&actual_return_type,
&actual_format_return,
&nitems_return,
&bytes_after_return,
&prop_return)) {
TRACE((".. Cannot get %s property.\n", prop_name));
} else if (prop_return != 0) {
if (nitems_return != 0 &&
actual_format_return != 0 &&
actual_return_type == req_type) {
/*
* Null-terminate the result to make string handling easier.
* The format==8 corresponds to strings, and the number of items
* is the number of characters.
*/
if (actual_format_return == 8) {
limit = nitems_return;
} else {
/* manpage is misleading - X really uses 'long', not 32-bits */
limit = sizeof(long) * nitems_return;
}
if ((result = malloc(limit + 1)) != 0) {
memcpy(result, prop_return, limit);
result[limit] = '\0';
}
TRACE(("... result %s\n", result ? ("ok") : "null"));
}
XFree(prop_return);
} else {
TRACE((".. no property returned\n"));
}
return (void *) result;
}
/*
* Active icons are supported by fvwm. This feature is not supported by
* metacity (gnome) or kwin (kde). Both metacity and kwin support (in
* incompatible ways, e.g., one uses the icon theme as a fallback for window
* decorations but the other does not, etc, ...) an icon as part of the window
* decoration (usually on the upper-left of the window).
*
* In either case, xterm's icon will only be shown in the window decorations if
* xterm does not use the active icon feature.
*
* This function (tries to) determine the window manager's name, so that we can
* provide a useful automatic default for active icons. It is based on reading
* wmctrl, which covers most of EWMH and ICCM.
*/
static char *
getWindowManagerName(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
Display *dpy = screen->display;
Window *sup_window = NULL;
char *result = 0;
TRACE(("getWindowManagerName\n"));
#define getWinProp(type, name) \
(Window *)getProperty(dpy, DefaultRootWindow(dpy), type, name)
if ((sup_window = getWinProp(XA_WINDOW, "_NET_SUPPORTING_WM_CHECK")) == 0) {
sup_window = getWinProp(XA_CARDINAL, "_WIN_SUPPORTING_WM_CHECK");
}
/*
* If we found the supporting window, get the property containing the
* window manager's name. EWMH defines _NET_WM_NAME, while ICCM defines
* WM_CLASS. There is no standard for the names stored there;
* conventionally it is mixed case. In practice, the former is more often
* set; the latter is not given (or is a lowercased version of the former).
*/
if (sup_window != 0) {
#define getStringProp(type,name) \
(char *)getProperty(dpy, *sup_window, type, name)
if ((result = getStringProp(XA_UTF8_STRING(dpy), "_NET_WM_NAME")) == 0
&& (result = getStringProp(XA_STRING, "_NET_WM_NAME")) == 0
&& (result = getStringProp(XA_STRING, "WM_CLASS")) == 0) {
TRACE(("... window manager does not tell its name\n"));
}
free(sup_window);
} else {
TRACE(("... Cannot get window manager info properties\n"));
}
if (result == 0)
result = x_strdup("unknown");
TRACE(("... window manager name is %s\n", result));
return result;
}
/*ARGSUSED*/
static void
VTRealize(Widget w,
XtValueMask * valuemask,
XSetWindowAttributes * values)
{
XtermWidget xw = (XtermWidget) w;
TScreen *screen = TScreenOf(xw);
const VTFontNames *myfont;
unsigned width, height;
int xpos, ypos, pr;
Atom pid_atom;
int i;
TRACE(("VTRealize\n"));
#if OPT_TOOLBAR
/*
* Layout for the toolbar confuses the Shell widget. Remind it that we
* would like to be iconified if the corresponding resource was set.
*/
if (XtIsRealized(toplevel)) {
Boolean iconic = 0;
XtVaGetValues(toplevel,
XtNiconic, &iconic,
(XtPointer) 0);
if (iconic) {
XIconifyWindow(XtDisplay(toplevel),
XtWindow(toplevel),
DefaultScreen(XtDisplay(toplevel)));
}
}
#endif
TabReset(xw->tabs);
if (screen->menu_font_number == fontMenu_default) {
myfont = &(xw->misc.default_font);
} else {
myfont = xtermFontName(screen->MenuFontName(screen->menu_font_number));
}
memset(screen->fnts, 0, sizeof(screen->fnts));
if (!xtermLoadFont(xw,
myfont,
False,
screen->menu_font_number)) {
if (XmuCompareISOLatin1(myfont->f_n, DEFFONT) != 0) {
char *use_font = x_strdup(DEFFONT);
xtermWarning("unable to open font \"%s\", trying \"%s\"....\n",
myfont->f_n, use_font);
(void) xtermLoadFont(xw,
xtermFontName(use_font),
False,
screen->menu_font_number);
screen->MenuFontName(screen->menu_font_number) = use_font;
}
}
/* really screwed if we couldn't open default font */
if (!screen->fnts[fNorm].fs) {
xtermWarning("unable to locate a suitable font\n");
Exit(1);
}
#if OPT_WIDE_CHARS
if (screen->utf8_mode) {
TRACE(("check if this is a wide font, if not try again\n"));
if (xtermLoadWideFonts(xw, False)) {
SetVTFont(xw, screen->menu_font_number, True, NULL);
/* we will not be able to switch to ISO-8859-1 */
if (!screen->mergedVTFonts) {
screen->utf8_fonts = uAlways;
update_font_utf8_fonts();
}
}
}
#endif
/* making cursor */
if (!screen->pointer_cursor) {
screen->pointer_cursor =
make_colored_cursor(XC_xterm,
T_COLOR(screen, MOUSE_FG),
T_COLOR(screen, MOUSE_BG));
} else {
recolor_cursor(screen,
screen->pointer_cursor,
T_COLOR(screen, MOUSE_FG),
T_COLOR(screen, MOUSE_BG));
}
/* set defaults */
xpos = 1;
ypos = 1;
width = 80;
height = 24;
TRACE(("parsing geo_metry %s\n", NonNull(xw->misc.geo_metry)));
pr = XParseGeometry(xw->misc.geo_metry, &xpos, &ypos,
&width, &height);
TRACE(("... position %d,%d size %dx%d\n", ypos, xpos, height, width));
set_max_col(screen, (int) (width - 1)); /* units in character cells */
set_max_row(screen, (int) (height - 1)); /* units in character cells */
xtermUpdateFontInfo(xw, False);
width = screen->fullVwin.fullwidth;
height = screen->fullVwin.fullheight;
TRACE(("... border widget %d parent %d shell %d\n",
BorderWidth(xw),
BorderWidth(XtParent(xw)),
BorderWidth(SHELL_OF(xw))));
if ((pr & XValue) && (XNegative & pr)) {
xpos += (DisplayWidth(screen->display, DefaultScreen(screen->display))
- (int) width
- (BorderWidth(XtParent(xw)) * 2));
}
if ((pr & YValue) && (YNegative & pr)) {
ypos += (DisplayHeight(screen->display, DefaultScreen(screen->display))
- (int) height
- (BorderWidth(XtParent(xw)) * 2));
}
/* set up size hints for window manager; min 1 char by 1 char */
getXtermSizeHints(xw);
xtermSizeHints(xw, (xw->misc.scrollbar
? (screen->scrollWidget->core.width
+ BorderWidth(screen->scrollWidget))
: 0));
xw->hints.x = xpos;
xw->hints.y = ypos;
#if OPT_MAXIMIZE
/* assure single-increment resize for fullscreen */
if (term->work.ewmh[0].mode) {
xw->hints.width_inc = 1;
xw->hints.height_inc = 1;
}
#endif
if ((XValue & pr) || (YValue & pr)) {
xw->hints.flags |= USSize | USPosition;
xw->hints.flags |= PWinGravity;
switch (pr & (XNegative | YNegative)) {
case 0:
xw->hints.win_gravity = NorthWestGravity;
break;
case XNegative:
xw->hints.win_gravity = NorthEastGravity;
break;
case YNegative:
xw->hints.win_gravity = SouthWestGravity;
break;
default:
xw->hints.win_gravity = SouthEastGravity;
break;
}
} else {
/* set a default size, but do *not* set position */
xw->hints.flags |= PSize;
}
xw->hints.height = xw->hints.base_height
+ xw->hints.height_inc * MaxRows(screen);
xw->hints.width = xw->hints.base_width
+ xw->hints.width_inc * MaxCols(screen);
if ((WidthValue & pr) || (HeightValue & pr))
xw->hints.flags |= USSize;
else
xw->hints.flags |= PSize;
/*
* Note that the size-hints are for the shell, while the resize-request
* is for the vt100 widget. They are not the same size.
*/
(void) REQ_RESIZE((Widget) xw,
(Dimension) width, (Dimension) height,
&xw->core.width, &xw->core.height);
/* XXX This is bogus. We are parsing geometries too late. This
* is information that the shell widget ought to have before we get
* realized, so that it can do the right thing.
*/
if (xw->hints.flags & USPosition)
XMoveWindow(XtDisplay(xw), VShellWindow(xw),
xw->hints.x, xw->hints.y);
TRACE(("%s@%d -- ", __FILE__, __LINE__));
TRACE_HINTS(&xw->hints);
XSetWMNormalHints(XtDisplay(xw), VShellWindow(xw), &xw->hints);
TRACE(("%s@%d -- ", __FILE__, __LINE__));
TRACE_WM_HINTS(xw);
if ((pid_atom = XInternAtom(XtDisplay(xw), "_NET_WM_PID", False)) != None) {
/* XChangeProperty format 32 really is "long" */
unsigned long pid_l = (unsigned long) getpid();
TRACE(("Setting _NET_WM_PID property to %lu\n", pid_l));
XChangeProperty(XtDisplay(xw), VShellWindow(xw),
pid_atom, XA_CARDINAL, 32, PropModeReplace,
(unsigned char *) &pid_l, 1);
}
XFlush(XtDisplay(xw)); /* get it out to window manager */
/* use ForgetGravity instead of SouthWestGravity because translating
the Expose events for ConfigureNotifys is too hard */
values->bit_gravity = (GravityIsNorthWest(xw)
? NorthWestGravity
: ForgetGravity);
screen->fullVwin.window = XtWindow(xw) =
XCreateWindow(XtDisplay(xw), XtWindow(XtParent(xw)),
xw->core.x, xw->core.y,
xw->core.width, xw->core.height, BorderWidth(xw),
(int) xw->core.depth,
InputOutput, CopyFromParent,
*valuemask | CWBitGravity, values);
#if OPT_DOUBLE_BUFFER
screen->fullVwin.drawable = screen->fullVwin.window;
{
Window win = screen->fullVwin.window;
Drawable d;
int major, minor;
if (!XdbeQueryExtension(XtDisplay(xw), &major, &minor)) {
fprintf(stderr, "XdbeQueryExtension returned zero!\n");
exit(3);
}
d = XdbeAllocateBackBufferName(XtDisplay(xw), win, XdbeCopied);
if (d == None) {
fprintf(stderr, "Couldn't allocate a back buffer!\n");
exit(3);
}
screen->fullVwin.drawable = d;
screen->needSwap = 1;
}
#endif /* OPT_DOUBLE_BUFFER */
screen->event_mask = values->event_mask;
#ifndef NO_ACTIVE_ICON
/*
* Normally, the font-number for icon fonts does not correspond with any of
* the menu-selectable fonts. If we cannot load the font given for the
* iconFont resource, try with font1 aka "Unreadable".
*/
screen->icon_fontnum = -1;
if (screen->fnt_icon.fs == 0) {
screen->fnt_icon.fs = XLoadQueryFont(screen->display,
screen->MenuFontName(fontMenu_font1));
TRACE(("%susing font1 '%s' as iconFont\n",
(screen->fnt_icon.fs
? ""
: "NOT "),
screen->MenuFontName(fontMenu_font1)));
}
#if OPT_RENDERFONT
/*
* If we still have no result from iconFont resource (perhaps because fonts
* are missing) but are using Xft, try to use that instead. We prefer
* bitmap fonts in any case, since scaled fonts are usually less readable,
* particularly at small sizes.
*/
if (UsingRenderFont(xw)
&& screen->fnt_icon.fs == 0) {
screen->icon_fontnum = fontMenu_default;
screen->fnt_icon.fs = screen->fnts[0].fs; /* need for next-if */
TRACE(("using TrueType font as iconFont\n"));
}
#endif
if ((xw->work.active_icon == eiDefault) && screen->fnt_icon.fs) {
char *wm_name = getWindowManagerName(xw);
if (x_strncasecmp(wm_name, "fvwm", 4) &&
x_strncasecmp(wm_name, "window maker", 12))
xw->work.active_icon = eiFalse;
free(wm_name);
}
if (xw->work.active_icon && screen->fnt_icon.fs) {
int iconX = 0, iconY = 0;
Widget shell = SHELL_OF(xw);
VTwin *win = &(screen->iconVwin);
int save_fontnum = screen->menu_font_number;
TRACE(("Initializing active-icon %d\n", screen->icon_fontnum));
screen->menu_font_number = screen->icon_fontnum;
XtVaGetValues(shell,
XtNiconX, &iconX,
XtNiconY, &iconY,
(XtPointer) 0);
xtermComputeFontInfo(xw, &(screen->iconVwin), screen->fnt_icon.fs, 0);
screen->menu_font_number = save_fontnum;
/* since only one client is permitted to select for Button
* events, we have to let the window manager get 'em...
*/
values->event_mask &= ~(ButtonPressMask | ButtonReleaseMask);
values->border_pixel = xw->misc.icon_border_pixel;
screen->iconVwin.window =
XCreateWindow(XtDisplay(xw),
RootWindowOfScreen(XtScreen(shell)),
iconX, iconY,
screen->iconVwin.fullwidth,
screen->iconVwin.fullheight,
xw->misc.icon_border_width,
(int) xw->core.depth,
InputOutput, CopyFromParent,
*valuemask | CWBitGravity | CWBorderPixel,
values);
#if OPT_DOUBLE_BUFFER
screen->iconVwin.drawable = screen->iconVwin.window;
#endif
XtVaSetValues(shell,
XtNiconWindow, screen->iconVwin.window,
(XtPointer) 0);
XtRegisterDrawable(XtDisplay(xw), screen->iconVwin.window, w);
setCgsFont(xw, win, gcNorm, &(screen->fnt_icon));
setCgsFore(xw, win, gcNorm, T_COLOR(screen, TEXT_FG));
setCgsBack(xw, win, gcNorm, T_COLOR(screen, TEXT_BG));
copyCgs(xw, win, gcBold, gcNorm);
setCgsFont(xw, win, gcNormReverse, &(screen->fnt_icon));
setCgsFore(xw, win, gcNormReverse, T_COLOR(screen, TEXT_BG));
setCgsBack(xw, win, gcNormReverse, T_COLOR(screen, TEXT_FG));
copyCgs(xw, win, gcBoldReverse, gcNormReverse);
#if OPT_TOOLBAR
/*
* Toolbar is initialized before we get here. Enable the menu item
* and set it properly.
*/
SetItemSensitivity(vtMenuEntries[vtMenu_activeicon].widget, True);
update_activeicon();
#endif
} else {
TRACE(("Disabled active-icon\n"));
xw->work.active_icon = eiFalse;
}
#endif /* NO_ACTIVE_ICON */
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
VTInitI18N(xw);
#endif
#if OPT_NUM_LOCK
VTInitModifiers(xw);
#if OPT_EXTRA_PASTE
if (xw->keyboard.extra_translations) {
XtOverrideTranslations((Widget) xw,
XtParseTranslationTable(xw->keyboard.extra_translations));
}
#endif
#endif
set_cursor_gcs(xw);
/* Reset variables used by ANSI emulation. */
resetCharsets(screen);
XDefineCursor(screen->display, VShellWindow(xw), screen->pointer_cursor);
set_cur_col(screen, 0);
set_cur_row(screen, 0);
set_max_col(screen, Width(screen) / screen->fullVwin.f_width - 1);
set_max_row(screen, Height(screen) / screen->fullVwin.f_height - 1);
reset_margins(screen);
memset(screen->sc, 0, sizeof(screen->sc));
/* Mark screen buffer as unallocated. We wait until the run loop so
that the child process does not fork and exec with all the dynamic
memory it will never use. If we were to do it here, the
swap space for new process would be huge for huge savelines. */
#if OPT_TEK4014
if (!tekWidget) /* if not called after fork */
#endif
{
screen->visbuf = NULL;
screen->saveBuf_index = NULL;
}
ResetWrap(screen);
screen->scrolls = screen->incopy = 0;
xtermSetCursorBox(screen);
screen->savedlines = 0;
for (i = 0; i < 2; ++i) {
screen->whichBuf = !screen->whichBuf;
CursorSave(xw);
}
#ifndef NO_ACTIVE_ICON
if (!xw->work.active_icon)
#endif
xtermLoadIcon(xw);
/*
* Do this last, since it may change the layout via a resize.
*/
if (xw->misc.scrollbar) {
screen->fullVwin.sb_info.width = 0;
ScrollBarOn(xw, False);
}
return;
}
#if OPT_I18N_SUPPORT && OPT_INPUT_METHOD
/* limit this feature to recent XFree86 since X11R6.x core dumps */
#if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && defined(X_HAVE_UTF8_STRING)
#define USE_XIM_INSTANTIATE_CB
static void
xim_instantiate_cb(Display *display,
XPointer client_data GCC_UNUSED,
XPointer call_data GCC_UNUSED)
{
TRACE(("xim_instantiate_cb client=%p, call=%p\n", client_data, call_data));
if (display == XtDisplay(term)) {
VTInitI18N(term);
}
}
static void
xim_destroy_cb(XIM im GCC_UNUSED,
XPointer client_data GCC_UNUSED,
XPointer call_data GCC_UNUSED)
{
XtermWidget xw = term;
TInput *input = lookupTInput(xw, (Widget) xw);
TRACE(("xim_destroy_cb im=%lx, client=%p, call=%p\n",
(long) im, client_data, call_data));
if (input)
input->xic = NULL;
XRegisterIMInstantiateCallback(XtDisplay(xw), NULL, NULL, NULL,
xim_instantiate_cb, NULL);
}
#endif /* X11R6+ */
static Boolean
xim_create_fs(XtermWidget xw)
{
XFontStruct **fonts;
char **font_name_list;
char **missing_charset_list;
char *def_string;
int missing_charset_count;
unsigned i, j;
if (xw->misc.xim_fs == 0) {
xw->misc.xim_fs = XCreateFontSet(XtDisplay(xw),
xw->misc.f_x,
&missing_charset_list,
&missing_charset_count,
&def_string);
if (xw->misc.xim_fs == NULL) {
xtermWarning("Preparation of font set "
"\"%s\" for XIM failed.\n", xw->misc.f_x);
xw->misc.xim_fs = XCreateFontSet(XtDisplay(xw),
DEFXIMFONT,
&missing_charset_list,
&missing_charset_count,
&def_string);
}
}
if (xw->misc.xim_fs == NULL) {
xtermWarning("Preparation of default font set "
"\"%s\" for XIM failed.\n", DEFXIMFONT);
cleanupInputMethod(xw);
xw->misc.cannot_im = True;
} else {
(void) XExtentsOfFontSet(xw->misc.xim_fs);
j = (unsigned) XFontsOfFontSet(xw->misc.xim_fs, &fonts, &font_name_list);
for (i = 0, xw->misc.xim_fs_ascent = 0; i < j; i++) {
if (xw->misc.xim_fs_ascent < (*fonts)->ascent)
xw->misc.xim_fs_ascent = (*fonts)->ascent;
}
}
return (Boolean) !(xw->misc.cannot_im);
}
static void
xim_create_xic(XtermWidget xw, Widget theInput)
{
Display *myDisplay = XtDisplay(theInput);
Window myWindow = XtWindow(theInput);
unsigned i, j;
char *p = NULL, *s, *t, *ns, *end, buf[32];
XIMStyles *xim_styles;
XIMStyle input_style = 0;
Bool found;
static struct {
const char *name;
unsigned long code;
} known_style[] = {
{
"OverTheSpot", (XIMPreeditPosition | XIMStatusNothing)
},
{
"OffTheSpot", (XIMPreeditArea | XIMStatusArea)
},
{
"Root", (XIMPreeditNothing | XIMStatusNothing)
},
};
TInput *input = lookupTInput(xw, theInput);
if (xw->misc.cannot_im) {
return;
}
if (input == 0) {
for (i = 0; i < NINPUTWIDGETS; ++i) {
if (xw->misc.inputs[i].w == 0) {
input = xw->misc.inputs + i;
input->w = theInput;
break;
}
}
}
if (input == 0) {
xtermWarning("attempted to add too many input widgets\n");
return;
}
TRACE(("xim_real_init\n"));
if (IsEmpty(xw->misc.input_method)) {
if ((p = XSetLocaleModifiers("")) != NULL && *p) {
input->xim = XOpenIM(myDisplay, NULL, NULL, NULL);
}
} else {
s = xw->misc.input_method;
i = 5 + (unsigned) strlen(s);
t = (char *) MyStackAlloc(i, buf);
if (t == NULL) {
SysError(ERROR_VINIT);
} else {
for (ns = s; ns && *s;) {
while (*s && isspace(CharOf(*s)))
s++;
if (!*s)
break;
if ((ns = end = strchr(s, ',')) == 0)
end = s + strlen(s);
while ((end != s) && isspace(CharOf(end[-1])))
end--;
if (end != s) {
strcpy(t, "@im=");
strncat(t, s, (size_t) (end - s));
if ((p = XSetLocaleModifiers(t)) != 0 && *p
&& (input->xim = XOpenIM(myDisplay,
NULL,
NULL,
NULL)) != 0) {
break;
}
}
s = ns + 1;
}
MyStackFree(t, buf);
}
}
if (input->xim == NULL
&& (p = XSetLocaleModifiers("@im=none")) != NULL
&& *p) {
input->xim = XOpenIM(myDisplay, NULL, NULL, NULL);
}
if (!input->xim) {
xtermWarning("Failed to open input method\n");
return;
}
TRACE(("VTInitI18N opened input method:%s\n", NonNull(p)));
if (XGetIMValues(input->xim, XNQueryInputStyle, &xim_styles, (void *) 0)
|| !xim_styles
|| !xim_styles->count_styles) {
xtermWarning("input method doesn't support any style\n");
cleanupInputMethod(xw);
xw->misc.cannot_im = True;
return;
}
found = False;
for (s = xw->misc.preedit_type; s && !found;) {
while (*s && isspace(CharOf(*s)))
s++;
if (!*s)
break;
if ((ns = end = strchr(s, ',')) != 0)
ns++;
else
end = s + strlen(s);
while ((end != s) && isspace(CharOf(end[-1])))
end--;
if (end != s) { /* just in case we have a spurious comma */
TRACE(("looking for style '%.*s'\n", (int) (end - s), s));
for (i = 0; i < XtNumber(known_style); i++) {
if ((int) strlen(known_style[i].name) == (end - s)
&& !strncmp(s, known_style[i].name, (size_t) (end - s))) {
input_style = known_style[i].code;
for (j = 0; j < xim_styles->count_styles; j++) {
if (input_style == xim_styles->supported_styles[j]) {
found = True;
break;
}
}
if (found)
break;
}
}
}
s = ns;
}
XFree(xim_styles);
if (!found) {
xtermWarning("input method doesn't support my preedit type (%s)\n",
xw->misc.preedit_type);
cleanupInputMethod(xw);
xw->misc.cannot_im = True;
return;
}
/*
* Check for styles we do not yet support.
*/
TRACE(("input_style %#lx\n", input_style));
if (input_style == (XIMPreeditArea | XIMStatusArea)) {
xtermWarning("This program doesn't support the 'OffTheSpot' preedit type\n");
cleanupInputMethod(xw);
xw->misc.cannot_im = True;
return;
}
/*
* For XIMPreeditPosition (or OverTheSpot), XIM client has to
* prepare a font.
* The font has to be locale-dependent XFontSet, whereas
* XTerm use Unicode font. This leads a problem that the
* same font cannot be used for XIM preedit.
*/
if (input_style != (XIMPreeditNothing | XIMStatusNothing)) {
XVaNestedList p_list;
XPoint spot =
{0, 0};
if (xim_create_fs(xw)) {
p_list = XVaCreateNestedList(0,
XNSpotLocation, &spot,
XNFontSet, xw->misc.xim_fs,
(void *) 0);
input->xic = XCreateIC(input->xim,
XNInputStyle, input_style,
XNClientWindow, myWindow,
XNFocusWindow, myWindow,
XNPreeditAttributes, p_list,
(void *) 0);
}
} else {
input->xic = XCreateIC(input->xim, XNInputStyle, input_style,
XNClientWindow, myWindow,
XNFocusWindow, myWindow,
(void *) 0);
}
if (!input->xic) {
xtermWarning("Failed to create input context\n");
cleanupInputMethod(xw);
}
#if defined(USE_XIM_INSTANTIATE_CB)
else {
XIMCallback destroy_cb;
destroy_cb.callback = xim_destroy_cb;
destroy_cb.client_data = NULL;
if (XSetIMValues(input->xim,
XNDestroyCallback,
&destroy_cb,
(void *) 0)) {
xtermWarning("Could not set destroy callback to IM\n");
}
}
#endif
return;
}
static void
xim_real_init(XtermWidget xw)
{
xim_create_xic(xw, (Widget) xw);
}
static void
VTInitI18N(XtermWidget xw)
{
if (xw->misc.open_im) {
xim_real_init(xw);
#if defined(USE_XIM_INSTANTIATE_CB)
if (lookupTInput(xw, (Widget) xw) == NULL
&& !xw->misc.cannot_im
&& xw->misc.retry_im-- > 0) {
sleep(3);
XRegisterIMInstantiateCallback(XtDisplay(xw), NULL, NULL, NULL,
xim_instantiate_cb, NULL);
}
#endif
}
}
TInput *
lookupTInput(XtermWidget xw, Widget w)
{
TInput *result = 0;
unsigned n;
for (n = 0; n < NINPUTWIDGETS; ++n) {
if (xw->misc.inputs[n].w == w) {
result = xw->misc.inputs + n;
break;
}
}
return result;
}
#endif /* OPT_I18N_SUPPORT && OPT_INPUT_METHOD */
static void
set_cursor_outline_gc(XtermWidget xw,
Bool filled,
Pixel fg,
Pixel bg,
Pixel cc)
{
TScreen *screen = TScreenOf(xw);
VTwin *win = WhichVWin(screen);
CgsEnum cgsId = gcVTcursOutline;
if (cc == bg)
cc = fg;
if (filled) {
setCgsFore(xw, win, cgsId, bg);
setCgsBack(xw, win, cgsId, cc);
} else {
setCgsFore(xw, win, cgsId, cc);
setCgsBack(xw, win, cgsId, bg);
}
}
static Boolean
VTSetValues(Widget cur,
Widget request GCC_UNUSED,
Widget wnew,
ArgList args GCC_UNUSED,
Cardinal *num_args GCC_UNUSED)
{
XtermWidget curvt = (XtermWidget) cur;
XtermWidget newvt = (XtermWidget) wnew;
Boolean refresh_needed = False;
Boolean fonts_redone = False;
if ((T_COLOR(TScreenOf(curvt), TEXT_BG) !=
T_COLOR(TScreenOf(newvt), TEXT_BG)) ||
(T_COLOR(TScreenOf(curvt), TEXT_FG) !=
T_COLOR(TScreenOf(newvt), TEXT_FG)) ||
(TScreenOf(curvt)->MenuFontName(TScreenOf(curvt)->menu_font_number) !=
TScreenOf(newvt)->MenuFontName(TScreenOf(newvt)->menu_font_number)) ||
(curvt->misc.default_font.f_n != newvt->misc.default_font.f_n)) {
if (curvt->misc.default_font.f_n != newvt->misc.default_font.f_n)
TScreenOf(newvt)->MenuFontName(fontMenu_default) = newvt->misc.default_font.f_n;
if (xtermLoadFont(newvt,
xtermFontName(TScreenOf(newvt)->MenuFontName(TScreenOf(curvt)->menu_font_number)),
True, TScreenOf(newvt)->menu_font_number)) {
/* resizing does the redisplay, so don't ask for it here */
refresh_needed = True;
fonts_redone = True;
} else if (curvt->misc.default_font.f_n != newvt->misc.default_font.f_n)
TScreenOf(newvt)->MenuFontName(fontMenu_default) = curvt->misc.default_font.f_n;
}
if (!fonts_redone
&& (T_COLOR(TScreenOf(curvt), TEXT_CURSOR) !=
T_COLOR(TScreenOf(newvt), TEXT_CURSOR))) {
if (set_cursor_gcs(newvt))
refresh_needed = True;
}
if (curvt->misc.re_verse != newvt->misc.re_verse) {
newvt->flags ^= REVERSE_VIDEO;
ReverseVideo(newvt);
/* ReverseVideo toggles */
newvt->misc.re_verse = (Boolean) (!newvt->misc.re_verse);
refresh_needed = True;
}
if ((T_COLOR(TScreenOf(curvt), MOUSE_FG) !=
T_COLOR(TScreenOf(newvt), MOUSE_FG)) ||
(T_COLOR(TScreenOf(curvt), MOUSE_BG) !=
T_COLOR(TScreenOf(newvt), MOUSE_BG))) {
recolor_cursor(TScreenOf(newvt),
TScreenOf(newvt)->pointer_cursor,
T_COLOR(TScreenOf(newvt), MOUSE_FG),
T_COLOR(TScreenOf(newvt), MOUSE_BG));
refresh_needed = True;
}
if (curvt->misc.scrollbar != newvt->misc.scrollbar) {
ToggleScrollBar(newvt);
}
return refresh_needed;
}
#define setGC(code) set_at = __LINE__, currentCgs = code
#define OutsideSelection(screen,srow,scol) \
((srow) > (screen)->endH.row || \
((srow) == (screen)->endH.row && \
(scol) >= (screen)->endH.col) || \
(srow) < (screen)->startH.row || \
((srow) == (screen)->startH.row && \
(scol) < (screen)->startH.col))
/*
* Shows cursor at new cursor position in screen.
*/
void
ShowCursor(void)
{
XtermWidget xw = term;
TScreen *screen = TScreenOf(xw);
int x, y;
IChar base;
unsigned flags;
CellColor fg_bg = 0;
GC currentGC;
GC outlineGC;
CgsEnum currentCgs = gcMAX;
VTwin *currentWin = WhichVWin(screen);
int set_at;
Bool in_selection;
Bool reversed;
Bool filled;
Pixel fg_pix;
Pixel bg_pix;
Pixel tmp;
#if OPT_HIGHLIGHT_COLOR
Pixel selbg_pix = T_COLOR(screen, HIGHLIGHT_BG);
Pixel selfg_pix = T_COLOR(screen, HIGHLIGHT_FG);
Boolean use_selbg;
Boolean use_selfg;
#endif
#if OPT_WIDE_CHARS
size_t off;
int my_col = 0;
#endif
int cursor_col;
LineData *ld = 0;
if (screen->cursor_state == BLINKED_OFF)
return;
if (screen->eventMode != NORMAL)
return;
if (INX2ROW(screen, screen->cur_row) > screen->max_row)
return;
screen->cursorp.row = screen->cur_row;
cursor_col = screen->cursorp.col = screen->cur_col;
screen->cursor_moved = False;
#ifndef NO_ACTIVE_ICON
if (IsIcon(screen)) {
screen->cursor_state = ON;
return;
}
#endif /* NO_ACTIVE_ICON */
ld = getLineData(screen, screen->cur_row);
base = ld->charData[cursor_col];
flags = ld->attribs[cursor_col];
if_OPT_WIDE_CHARS(screen, {
if (base == HIDDEN_CHAR && cursor_col > 0) {
/* if cursor points to non-initial part of wide character,
* back it up
*/
--cursor_col;
base = ld->charData[cursor_col];
}
my_col = cursor_col;
if (base == 0)
base = ' ';
if (isWide((int) base))
my_col += 1;
});
if (base == 0) {
base = ' ';
}
#if OPT_ISO_COLORS
#ifdef EXP_BOGUS_FG
/*
* If the cursor happens to be on blanks, and we have not set both
* foreground and background color, do not treat it as a colored cell.
*/
if (base == ' ') {
if ((flags & (FG_COLOR | BG_COLOR)) == BG_COLOR) {
TRACE(("ShowCursor - do not treat as a colored cell\n"));
flags &= ~(FG_COLOR | BG_COLOR);
} else if ((flags & (FG_COLOR | BG_COLOR)) == FG_COLOR) {
TRACE(("ShowCursor - should we treat as a colored cell?\n"));
if (!(xw->flags & FG_COLOR))
if (CheckBogusForeground(screen, "ShowCursor"))
flags &= ~(FG_COLOR | BG_COLOR);
}
}
#else /* !EXP_BOGUS_FG */
/*
* If the cursor happens to be on blanks, and the foreground color is set
* but not the background, do not treat it as a colored cell.
*/
if ((flags & TERM_COLOR_FLAGS(xw)) == FG_COLOR
&& base == ' ') {
flags &= ~TERM_COLOR_FLAGS(xw);
}
#endif
#endif
/*
* Compare the current cell to the last set of colors used for the
* cursor and update the GC's if needed.
*/
if_OPT_ISO_COLORS(screen, {
fg_bg = ld->color[cursor_col];
});
fg_pix = getXtermForeground(xw, flags, extract_fg(xw, fg_bg, flags));
bg_pix = getXtermBackground(xw, flags, extract_bg(xw, fg_bg, flags));
/*
* If we happen to have the same foreground/background colors, choose
* a workable foreground color from which we can obtain a visible cursor.
*/
if (fg_pix == bg_pix) {
long bg_diff = (long) (bg_pix - T_COLOR(TScreenOf(xw), TEXT_BG));
long fg_diff = (long) (bg_pix - T_COLOR(TScreenOf(xw), TEXT_FG));
if (bg_diff < 0)
bg_diff = -bg_diff;
if (fg_diff < 0)
fg_diff = -fg_diff;
if (bg_diff < fg_diff) {
fg_pix = T_COLOR(TScreenOf(xw), TEXT_FG);
} else {
fg_pix = T_COLOR(TScreenOf(xw), TEXT_BG);
}
}
if (OutsideSelection(screen, screen->cur_row, screen->cur_col))
in_selection = False;
else
in_selection = True;
reversed = ReverseOrHilite(screen, flags, in_selection);
/* This is like updatedXtermGC(), except that we have to worry about
* whether the window has focus, since in that case we want just an
* outline for the cursor.
*/
filled = (screen->select || screen->always_highlight) && isCursorBlock(screen);
#if OPT_HIGHLIGHT_COLOR
use_selbg = isNotForeground(xw, fg_pix, bg_pix, selbg_pix);
use_selfg = isNotBackground(xw, fg_pix, bg_pix, selfg_pix);
#endif
if (filled) {
if (reversed) { /* text is reverse video */
if (getCgsGC(xw, currentWin, gcVTcursNormal)) {
setGC(gcVTcursNormal);
} else {
if (flags & BOLDATTR(screen)) {
setGC(gcBold);
} else {
setGC(gcNorm);
}
}
EXCHANGE(fg_pix, bg_pix, tmp);
#if OPT_HIGHLIGHT_COLOR
if (screen->hilite_reverse) {
if (use_selbg && !use_selfg)
fg_pix = bg_pix;
if (use_selfg && !use_selbg)
bg_pix = fg_pix;
if (use_selbg)
bg_pix = selbg_pix;
if (use_selfg)
fg_pix = selfg_pix;
}
#endif
} else { /* normal video */
if (getCgsGC(xw, currentWin, gcVTcursReverse)) {
setGC(gcVTcursReverse);
} else {
if (flags & BOLDATTR(screen)) {
setGC(gcBoldReverse);
} else {
setGC(gcNormReverse);
}
}
}
if (T_COLOR(screen, TEXT_CURSOR) == xw->dft_foreground) {
setCgsBack(xw, currentWin, currentCgs, fg_pix);
}
setCgsFore(xw, currentWin, currentCgs, bg_pix);
} else { /* not selected */
if (reversed) { /* text is reverse video */
EXCHANGE(fg_pix, bg_pix, tmp);
setGC(gcNormReverse);
} else { /* normal video */
setGC(gcNorm);
}
#if OPT_HIGHLIGHT_COLOR
if (screen->hilite_reverse) {
if (in_selection && !reversed) {
/* EMPTY */
/* really INVERSE ... */
;
} else if (in_selection || reversed) {
if (use_selbg) {
if (use_selfg) {
bg_pix = fg_pix;
} else {
fg_pix = bg_pix;
}
}
if (use_selbg) {
bg_pix = selbg_pix;
}
if (use_selfg) {
fg_pix = selfg_pix;
}
}
} else {
if (in_selection) {
if (use_selbg) {
bg_pix = selbg_pix;
}
if (use_selfg) {
fg_pix = selfg_pix;
}
}
}
#endif
setCgsFore(xw, currentWin, currentCgs, fg_pix);
setCgsBack(xw, currentWin, currentCgs, bg_pix);
}
if (screen->cursor_busy == 0
&& (screen->cursor_state != ON || screen->cursor_GC != set_at)) {
screen->cursor_GC = set_at;
TRACE(("ShowCursor calling drawXtermText cur(%d,%d) %s-%s, set_at %d\n",
screen->cur_row, screen->cur_col,
(filled ? "filled" : "outline"),
(isCursorBlock(screen) ? "box" :
isCursorUnderline(screen) ? "underline" : "bar"),
set_at));
currentGC = getCgsGC(xw, currentWin, currentCgs);
x = LineCursorX(screen, ld, cursor_col);
y = CursorY(screen, screen->cur_row);
if (!isCursorBlock(screen)) {
/*
* Overriding the combination of filled, reversed, in_selection is
* too complicated since the underline or bar and the text-cell use
* different rules. Just redraw the text-cell, and draw the
* underline or bar on top of it.
*/
HideCursor();
/*
* Our current-GC is likely to have been modified in HideCursor().
* Set up a new request.
*/
if (filled) {
if (T_COLOR(screen, TEXT_CURSOR) == xw->dft_foreground) {
setCgsBack(xw, currentWin, currentCgs, fg_pix);
}
setCgsFore(xw, currentWin, currentCgs, bg_pix);
} else {
setCgsFore(xw, currentWin, currentCgs, fg_pix);
setCgsBack(xw, currentWin, currentCgs, bg_pix);
}
}
/*
* Update the outline-gc, to keep the cursor color distinct from the
* background color.
*/
set_cursor_outline_gc(xw,
filled,
fg_pix,
bg_pix,
T_COLOR(screen, TEXT_CURSOR));
outlineGC = getCgsGC(xw, currentWin, gcVTcursOutline);
if (outlineGC == 0)
outlineGC = currentGC;
if (isCursorUnderline(screen)) {
/*
* Finally, draw the underline.
*/
screen->box->x = (short) x;
screen->box->y = (short) (y + FontHeight(screen) - 2);
XDrawLines(screen->display, VDrawable(screen), outlineGC,
screen->box, NBOX, CoordModePrevious);
} else if (isCursorBar(screen)) {
/*
* Or draw the bar.
*/
screen->box->x = (short) x;
screen->box->y = (short) y;
XDrawLines(screen->display, VWindow(screen), outlineGC,
screen->box, NBOX, CoordModePrevious);
} else {
drawXtermText(xw, flags & DRAWX_MASK,
currentGC, x, y,
LineCharSet(screen, ld),
&base, 1, 0);
#if OPT_WIDE_CHARS
if_OPT_WIDE_CHARS(screen, {
for_each_combData(off, ld) {
if (!(ld->combData[off][my_col]))
break;
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
currentGC, x, y,
LineCharSet(screen, ld),
ld->combData[off] + my_col,
1, isWide((int) base));
}
});
#endif
if (!filled) {
screen->box->x = (short) x;
screen->box->y = (short) y;
XDrawLines(screen->display, VDrawable(screen), outlineGC,
screen->box, NBOX, CoordModePrevious);
}
}
}
screen->cursor_state = ON;
return;
}
/*
* hide cursor at previous cursor position in screen.
*/
void
HideCursor(void)
{
XtermWidget xw = term;
TScreen *screen = TScreenOf(xw);
GC currentGC;
int x, y;
IChar base;
unsigned flags;
CellColor fg_bg = 0;
Bool in_selection;
#if OPT_WIDE_CHARS
size_t off;
int my_col = 0;
#endif
int cursor_col;
LineData *ld = 0;
if (screen->cursor_state == OFF)
return;
if (INX2ROW(screen, screen->cursorp.row) > screen->max_row)
return;
cursor_col = screen->cursorp.col;
#ifndef NO_ACTIVE_ICON
if (IsIcon(screen)) {
screen->cursor_state = OFF;
return;
}
#endif /* NO_ACTIVE_ICON */
ld = getLineData(screen, screen->cursorp.row);
base = ld->charData[cursor_col];
flags = ld->attribs[cursor_col];
if_OPT_WIDE_CHARS(screen, {
if (base == HIDDEN_CHAR && cursor_col > 0) {
/* if cursor points to non-initial part of wide character,
* back it up
*/
--cursor_col;
base = ld->charData[cursor_col];
}
my_col = cursor_col;
if (base == 0)
base = ' ';
if (isWide((int) base))
my_col += 1;
});
if (base == 0) {
base = ' ';
}
#ifdef EXP_BOGUS_FG
/*
* If the cursor happens to be on blanks, and we have not set both
* foreground and background color, do not treat it as a colored cell.
*/
#if OPT_ISO_COLORS
if (base == ' ') {
if ((flags & (FG_COLOR | BG_COLOR)) == BG_COLOR) {
TRACE(("HideCursor - do not treat as a colored cell\n"));
flags &= ~(FG_COLOR | BG_COLOR);
} else if ((flags & (FG_COLOR | BG_COLOR)) == FG_COLOR) {
TRACE(("HideCursor - should we treat as a colored cell?\n"));
if (!(xw->flags & FG_COLOR))
if (CheckBogusForeground(screen, "HideCursor"))
flags &= ~(FG_COLOR | BG_COLOR);
}
}
#endif
#endif
#if OPT_ISO_COLORS
fg_bg = 0;
#endif
/*
* Compare the current cell to the last set of colors used for the
* cursor and update the GC's if needed.
*/
if_OPT_ISO_COLORS(screen, {
fg_bg = ld->color[cursor_col];
});
if (OutsideSelection(screen, screen->cursorp.row, screen->cursorp.col))
in_selection = False;
else
in_selection = True;
currentGC = updatedXtermGC(xw, flags, fg_bg, in_selection);
TRACE(("HideCursor calling drawXtermText cur(%d,%d)\n",
screen->cursorp.row, screen->cursorp.col));
x = LineCursorX(screen, ld, cursor_col);
y = CursorY(screen, screen->cursorp.row);
drawXtermText(xw, flags & DRAWX_MASK,
currentGC, x, y,
LineCharSet(screen, ld),
&base, 1, 0);
#if OPT_WIDE_CHARS
if_OPT_WIDE_CHARS(screen, {
for_each_combData(off, ld) {
if (!(ld->combData[off][my_col]))
break;
drawXtermText(xw, (flags & DRAWX_MASK) | NOBACKGROUND,
currentGC, x, y,
LineCharSet(screen, ld),
ld->combData[off] + my_col,
1, isWide((int) base));
}
});
#endif
screen->cursor_state = OFF;
resetXtermGC(xw, flags, in_selection);
refresh_displayed_graphics(screen,
screen->cursorp.col,
screen->cursorp.row,
1, 1);
return;
}
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
static void
StartBlinking(TScreen *screen)
{
if (screen->blink_timer == 0) {
unsigned long interval = (unsigned long) ((screen->cursor_state == ON)
? screen->blink_on
: screen->blink_off);
if (interval == 0) /* wow! */
interval = 1; /* let's humor him anyway */
screen->blink_timer = XtAppAddTimeOut(app_con,
interval,
HandleBlinking,
screen);
}
}
static void
StopBlinking(TScreen *screen)
{
if (screen->blink_timer) {
XtRemoveTimeOut(screen->blink_timer);
screen->blink_timer = 0;
reallyStopBlinking(screen);
} else {
screen->blink_timer = 0;
}
}
#if OPT_BLINK_TEXT
Bool
LineHasBlinking(TScreen *screen, LineData *ld)
{
int col;
Bool result = False;
for (col = 0; col < MaxCols(screen); ++col) {
if (ld->attribs[col] & BLINK) {
result = True;
break;
}
}
return result;
}
#endif
/*
* Blink the cursor by alternately showing/hiding cursor. We leave the timer
* running all the time (even though that's a little inefficient) to make the
* logic simple.
*/
static void
HandleBlinking(XtPointer closure, XtIntervalId * id GCC_UNUSED)
{
TScreen *screen = (TScreen *) closure;
Bool resume = False;
screen->blink_timer = 0;
screen->blink_state = !screen->blink_state;
#if OPT_BLINK_CURS
if (DoStartBlinking(screen)) {
if (screen->cursor_state == ON) {
if (screen->select || screen->always_highlight) {
HideCursor();
if (screen->cursor_state == OFF)
screen->cursor_state = BLINKED_OFF;
}
} else if (screen->cursor_state == BLINKED_OFF) {
screen->cursor_state = OFF;
ShowCursor();
if (screen->cursor_state == OFF)
screen->cursor_state = BLINKED_OFF;
}
resume = True;
}
#endif
#if OPT_BLINK_TEXT
/*
* Inspect the lines on the current screen to see if any have the BLINK flag
* associated with them. Prune off any that have had the corresponding
* cells reset. If any are left, repaint those lines with ScrnRefresh().
*/
if (!(screen->blink_as_bold)) {
int row;
int first_row = screen->max_row;
int last_row = -1;
for (row = screen->max_row; row >= 0; row--) {
LineData *ld = getLineData(screen, ROW2INX(screen, row));
if (ld != 0 && LineTstBlinked(ld)) {
if (LineHasBlinking(screen, ld)) {
resume = True;
if (row > last_row)
last_row = row;
if (row < first_row)
first_row = row;
} else {
LineClrBlinked(ld);
}
}
}
/*
* FIXME: this could be a little more efficient, e.g,. by limiting the
* columns which are updated.
*/
if (first_row <= last_row) {
ScrnRefresh(term,
first_row,
0,
last_row + 1 - first_row,
MaxCols(screen),
True);
}
}
#endif
/*
* If either the cursor or text is blinking, restart the timer.
*/
if (resume)
StartBlinking(screen);
}
#endif /* OPT_BLINK_CURS || OPT_BLINK_TEXT */
void
RestartBlinking(TScreen *screen GCC_UNUSED)
{
#if OPT_BLINK_CURS || OPT_BLINK_TEXT
if (screen->blink_timer == 0) {
Bool resume = False;
#if OPT_BLINK_CURS
if (DoStartBlinking(screen)) {
resume = True;
}
#endif
#if OPT_BLINK_TEXT
if (!resume) {
int row;
for (row = screen->max_row; row >= 0; row--) {
LineData *ld = getLineData(screen, ROW2INX(screen, row));
if (ld != 0 && LineTstBlinked(ld)) {
if (LineHasBlinking(screen, ld)) {
resume = True;
break;
}
}
}
}
#endif
if (resume)
StartBlinking(screen);
}
#endif
}
/*
* Implement soft or hard (full) reset of the VTxxx emulation. There are a
* couple of differences from real DEC VTxxx terminals (to avoid breaking
* applications which have come to rely on xterm doing this):
*
* + autowrap mode should be reset (instead it's reset to the resource
* default).
* + the popup menu offers a choice of resetting the savedLines, or not.
* (but the control sequence does this anyway).
*/
static void
ReallyReset(XtermWidget xw, Bool full, Bool saved)
{
static char empty[1];
TScreen *screen = TScreenOf(xw);
if (!XtIsRealized((Widget) xw) || (CURRENT_EMU() != (Widget) xw)) {
Bell(xw, XkbBI_MinorError, 0);
return;
}
if (saved) {
screen->savedlines = 0;
ScrollBarDrawThumb(screen->scrollWidget);
}
/* make cursor visible */
screen->cursor_set = ON;
/* reset scrolling region */
reset_margins(screen);
bitclr(&xw->flags, ORIGIN);
if_OPT_ISO_COLORS(screen, {
reset_SGR_Colors(xw);
if (ResetAnsiColorRequest(xw, empty, 0))
xtermRepaint(xw);
});
/* Reset character-sets to initial state */
resetCharsets(screen);
#if OPT_MOD_FKEYS
/* Reset modifier-resources to initial state */
xw->keyboard.modify_now = xw->keyboard.modify_1st;
#endif
/* Reset DECSCA */
bitclr(&xw->flags, PROTECTED);
screen->protected_mode = OFF_PROTECT;
reset_displayed_graphics(screen);
if (full) { /* RIS */
if (screen->bellOnReset)
Bell(xw, XkbBI_TerminalBell, 0);
/* reset the mouse mode */
screen->send_mouse_pos = MOUSE_OFF;
screen->send_focus_pos = OFF;
screen->extend_coords = 0;
screen->waitingForTrackInfo = False;
screen->eventMode = NORMAL;
xtermShowPointer(xw, True);
TabReset(xw->tabs);
xw->keyboard.flags = MODE_SRM;
#if OPT_INITIAL_ERASE
if (xw->keyboard.reset_DECBKM == 1)
xw->keyboard.flags |= MODE_DECBKM;
else if (xw->keyboard.reset_DECBKM == 2)
#endif
if (TScreenOf(xw)->backarrow_key)
xw->keyboard.flags |= MODE_DECBKM;
TRACE(("full reset DECBKM %s\n",
BtoS(xw->keyboard.flags & MODE_DECBKM)));
#if OPT_SIXEL_GRAPHICS
if (TScreenOf(xw)->sixel_scrolling) /* FIXME: should this be off unconditionally here? */
xw->keyboard.flags |= MODE_DECSDM;
TRACE(("full reset DECSDM %s (resource default is %d)\n",
BtoS(xw->keyboard.flags & MODE_DECSDM),
TScreenOf(xw)->sixel_scrolling));
#endif
update_appcursor();
update_appkeypad();
update_decbkm();
update_decsdm();
show_8bit_control(False);
reset_decudk();
FromAlternate(xw);
ClearScreen(xw);
screen->cursor_state = OFF;
if (xw->flags & REVERSE_VIDEO)
ReverseVideo(xw);
xw->flags = xw->initflags;
update_reversevideo();
update_autowrap();
update_reversewrap();
update_autolinefeed();
screen->jumpscroll = (Boolean) (!(xw->flags & SMOOTHSCROLL));
update_jumpscroll();
if (screen->c132 && (xw->flags & IN132COLUMNS)) {
Dimension reqWidth = (Dimension) (80 * FontWidth(screen)
+ 2 * screen->border
+ ScrollbarWidth(screen));
Dimension reqHeight = (Dimension) (FontHeight(screen)
* MaxRows(screen)
+ 2 * screen->border);
Dimension replyWidth;
Dimension replyHeight;
TRACE(("Making resize-request to restore 80-columns %dx%d\n",
reqHeight, reqWidth));
REQ_RESIZE((Widget) xw,
reqWidth,
reqHeight,
&replyWidth, &replyHeight);
repairSizeHints();
XSync(screen->display, False); /* synchronize */
if (xtermAppPending())
xevents();
}
CursorSet(screen, 0, 0, xw->flags);
CursorSave(xw);
} else { /* DECSTR */
/*
* There's a tiny difference, to accommodate usage of xterm.
* We reset autowrap to the resource values rather than turning
* it off.
*/
UIntClr(xw->keyboard.flags, (MODE_DECCKM | MODE_KAM | MODE_DECKPAM));
bitcpy(&xw->flags, xw->initflags, WRAPAROUND | REVERSEWRAP);
bitclr(&xw->flags, INSERT | INVERSE | BOLD | BLINK | UNDERLINE | INVISIBLE);
if_OPT_ISO_COLORS(screen, {
reset_SGR_Colors(xw);
});
update_appcursor();
update_autowrap();
update_reversewrap();
CursorSave(xw);
screen->sc[screen->whichBuf].row =
screen->sc[screen->whichBuf].col = 0;
}
}
void
VTReset(XtermWidget xw, Bool full, Bool saved)
{
ReallyReset(xw, full, saved);
longjmp(vtjmpbuf, 1); /* force ground state in parser */
}
/*
* set_character_class - takes a string of the form
*
* low[-high]:val[,low[-high]:val[...]]
*
* and sets the indicated ranges to the indicated values.
*/
static int
set_character_class(char *s)
{
#define FMT "%s in range string \"%s\" (position %d)\n"
int i; /* iterator, index into s */
int len; /* length of s */
int acc; /* accumulator */
int low, high; /* bounds of range [0..127] */
int base; /* 8, 10, 16 (octal, decimal, hex) */
int numbers; /* count of numbers per range */
int digits; /* count of digits in a number */
if (!s || !s[0])
return -1;
base = 10; /* in case we ever add octal, hex */
low = high = -1; /* out of range */
for (i = 0, len = (int) strlen(s), acc = 0, numbers = digits = 0;
i < len; i++) {
Char c = CharOf(s[i]);
if (isspace(c)) {
continue;
} else if (isdigit(c)) {
acc = acc * base + (c - '0');
digits++;
continue;
} else if (c == '-') {
low = acc;
acc = 0;
if (digits == 0) {
xtermWarning(FMT, "missing number", s, i);
return (-1);
}
digits = 0;
numbers++;
continue;
} else if (c == ':') {
if (numbers == 0)
low = acc;
else if (numbers == 1)
high = acc;
else {
xtermWarning(FMT, "too many numbers", s, i);
return (-1);
}
digits = 0;
numbers++;
acc = 0;
continue;
} else if (c == ',') {
/*
* now, process it
*/
if (high < 0) {
high = low;
numbers++;
}
if (numbers != 2) {
xtermWarning(FMT, "bad value number", s, i);
} else if (SetCharacterClassRange(low, high, acc) != 0) {
xtermWarning(FMT, "bad range", s, i);
}
low = high = -1;
acc = 0;
digits = 0;
numbers = 0;
continue;
} else {
xtermWarning(FMT, "bad character", s, i);
return (-1);
} /* end if else if ... else */
}
if (low < 0 && high < 0)
return (0);
/*
* now, process it
*/
if (high < 0)
high = low;
if (numbers < 1 || numbers > 2) {
xtermWarning(FMT, "bad value number", s, i);
} else if (SetCharacterClassRange(low, high, acc) != 0) {
xtermWarning(FMT, "bad range", s, i);
}
return (0);
#undef FMT
}
/* ARGSUSED */
static void
HandleKeymapChange(Widget w,
XEvent * event GCC_UNUSED,
String *params,
Cardinal *param_count)
{
static XtTranslations keymap, original;
static XtResource key_resources[] =
{
{XtNtranslations, XtCTranslations, XtRTranslationTable,
sizeof(XtTranslations), 0, XtRTranslationTable, (XtPointer) NULL}
};
char mapName[1000];
char mapClass[1000];
char *pmapName;
char *pmapClass;
size_t len;
if (*param_count != 1)
return;
if (original == NULL)
original = w->core.tm.translations;
if (strcmp(params[0], "None") == 0) {
XtOverrideTranslations(w, original);
return;
}
len = strlen(params[0]) + 7;
pmapName = (char *) MyStackAlloc(len, mapName);
pmapClass = (char *) MyStackAlloc(len, mapClass);
if (pmapName == NULL
|| pmapClass == NULL) {
SysError(ERROR_KMMALLOC1);
} else {
(void) sprintf(pmapName, "%sKeymap", params[0]);
(void) strcpy(pmapClass, pmapName);
if (islower(CharOf(pmapClass[0])))
pmapClass[0] = x_toupper(pmapClass[0]);
XtGetSubresources(w, (XtPointer) &keymap, pmapName, pmapClass,
key_resources, (Cardinal) 1, NULL, (Cardinal) 0);
if (keymap != NULL)
XtOverrideTranslations(w, keymap);
MyStackFree(pmapName, mapName);
MyStackFree(pmapClass, mapClass);
}
}
/* ARGSUSED */
static void
HandleBell(Widget w GCC_UNUSED,
XEvent * event GCC_UNUSED,
String *params, /* [0] = volume */
Cardinal *param_count) /* 0 or 1 */
{
int percent = (*param_count) ? atoi(params[0]) : 0;
Bell(term, XkbBI_TerminalBell, percent);
}
/* ARGSUSED */
static void
HandleVisualBell(Widget w GCC_UNUSED,
XEvent * event GCC_UNUSED,
String *params GCC_UNUSED,
Cardinal *param_count GCC_UNUSED)
{
VisualBell();
}
/* ARGSUSED */
static void
HandleIgnore(Widget w,
XEvent * event,
String *params GCC_UNUSED,
Cardinal *param_count GCC_UNUSED)
{
XtermWidget xw;
TRACE(("Handle ignore for %p %s\n",
(void *) w, visibleEventType(event->type)));
if ((xw = getXtermWidget(w)) != 0) {
/* do nothing, but check for funny escape sequences */
(void) SendMousePosition(xw, event);
}
}
/* ARGSUSED */
static void
DoSetSelectedFont(Widget w,
XtPointer client_data GCC_UNUSED,
Atom * selection GCC_UNUSED,
Atom * type,
XtPointer value,
unsigned long *length,
int *format)
{
XtermWidget xw = getXtermWidget(w);
if (xw == 0) {
xtermWarning("unexpected widget in DoSetSelectedFont\n");
} else if (*type != XA_STRING || *format != 8) {
Bell(xw, XkbBI_MinorError, 0);
} else {
Boolean failed = False;
int oldFont = TScreenOf(xw)->menu_font_number;
String save = TScreenOf(xw)->MenuFontName(fontMenu_fontsel);
char *val;
char *test = 0;
char *used = 0;
unsigned len = (unsigned) *length;
unsigned tst;
/*
* Some versions of X deliver null-terminated selections, some do not.
*/
for (tst = 0; tst < len; ++tst) {
if (((char *) value)[tst] == '\0') {
len = tst;
break;
}
}
if (len > 0 && (val = TypeMallocN(char, len + 1)) != 0) {
memcpy(val, value, (size_t) len);
val[len] = '\0';
used = x_strtrim(val);
TRACE(("DoSetSelectedFont(%s)\n", used));
/* Do some sanity checking to avoid sending a long selection
back to the server in an OpenFont that is unlikely to succeed.
XLFD allows up to 255 characters and no control characters;
we are a little more liberal here. */
if (len < 1000
&& used != 0
&& !strchr(used, '\n')
&& (test = x_strdup(used)) != 0) {
TScreenOf(xw)->MenuFontName(fontMenu_fontsel) = test;
if (!xtermLoadFont(term,
xtermFontName(used),
True,
fontMenu_fontsel)) {
failed = True;
free(test);
TScreenOf(xw)->MenuFontName(fontMenu_fontsel) = save;
}
} else {
failed = True;
}
if (failed) {
(void) xtermLoadFont(term,
xtermFontName(TScreenOf(xw)->MenuFontName(oldFont)),
True,
oldFont);
Bell(xw, XkbBI_MinorError, 0);
}
free(used);
free(val);
}
}
}
void
FindFontSelection(XtermWidget xw, const char *atom_name, Bool justprobe)
{
TScreen *screen = TScreenOf(xw);
static AtomPtr *atoms;
static unsigned int atomCount = 0;
AtomPtr *pAtom;
unsigned a;
Atom target;
if (!atom_name)
atom_name = (screen->mappedSelect
? screen->mappedSelect[0]
: "PRIMARY");
TRACE(("FindFontSelection(%s)\n", atom_name));
for (pAtom = atoms, a = atomCount; a; a--, pAtom++) {
if (strcmp(atom_name, XmuNameOfAtom(*pAtom)) == 0) {
TRACE(("...found atom %d:%s\n", a + 1, atom_name));
break;
}
}
if (!a) {
atoms = TypeXtReallocN(AtomPtr, atoms, atomCount + 1);
*(pAtom = &atoms[atomCount]) = XmuMakeAtom(atom_name);
++atomCount;
TRACE(("...added atom %d:%s\n", atomCount, atom_name));
}
target = XmuInternAtom(XtDisplay(xw), *pAtom);
if (justprobe) {
screen->MenuFontName(fontMenu_fontsel) =
XGetSelectionOwner(XtDisplay(xw), target) ? _Font_Selected_ : 0;
TRACE(("...selected fontname '%s'\n",
NonNull(screen->MenuFontName(fontMenu_fontsel))));
} else {
XtGetSelectionValue((Widget) xw, target, XA_STRING,
DoSetSelectedFont, NULL,
XtLastTimestampProcessed(XtDisplay(xw)));
}
return;
}
Bool
set_cursor_gcs(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
VTwin *win = WhichVWin(screen);
Pixel cc = T_COLOR(screen, TEXT_CURSOR);
Pixel fg = T_COLOR(screen, TEXT_FG);
Pixel bg = T_COLOR(screen, TEXT_BG);
Bool changed = False;
/*
* Let's see, there are three things that have "color":
*
* background
* text
* cursorblock
*
* And, there are four situations when drawing a cursor, if we decide
* that we like have a solid block of cursor color with the letter
* that it is highlighting shown in the background color to make it
* stand out:
*
* selected window, normal video - background on cursor
* selected window, reverse video - foreground on cursor
* unselected window, normal video - foreground on background
* unselected window, reverse video - background on foreground
*
* Since the last two are really just normalGC and reverseGC, we only
* need two new GC's. Under monochrome, we get the same effect as
* above by setting cursor color to foreground.
*/
TRACE(("set_cursor_gcs cc=%#lx, fg=%#lx, bg=%#lx\n", cc, fg, bg));
if (win != 0 && (cc != bg)) {
/* set the fonts to the current one */
setCgsFont(xw, win, gcVTcursNormal, 0);
setCgsFont(xw, win, gcVTcursFilled, 0);
setCgsFont(xw, win, gcVTcursReverse, 0);
setCgsFont(xw, win, gcVTcursOutline, 0);
/* we have a colored cursor */
setCgsFore(xw, win, gcVTcursNormal, fg);
setCgsBack(xw, win, gcVTcursNormal, cc);
setCgsFore(xw, win, gcVTcursFilled, cc);
setCgsBack(xw, win, gcVTcursFilled, fg);
if (screen->always_highlight) {
/* both GC's use the same color */
setCgsFore(xw, win, gcVTcursReverse, bg);
setCgsBack(xw, win, gcVTcursReverse, cc);
} else {
setCgsFore(xw, win, gcVTcursReverse, bg);
setCgsBack(xw, win, gcVTcursReverse, cc);
}
set_cursor_outline_gc(xw, screen->always_highlight, fg, bg, cc);
changed = True;
}
if (changed) {
TRACE(("...set_cursor_gcs - done\n"));
}
return changed;
}
/*
* Build up the default translations string, allowing the user to suppress
* some of the features.
*/
void
VTInitTranslations(void)
{
/* *INDENT-OFF* */
static struct {
Boolean wanted;
const char *name;
const char *value;
} table[] = {
{
False,
"default",
"\
Shift Prior:scroll-back(1,halfpage) \n\
Shift Next:scroll-forw(1,halfpage) \n\
Shift Select:select-cursor-start() select-cursor-end(SELECT, CUT_BUFFER0) \n\
Shift Insert:insert-selection(SELECT, CUT_BUFFER0) \n\
"
},
#if OPT_MAXIMIZE
{
False,
"fullscreen",
"\
Alt Return:fullscreen() \n\
"
},
#endif
#if OPT_SCROLL_LOCK
{
False,
"scroll-lock",
"\
Scroll_Lock:scroll-lock() \n\
"
},
#endif
#if OPT_SHIFT_FONTS
{
False,
"shift-fonts",
"\
Shift~Ctrl KP_Add:larger-vt-font() \n\
Shift Ctrl KP_Add:smaller-vt-font() \n\
Shift KP_Subtract:smaller-vt-font() \n\
"
},
#endif
/* PROCURA added "Meta :clear-saved-lines()" */
{
False,
"default",
"\
~Meta :insert-seven-bit() \n\
Meta :insert-eight-bit() \n\
!Ctrl :popup-menu(mainMenu) \n\
!Lock Ctrl :popup-menu(mainMenu) \n\
!Lock Ctrl @Num_Lock :popup-menu(mainMenu) \n\
! @Num_Lock Ctrl :popup-menu(mainMenu) \n\
~Meta :select-start() \n\
~Meta :select-extend() \n\
!Ctrl :popup-menu(vtMenu) \n\
!Lock Ctrl :popup-menu(vtMenu) \n\
!Lock Ctrl @Num_Lock :popup-menu(vtMenu) \n\
! @Num_Lock Ctrl :popup-menu(vtMenu) \n\
~Ctrl ~Meta :ignore() \n\
Meta :clear-saved-lines() \n\
~Ctrl ~Meta :insert-selection(SELECT, CUT_BUFFER0) \n\
!Ctrl :popup-menu(fontMenu) \n\
!Lock Ctrl :popup-menu(fontMenu) \n\
!Lock Ctrl @Num_Lock :popup-menu(fontMenu) \n\
! @Num_Lock Ctrl :popup-menu(fontMenu) \n\
~Ctrl ~Meta :start-extend() \n\
~Meta :select-extend() \n\
"
},
{
False,
"wheel-mouse",
"\
Ctrl :scroll-back(1,halfpage,m) \n\
Lock Ctrl :scroll-back(1,halfpage,m) \n\
Lock @Num_Lock Ctrl :scroll-back(1,halfpage,m) \n\
@Num_Lock Ctrl :scroll-back(1,halfpage,m) \n\
:scroll-back(5,line,m) \n\
Ctrl :scroll-forw(1,halfpage,m) \n\
Lock Ctrl :scroll-forw(1,halfpage,m) \n\
Lock @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \n\
@Num_Lock Ctrl :scroll-forw(1,halfpage,m) \n\
:scroll-forw(5,line,m) \n\
"
},
{
False,
"default",
"\
:select-end(SELECT, CUT_BUFFER0) \n\
:ignore() \
"
}
};
/* *INDENT-ON* */
size_t needed = 0;
char *result = 0;
int pass;
Cardinal item;
TRACE(("VTInitTranslations\n"));
for (item = 0; item < XtNumber(table); ++item) {
table[item].wanted = True;
}
#if OPT_MAXIMIZE
/*
* As a special case, allow for disabling the alt-enter translation if
* the resource settings prevent fullscreen from being used. We would
* do the same for scroll-lock and shift-fonts if they were application
* resources too, rather than in the widget.
*/
if (resource.fullscreen == esNever) {
for (item = 0; item < XtNumber(table); ++item) {
if (!strcmp(table[item].name, "fullscreen")) {
table[item].wanted = False;
TRACE(("omit(%s):\n%s\n", table[item].name, table[item].value));
}
}
}
#endif
if (!IsEmpty(resource.omitTranslation)) {
char *value;
const char *source = resource.omitTranslation;
while (*source != '\0' && (value = ParseList(&source)) != 0) {
size_t len = strlen(value);
TRACE(("parsed:%s\n", value));
for (item = 0; item < XtNumber(table); ++item) {
if (strlen(table[item].name) >= len
&& x_strncasecmp(table[item].name,
value,
(unsigned) len) == 0) {
table[item].wanted = False;
TRACE(("omit(%s):\n%s\n", table[item].name, table[item].value));
break;
}
}
free(value);
}
}
for (pass = 0; pass < 2; ++pass) {
needed = 0;
for (item = 0; item < XtNumber(table); ++item) {
if (table[item].wanted) {
if (pass) {
strcat(result, table[item].value);
} else {
needed += strlen(table[item].value) + 1;
}
}
}
if (!pass) {
result = XtMalloc((Cardinal) needed);
*result = '\0';
}
}
TRACE(("result:\n%s\n", result));
defaultTranslations = result;
xtermClassRec.core_class.tm_table = result;
}
#ifdef NO_LEAKS
void
noleaks_charproc(void)
{
if (v_buffer != 0)
free(v_buffer);
}
#endif
xterm-297/gen-pc-fkeys.pl 0000755 0001751 0000144 00000024574 10724113333 014114 0 ustar tom users #! /usr/bin/perl -w
# $XTermId: gen-pc-fkeys.pl,v 1.22 2007/11/30 23:03:55 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2004-2005,2007 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
#
# Construct a list of function-key definitions corresponding to xterm's
# Sun/PC keyboard. This uses ncurses' infocmp to obtain the strings (including
# extensions) to modify (and verify).
use strict;
my($max_modifier, $terminfo);
my(@old_fkeys, $opt_fkeys, $min_fkeys, $max_fkeys);
my(%old_ckeys, $opt_ckeys, $min_ckeys, $max_ckeys);
my(%old_ekeys, $opt_ekeys, $min_ekeys, $max_ekeys);
my(@ckey_names);
@ckey_names = (
'kcud1', 'kcub1', 'kcuf1', 'kcuu1', # 1 = no modifiers
'kDN', 'kLFT', 'kRIT', 'kUP', # 2 = shift
# make_ckey_names() repeats this row, appending the modifier code
);
my %ckey_names;
my(@ckey_known);
@ckey_known = (
'kind', 'kLFT', 'kRIT', 'kri', # 2 = shift (standard)
);
my(@ekey_names);
@ekey_names = (
'khome', 'kend', 'knp', 'kpp', 'kdch1', 'kich1', # 1 = no modifiers
'kHOM', 'kEND', 'kNXT', 'kPRV', 'kDC', 'kIC', # 2 = shift
# make_ekey_names() repeats this row, appending the modifier code
);
my %ekey_names;
$min_fkeys=12; # the number of "real" function keys on your keyboard
$max_fkeys=64; # the number of function-keys terminfo can support
$max_modifier=8; # modifier 1 + (1=shift, 2=alt, 4=control 8=meta)
$min_ckeys=4; # the number of "real" cursor keys on your keyboard
$max_ckeys=($min_ckeys * ($max_modifier - 1));
$min_ekeys=6; # the number of "real" editing keys on your keyboard
$max_ekeys=($min_ekeys * ($max_modifier - 1));
$opt_ckeys=2; # xterm's modifyCursorKeys resource
$opt_ekeys=2; # xterm's modifyCursorKeys resource
$opt_fkeys=2; # xterm's modifyFunctionKeys resource
$terminfo="xterm-new"; # the terminfo entry to use
# apply the given modifier to the terminfo string, return the result
sub modify_fkey($$$) {
my $code = $_[0];
my $text = $_[1];
my $opts = $_[2];
if (not defined($text)) {
$text = "";
} elsif ($code != 1) {
$text =~ s/\\EO/\\E\[/ if ($opts >= 1);
my $piece = substr $text, 0, length ($text) - 1;
my $final = substr $text, length ($text) - 1;
my $check = substr $piece, length ($piece) - 1;
if ($check =~ /[0-9]/) {
$code = ";" . $code;
} elsif ( $check =~ /\[/ and $opts >= 2) {
$code = "1;" . $code;
}
if ( $opts >= 3 ) {
$code = ">" . $code;
}
$text = $piece . $code . $final;
$text =~ s/([\d;]+)>/>$1/;
}
return $text;
}
# compute the next modifier value -
# Cycling through the modifiers is not just like counting. Users prefer
# pressing one modifier (even if using Emacs). So first we cycle through
# the individual modifiers, then for completeness two, three, etc.
sub next_modifier {
my $code = $_[0];
my $mask = $code - 1;
if ($mask == 0) {
$mask = 1; # shift
} elsif ($mask == 1) {
$mask = 4; # control
} elsif ($mask == 2) {
$mask = 3; # shift+alt
} elsif ($mask == 4) {
$mask = 5; # shift+control
} elsif ($mask == 5) {
$mask = 2; # alt
}
# printf ("# next_modifier(%d) = %d\n", $code, $mask + 1);
return $mask + 1;
}
sub make_ckey_names() {
my ($j, $k);
my $min = $min_ckeys * 2;
my $max = $max_ckeys - 1;
# printf "# make_ckey_names\n";
for $j ($min..$max) {
$k = 1 + substr($j / $min_ckeys, 0, 1);
$ckey_names[$j] = $ckey_names[$min_ckeys + ($j % $min_ckeys)] . $k;
# printf "# make %d:%s\n", $j, $ckey_names[$j];
}
for $j (0..$#ckey_names) {
# printf "# %d:%s\n", $j, $ckey_names[$j];
$ckey_names{$ckey_names[$j]} = $j;
}
}
sub make_ekey_names() {
my ($j, $k);
my $min = $min_ekeys * 2;
my $max = $max_ekeys - 1;
# printf "# make_ekey_names\n";
for $j ($min..$max) {
$k = 1 + substr($j / $min_ekeys, 0, 1);
$ekey_names[$j] = $ekey_names[$min_ekeys + ($j % $min_ekeys)] . $k;
# printf "# make %d:%s\n", $j, $ekey_names[$j];
}
for $j (0..$#ekey_names) {
# printf "# %d:%s\n", $j, $ekey_names[$j];
$ekey_names{$ekey_names[$j]} = $j;
}
}
# Read the terminfo entry's list of function keys $old_fkeys[].
# We could handle $old_fkeys[0], but choose to start numbering from 1.
sub readterm($) {
my $term = $_[0];
my($key, $n, $str);
my(@list) = `infocmp -x -1 $term`;
for $n (0..$#list) {
chop $list[$n];
$list[$n] =~ s/^[[:space:]]//;
$key = $list[$n];
$key =~ s/=.*//;
$str = $list[$n];
$str =~ s/^[^=]+=//;
$str =~ s/,$//;
if ( $list[$n] =~ /^kf[[:digit:]]+=/ ) {
$key =~ s/^kf//;
# printf "# $n:%s(%d)(%s)\n", $list[$n], $key, $str;
$old_fkeys[$key] = $str;
} elsif ( $key =~ /^kc[[:alpha:]]+1/
or $key =~ /^k(LFT|RIT|UP|DN)\d?/) {
# printf "# $n:%s(%d)(%s)\n", $list[$n], $key, $str;
$old_ckeys{$key} = $str;
} elsif ( defined $ekey_names{$key} ) {
# printf "# $n:%s(%s)(%s)\n", $list[$n], $key, $str;
$old_ekeys{$key} = $str;
}
}
# printf ("last index:%d\n", $#old_fkeys);
}
# read the whole terminfo to ensure we get the non-modified stuff, then read
# the part that contains modifiers.
sub read_part($) {
my $part = $_[0];
%old_ckeys = ();
@old_fkeys = ();
readterm($terminfo);
readterm($part);
}
sub nameof_ckeys($) {
my $opts = $_[0];
my $optname = "xterm+pcc" . ($opts >= 0 ? $opts : "n");
return $optname;
}
sub generate_ckeys($) {
my $opts = $_[0];
my($modifier, $cur_ckey, $index);
printf "%s|fragment with modifyCursorKeys:%s,\n",
nameof_ckeys($opts), $opts;
# show the standard cursor definitions
$modifier = 1;
for ($index = 0; $index < $min_ckeys; ++$index) {
$cur_ckey = $index + ($modifier * $min_ckeys);
my $name = $ckey_known[$index];
my $input = $old_ckeys{$ckey_names[$index]};
my $result = modify_fkey($modifier + 1, $input, $opts);
printf "\t%s=%s,\n", $name, $result;
if (defined $old_ckeys{$name}) {
if ($old_ckeys{$name} ne $result) {
printf "# found %s=%s\n", $name, $old_ckeys{$name};
}
}
}
# show the extended cursor definitions
for ($index = 0; $index < $min_ckeys; ++$index) {
for ($modifier = 1; $modifier < $max_modifier; ++$modifier) {
$cur_ckey = $index + ($modifier * $min_ckeys);
if (defined $ckey_names[$cur_ckey] and
$ckey_names[$cur_ckey] ne "kLFT" and
$ckey_names[$cur_ckey] ne "kRIT" ) {
my $name = $ckey_names[$cur_ckey];
my $input = $old_ckeys{$ckey_names[$index]};
my $result = modify_fkey($modifier + 1, $input, $opts);
printf "\t%s=%s,\n", $name, $result;
if (defined $old_ckeys{$name}) {
if ($old_ckeys{$name} ne $result) {
printf "# found %s=%s\n", $name, $old_ckeys{$name};
}
}
}
}
}
}
sub nameof_ekeys($) {
my $opts = $_[0];
my $optname = "xterm+pce" . ($opts >= 0 ? $opts : "n");
return $optname;
}
sub generate_ekeys($) {
my $opts = $_[0];
my($modifier, $cur_ekey, $index);
printf "%s|fragment with modifyCursorKeys:%s,\n",
nameof_ekeys($opts), $opts;
for ($index = 0; $index < $min_ekeys; ++$index) {
for ($modifier = 1; $modifier < $max_modifier; ++$modifier) {
$cur_ekey = $index + ($modifier * $min_ekeys);
if (defined $ekey_names[$cur_ekey] ) {
my $name = $ekey_names[$cur_ekey];
my $input = $old_ekeys{$ekey_names[$index]};
my $result = modify_fkey($modifier + 1, $input, $opts);
printf "\t%s=%s,\n", $name, $result;
if (defined $old_ekeys{$name}) {
if ($old_ekeys{$name} ne $result) {
printf "# found %s=%s\n", $name, $old_ekeys{$name};
}
}
}
}
}
}
sub nameof_fkeys($) {
my $opts = $_[0];
my $optname = "xterm+pcf" . ($opts >= 0 ? $opts : "n");
return $optname;
}
sub generate_fkeys($) {
my $opts = $_[0];
my($modifier, $cur_fkey);
printf "%s|fragment with modifyFunctionKeys:%s and ctrlFKeys:10,\n",
nameof_fkeys($opts), $opts;
for ($cur_fkey = 1, $modifier = 1; $cur_fkey < $max_fkeys; ++$cur_fkey) {
my $index = (($cur_fkey - 1) % $min_fkeys);
if ($index == 0 && $cur_fkey != 1) {
$modifier = next_modifier($modifier);
}
if (defined $old_fkeys[$index + 1]) {
my $input = $old_fkeys[$index + 1];
my $result = modify_fkey($modifier, $input, $opts);
printf "\tkf%d=%s,\n", $cur_fkey, $result;
if (defined $old_fkeys[$cur_fkey]) {
if ($old_fkeys[$cur_fkey] ne $result) {
printf "# found kf%d=%s\n", $cur_fkey, $old_fkeys[$cur_fkey];
}
}
}
}
}
sub show_default() {
readterm($terminfo);
printf "xterm+pcfkeys|fragment for PC-style keys,\n";
printf "\tuse=%s,\n", nameof_ckeys($opt_ckeys);
printf "\tuse=%s,\n", nameof_ekeys($opt_ekeys);
printf "\tuse=%s,\n", nameof_fkeys($opt_fkeys);
generate_ckeys($opt_ckeys);
generate_ekeys($opt_ekeys);
generate_fkeys($opt_fkeys);
}
sub show_nondefault()
{
my $opts;
for ($opts = 0; $opts <= 3; ++$opts) {
if ($opts != $opt_ckeys) {
read_part(nameof_ckeys($opts));
generate_ckeys($opts);
}
}
for ($opts = 0; $opts <= 3; ++$opts) {
if ($opts != $opt_ekeys) {
read_part(nameof_ekeys($opts));
generate_ekeys($opts);
}
}
for ($opts = 0; $opts <= 3; ++$opts) {
if ($opts != $opt_fkeys) {
read_part(nameof_fkeys($opts));
generate_fkeys($opts);
}
}
}
make_ckey_names();
make_ekey_names();
printf "# gen-pc-fkeys.pl\n";
printf "# %s:timode\n", "vile";
show_default();
show_nondefault();
xterm-297/xterm.man 0000644 0001751 0000144 00000701426 12213601331 013111 0 ustar tom users '\" t
.\" $XTermId: xterm.man,v 1.570 2013/09/10 11:30:33 tom Exp $
.\"
.\" Copyright 1996-2012,2013 by Thomas E. Dickey
.\"
.\" All Rights Reserved
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the
.\" "Software"), to deal in the Software without restriction, including
.\" without limitation the rights to use, copy, modify, merge, publish,
.\" distribute, sublicense, and/or sell copies of the Software, and to
.\" permit persons to whom the Software is furnished to do so, subject to
.\" the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
.\" CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
.\" TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
.\" SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name(s) of the above copyright
.\" holders shall not be used in advertising or otherwise to promote the
.\" sale, use or other dealings in this Software without prior written
.\" authorization.
.\"
.\"
.\" Copyright 1989 The Open Group
.\"
.\" Permission to use, copy, modify, distribute, and sell this software and its
.\" documentation for any purpose is hereby granted without fee, provided that
.\" the above copyright notice appear in all copies and that both that
.\" copyright notice and this permission notice appear in supporting
.\" documentation.
.\"
.\" The above copyright notice and this permission notice shall be included
.\" in all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
.\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
.\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
.\" IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
.\" OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of The Open Group shall
.\" not be used in advertising or otherwise to promote the sale, use or
.\" other dealings in this Software without prior written authorization
.\" from The Open Group.
.\"
.\" updated by Thomas E. Dickey for XFree86, July 1996 - February 2006.
.\"
.ds N Xterm
.ds n xterm
.\"
.\" Bulleted paragraph
.de bP
.IP \(bu 4
..
.\" these would be fallbacks for DS/DE,
.\" but groff changed the meaning of the macros.
.de NS
.sp
.in +4
.nf
.ft C \" Courier
..
.de NE
.fi
.ft P
.in -4
..
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds AQ \(aq
.el .ds AQ '
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.TH XTERM 1 "__app_date__" "__app_version__" "X Window System"
.SH NAME
xterm \- terminal emulator for X
.SH SYNOPSIS
.B \*n
[\-\fItoolkitoption\fP ...] [\-\fIoption\fP ...] [\fIshell\fP]
.SH DESCRIPTION
The \fI\*n\fP program is a terminal emulator for the X Window System.
It provides DEC VT102/VT220 and selected features from higher-level
terminals such as VT320/VT420/VT520 (VTxxx).
It also provides Tektronix 4014 emulation
for programs that cannot use the window system directly.
If the underlying operating system supports
terminal resizing capabilities (for example, the SIGWINCH signal in systems
derived from 4.3bsd), \fI\*n\fP will use the facilities to notify programs
running in the window whenever it is resized.
.
.PP
The VTxxx and Tektronix 4014 terminals each have their own window so that you
can edit text in one and look at graphics in the other at the same time.
To maintain the correct aspect ratio (height/width), Tektronix graphics will
be restricted to the largest box with a 4014's aspect ratio that will fit in
the window.
This box is located in the upper left area of the window.
.
.PP
Although both windows may be displayed at the same time, one of them is
considered the \*(``active\*('' window for receiving keyboard input and terminal
output.
This is the window that contains the text cursor.
The active window can be chosen through escape sequences,
the \*(``VT Options\*('' menu in the VTxxx window, and the \*(``Tek Options\*(''
menu in the 4014 window.
.
.SH EMULATIONS
The VT102 emulation is fairly complete, but does not support
autorepeat.
Double-size characters are displayed properly if your font server supports
scalable fonts.
The VT220 emulation does not support soft fonts, it is otherwise complete.
.IR Termcap (5)
entries that work with
.I \*n
include
an optional platform-specific entry (\*(``__default_termname__\*(''),
\*(``xterm\*('',
\*(``vt102\*('',
\*(``vt100\*('',
\*(``ansi\*('' and
\*(``dumb\*(''.
.I \*n
automatically searches the termcap file in this order for these entries and then
sets the \*(``TERM\*('' and the \*(``TERMCAP\*('' environment variables.
You may also use \*(``vt220\*('', but must set the terminal emulation level
with the \fBdecTerminalID\fP resource.
(The \*(``TERMCAP\*('' environment variable is not set if \fI\*n\fP is linked
against a terminfo library, since the requisite information is not provided
by the termcap emulation of terminfo libraries).
.
.PP
Many of the special
.I \*n
features may be modified under program control
through a set of escape sequences different from the standard VT102 escape
sequences.
(See the
.I "Xterm Control Sequences"
document.)
.
.PP
The Tektronix 4014 emulation is also fairly good.
It supports 12-bit graphics addressing, scaled to the window size.
Four different font sizes and five different lines types are supported.
There is no write-through or defocused mode support.
The Tektronix text and graphics commands are recorded internally by
.I \*n
and may be written to a file by sending the COPY escape sequence (or through
the
.B Tektronix
menu; see below).
The name of the file will be
\*(``\fBCOPY\fIyyyy\fB\-\fIMM\fB\-\fIdd\fB.\fIhh\fB:\fImm\fB:\fIss\fR\*('', where
.IR yyyy ,
.IR MM ,
.IR dd ,
.IR hh ,
.I mm
and
.I ss
are the year, month, day, hour, minute and second when the COPY was performed
(the file is created in the directory
.I \*n
is started in, or the home directory for a login
.IR \*n ).
.
.PP
Not all of the features described in this manual are necessarily available in
this version of \fI\*n\fP.
Some (e.g., the non-VT220 extensions) are available
only if they were compiled in, though the most commonly-used are in the
default configuration.
.
.SH "OTHER FEATURES"
.I Xterm
automatically highlights the text cursor when the
pointer enters the window (selected) and unhighlights it when the pointer
leaves the window (unselected).
If the window is the focus window, then the text cursor is
highlighted no matter where the pointer is.
.
.PP
In VT102 mode, there are escape sequences to activate and deactivate
an alternate screen buffer, which is the same size as the display area
of the window.
When activated, the current screen is saved and replaced with the alternate
screen.
Saving of lines scrolled off the top of the window is disabled until the
normal screen is restored.
The
.IR termcap (5)
entry for
.I \*n
allows the visual editor
.IR vi (1)
to switch to the alternate screen for editing and to restore the screen
on exit.
A popup menu entry makes it simple to switch between the normal and
alternate screens for cut and paste.
.
.PP
In either VT102 or Tektronix mode, there are escape sequences to change the
name of the windows.
Additionally, in VT102 mode,
\fI\*n\fP implements the window-manipulation control
sequences from \fIdtterm\fP, such as resizing the window, setting its location
on the screen.
.
.PP
.I Xterm
allows character-based applications to receive mouse events (currently
button-press and release events, and button-motion events)
as keyboard control sequences.
See \fIXterm Control Sequences\fP for details.
.
.
.SH OPTIONS
The \fI\*n\fP terminal emulator
accepts the standard X Toolkit command line options as well as
many application-specific options.
If the option begins with a
.RB ` + '
instead of a
.RB ` \- ',
the option is restored to its default value.
The \fB\-version\fP and \fB\-help\fP options are interpreted even if \fI\*n\fP
cannot open the display, and are useful for testing and configuration scripts.
Along with \fB\-class\fP, they are checked before other options.
.TP 8
.B \-version
This causes \fI\*n\fP to print a version number to the standard output,
and then exit.
.TP 8
.B \-help
This causes \fI\*n\fP to print out a verbose message describing its options,
one per line.
The message is written to the standard output.
After printing the message, \fI\*n\fP exits.
\fI\*N\fP generates this message, sorting it and noting whether
a \*(``\fB\-\fR\fIoption\fP\*(''
or a \*(``\fB+\fR\fIoption\fP\*('' turns the feature on or off,
since some features historically have been one or the other.
\fI\*N\fP generates a concise help message (multiple options per line)
when an unknown option is used, e.g.,
.NS
\fB\*n \-z\fP
.NE
.PP
If the logic for a particular option such as logging is not compiled
into \fI\*n\fP, the help text for that option also is not displayed
by the \fB\-help\fP option.
.
.PP
One parameter (after all options) may be given.
That overrides \fI\*n\fP's built-in choice of shell program.
Normally \fI\*n\fP checks the SHELL variable.
If that is not set, \fI\*n\fP tries to use the shell program specified
in the password file.
If that is not set, \fI\*n\fP uses \fI/bin/sh\fP.
If the parameter is not a relative path, i.e.,
beginning with \*(``./\*('' or \*(``../\*('',
\fI\*n\fP looks for the file in the user's PATH.
In either case, it constructs an absolute path.
The \fB\-e\fP option cannot be used with this parameter since
it uses all parameters following the option.
.PP
The other options are used to control the appearance and behavior.
Not all options are necessarily configured into your copy of \fI\*n\fP:
.TP 8
.B \-132
Normally, the VT102 DECCOLM escape sequence that switches between 80 and
132 column mode is ignored.
This option causes the DECCOLM escape sequence to be recognized, and the
.I \*n
window will resize appropriately.
.TP 8
.B \-ah
This option indicates that
.I \*n
should always highlight the text cursor.
By default,
.I \*n
will display a hollow text cursor whenever the focus is lost or the
pointer leaves the window.
.TP 8
.B +ah
This option indicates that
.I \*n
should do text cursor highlighting based on focus.
.TP 8
.B \-ai
This option disables active icon support if that feature was compiled
into \fI\*n\fP.
This is equivalent to setting the \fIvt100\fP resource
\fBactiveIcon\fP to \*(``false\*(''.
.TP 8
.B +ai
This option enables active icon support if that feature was compiled
into \fI\*n\fP.
This is equivalent to setting the \fIvt100\fP resource
\fBactiveIcon\fP to \*(``true\*(''.
.TP 8
.B \-aw
This option indicates that auto-wraparound should be allowed.
This
allows the cursor to automatically wrap to the beginning of the next
line when it is at the rightmost position of a line and text is
output.
.TP 8
.B +aw
This option indicates that auto-wraparound should not be allowed.
.TP 8
.BI \-b " number"
This option specifies the size of the inner border (the distance between
the outer edge of the characters and the window border) in pixels.
That is the \fIvt100\fP \fIinternalBorder\fP resource.
The
default is \*(``2\*(''.
.TP 8
.B +bc
turn off text cursor blinking.
This overrides the \fBcursorBlink\fR resource.
.TP 8
.B \-bc
turn on text cursor blinking.
This overrides the \fBcursorBlink\fR resource.
.TP 8
.BI \-bcf " milliseconds"
set the amount of time text cursor is off when blinking via the
\fIcursorOffTime\fP resource.
.TP 8
.BI \-bcn " milliseconds"
set the amount of time text cursor is on when blinking via the
\fIcursorOffTime\fP resource.
.TP 8
.B "\-bdc"
Set the \fIvt100\fP resource \fBcolorBDMode\fR to \*(``false\*('',
disabling the display of characters with bold attribute as color
.TP 8
.B "+bdc"
Set the \fIvt100\fP resource \fBcolorBDMode\fR to \*(``true\*('',
enabling the display of characters with bold attribute as color
rather than bold
.TP 8
.B "\-cb"
Set the \fIvt100\fP resource \fBcutToBeginningOfLine\fP to \*(``false\*(''.
.TP 8
.B "+cb"
Set the \fIvt100\fP resource \fBcutToBeginningOfLine\fP to \*(``true\*(''.
.TP 8
.B "\-cc \fIcharacterclassrange\fP:\fIvalue\fP[,...]"
This sets classes indicated by the given ranges for using in selecting by
words.
See the section specifying character classes.
and discussion of the \fIcharClass\fP resource.
.TP 8
.B "\-cjk_width"
Set the \fBcjkWidth\fP resource to \*(``true\*(''.
When turned on, characters with East Asian Ambiguous (A) category in UTR 11
have a column width of 2.
Otherwise, they have a column width of 1.
This may be useful for some legacy CJK text
terminal-based programs assuming box drawings and others to have a column
width of 2.
It also should be turned on when you specify a TrueType
CJK double-width (bi-width/monospace) font either with \fB\-fa\fP at
the command line or \fBfaceName\fP resource.
The default is \*(``false\*(''
.TP 8
.B "+cjk_width"
Reset the \fBcjkWidth\fP resource.
.TP 8
.BI \-class " string"
This option allows you to override \fI\*n\fP's resource class.
Normally it is \*(``__default_class__\*('', but
can be set to another class such as \*(``U__default_class__\*('' to override selected resources.
.TP 8
.B "\-cm"
This option disables recognition of ANSI color-change escape sequences.
It sets the \fIcolorMode\fP resource to \*(``false\*(''.
.TP 8
.B "+cm"
This option enables recognition of ANSI color-change escape sequences.
This is the same as the \fIvt100\fP resource \fBcolorMode\fP.
.TP 8
.B "\-cn"
This option indicates that newlines should not be cut in line-mode
selections.
It sets the \fIcutNewline\fP resource to \*(``false\*(''.
.TP 8
.B +cn
This option indicates that newlines should be cut in line-mode selections.
It sets the \fIcutNewline\fP resource to \*(``true\*(''.
.TP 8
.BI \-cr " color"
This option specifies the color to use for text cursor.
The default is to
use the same foreground color that is used for text.
It sets the \fIcursorColor\fP resource according to the parameter.
.TP 8
.B \-cu
This option indicates that \fI\*n\fP should work around a bug in the
.IR more (1)
program that causes it
to incorrectly display lines that are exactly the width of the window and
are followed by a line beginning with a tab
(the leading tabs are not displayed).
This option is so named because it was originally thought to be a bug
in the
.IR curses (3x)
cursor motion package.
.TP 8
.B +cu
This option indicates that \fI\*n\fP should not work around the
.IR more (1)
bug mentioned above.
.TP 8
.B "\-dc"
This option disables the escape sequence to change dynamic colors:
the vt100 foreground and background colors,
its text cursor color,
the pointer cursor foreground and background colors,
the Tektronix emulator foreground and background colors,
its text cursor color
and highlight color.
The option sets the \fIdynamicColors\fP option to \*(``false\*(''.
.TP 8
.B "+dc"
This option enables the escape sequence to change dynamic colors.
The option sets the \fIdynamicColors\fP option to \*(``true\*(''.
.TP 8
.BI \-e " program \fP[ \fIarguments \fP.\|.\|. ]\fI"
This option specifies the program (and its command line arguments) to be
run in the \fI\*n\fP window.
It also sets the window title and icon
name to be the basename of the program being executed if neither \fI\-T\fP
nor \fI\-n\fP are given on the command line.
\fBThis must be the last option on the command line.\fP
.TP 8
.BI \-en " encoding"
This option determines the encoding on which \fI\*n\fP runs.
It sets the \fBlocale\fR resource.
Encodings other than UTF-8 are supported by using \fIluit\fR.
The \fB\-lc\fR option should be used instead of \fB\-en\fR for
systems with locale support.
.TP 8
.BI \-fb " font"
This option specifies a font to be used when displaying bold text.
It sets the \fBboldFont\fR resource.
.IP
This font must be the same height and width as the normal font, otherwise it is ignored.
If only one of the normal or bold fonts is specified, it will be used as the
normal font and the bold font will be produced by overstriking this font.
.IP
See also the discussion of \fBboldMode\fP and \fBalwaysBoldMode\fP resources.
.TP 8
.BI \-fa " pattern"
This option sets the pattern for fonts selected from the FreeType
library if support for that library was compiled into \fI\*n\fP.
This corresponds to the \fBfaceName\fP resource.
When a CJK
double-width font is specified, you also need to turn
on the \fBcjkWidth\fP resource.
.IP
See also the \fBrenderFont\fP resource,
which combines with this to determine whether FreeType fonts are
initially active.
.TP 8
.BI \-fbb
This option indicates that \fI\*n\fP should compare normal and bold fonts bounding
boxes to ensure they are compatible.
It sets the \fBfreeBoldBox\fP resource to \*(``false\*(''.
.TP 8
.BI +fbb
This option indicates that \fI\*n\fP should not compare normal and bold fonts bounding
boxes to ensure they are compatible.
It sets the \fBfreeBoldBox\fP resource to \*(``true\*(''.
.TP 8
.BI \-fbx
This option indicates that \fI\*n\fP should not assume that the
normal and bold fonts have VT100 line-drawing characters.
If any are missing, \fI\*n\fP will draw the characters directly.
It sets the \fBforceBoxChars\fP resource to \*(``false\*(''.
.TP 8
.BI +fbx
This option indicates that \fI\*n\fP should assume that the
normal and bold fonts have VT100 line-drawing characters.
It sets the \fBforceBoxChars\fP resource to \*(``true\*(''.
.TP 8
.BI \-fd " pattern"
This option sets the pattern for double-width fonts selected from the FreeType
library if support for that library was compiled into \fI\*n\fP.
This corresponds to the \fBfaceNameDoublesize\fP resource.
.TP 8
.BI \-fi " font"
This option sets the font for active icons if that feature was compiled
into \fI\*n\fP.
.IP
See also the discussion of the \fBiconFont\fP resource.
.TP 8
.BI \-fs " size"
This option sets the pointsize for fonts selected from the FreeType
library if support for that library was compiled into \fI\*n\fP.
This corresponds to the \fBfaceSize\fP resource.
.TP 8
.BI \-fullscreen
This option indicates that \fI\*n\fP should ask the window manager to
let it use the full-screen for display,
e.g., without window decorations.
It sets the \fBfullscreen\fP resource to \*(``true\*(''.
.TP 8
.BI +fullscreen
This option indicates that \fI\*n\fP should not ask the window manager to
let it use the full-screen for display.
It sets the \fBfullscreen\fP resource to \*(``false\*(''.
.TP 8
.B \-fw \fIfont\fP
This option specifies the font to be used for displaying wide text.
By default,
it will attempt to use a font twice as wide as the font that will be used to
draw normal text.
If no double-width font is found, it will improvise, by stretching
the normal font.
This corresponds to the \fBwideFont\fP resource.
.TP 8
.B \-fwb \fIfont\fP
This option specifies the font to be used for displaying bold wide text.
By default,
it will attempt to use a font twice as wide as the font that will be used to
draw bold text.
If no double-width font is found, it will improvise, by stretching
the bold font.
This corresponds to the \fBwideBoldFont\fP resource.
.TP 8
.B \-fx \fIfont\fP
This option specifies the font to be used for displaying the preedit string
in the \*(``OverTheSpot\*('' input method.
.IP
See also the discussion of the \fBximFont\fP resource.
.TP 8
.BI \-hc " color"
(see \fB\-selbg\fP).
.TP 8
.BI \-hf
This option indicates that HP Function Key escape codes should be generated
for function keys.
It sets the \fBhpFunctionKeys\fP resource to \*(``true\*(''.
.TP 8
.BI +hf
This option indicates that HP Function Key escape codes should not be generated
for function keys.
It sets the \fBhpFunctionKeys\fP resource to \*(``false\*(''.
.TP 8
.BI \-hm
Tells \fI\*n\fP to use
\fBhighlightTextColor\fP and \fBhighlightColor\fP
to override the reversed foreground/background colors in a selection.
It sets the \fBhighlightColorMode\fP resource to \*(``true\*(''.
.TP 8
.BI +hm
Tells \fI\*n\fP not to use
\fBhighlightTextColor\fP and \fBhighlightColor\fP
to override the reversed foreground/background colors in a selection.
It sets the \fBhighlightColorMode\fP resource to \*(``false\*(''.
.TP 8
.BI \-hold
Turn on the \fBhold\fP resource, i.e.,
\fI\*n\fP will not immediately destroy its window when the shell command completes.
It will wait until you use the window manager to destroy/kill the window, or
if you use the menu entries that send a signal, e.g., HUP or KILL.
.TP 8
.BI +hold
Turn off the \fBhold\fP resource, i.e.,
\fI\*n\fP will immediately destroy its window when the shell command completes.
.TP 8
.B \-ie
Turn on the \fBptyInitialErase\fP resource, i.e.,
use the pseudo-terminal's sense of the \fIstty\fP erase value.
.TP 8
.B +ie
Turn off the \fBptyInitialErase\fP resource, i.e.,
set the \fIstty\fP erase value using the \fBkb\fP string from the termcap entry as
a reference, if available.
.TP 8
.B \-im
Turn on the \fBuseInsertMode\fP resource,
which forces use of insert mode by adding appropriate entries to the TERMCAP
environment variable.
.TP 8
.B +im
Turn off the \fBuseInsertMode\fP resource.
.TP 8
.BI \-into " windowId"
Given an X window identifier (an integer, which can be hexadecimal,
octal or decimal according to whether it begins with "0x", "0" or neither),
\fI\*n\fP will reparent its top-level shell widget to that window.
This is used to embed \fI\*n\fP within other applications.
.IP
For instance, there are scripts for Tcl/Tk and Gtk which can be used
to demonstrate the feature.
When using Gtk, there is a limitation of that toolkit which requires
that \fI\*n\fP's \fBallowSendEvents\fP resource is enabled.
.TP 8
.B \-j
This option indicates that \fI\*n\fP should do jump scrolling.
It corresponds to the \fBjumpScroll\fP resource.
Normally,
text is scrolled one line at a time; this option allows \fI\*n\fP to move
multiple lines at a time so that it does not fall as far behind.
Its use is
strongly recommended since it makes \fI\*n\fP much faster when scanning
through large amounts of text.
The VT100 escape sequences for enabling and
disabling smooth scroll as well as the \*(``VT Options\*(''
menu can be used to turn this
feature on or off.
.TP 8
.B +j
This option indicates that \fI\*n\fP should not do jump scrolling.
.TP 8
.B \-k8
This option sets the \fBallowC1Printable\fP resource.
When \fBallowC1Printable\fP is set, \fI\*n\fP overrides the mapping
of C1 control characters (code 128-159) to treat them as printable.
.TP 8
.B +k8
This option resets the \fBallowC1Printable\fP resource.
.TP 8
.BI \-kt " keyboardtype"
This option sets the \fBkeyboardType\fP resource.
Possible values include:
\*(``unknown\*('',
\*(``default\*('',
\*(``hp\*('',
\*(``sco\*('',
\*(``sun\*('',
\*(``tcap\*('' and
\*(``vt220\*(''.
.IP
The value \*(``unknown\*('',
causes the corresponding resource to be ignored.
.IP
The value \*(``default\*('',
suppresses the associated resources
.BR hpFunctionKeys ,
.BR scoFunctionKeys ,
.BR sunFunctionKeys,
.BR tcapFunctionKeys
and
.BR sunKeyboard ,
using the Sun/PC keyboard layout.
.TP 8
.B \-l
Turn logging on.
Normally logging is not supported, due to security concerns.
Some versions of \fI\*n\fP may have logging enabled.
The logfile is written to the directory from which \fI\*n\fP is
invoked.
The filename is generated, of the form
.sp
XtermLog.\fIXXXXXX\fR
.sp
or
.sp
Xterm.log.\fIhostname.yyyy.mm.dd.hh.mm.ss.XXXXXX\fR
.sp
depending on how \fI\*n\fP was built.
.TP 8
.B +l
Turn logging off.
.TP 8
.B \-lc
Turn on support of various encodings according to the users'
locale setting, i.e., LC_ALL, LC_CTYPE, or LANG environment variables.
This is achieved by turning on UTF-8 mode and by invoking \fIluit\fR for
conversion between locale encodings and UTF-8.
(\fIluit\fR is not invoked in UTF-8 locales.)
This corresponds to the \fBlocale\fR resource.
.IP
The actual list of encodings which are supported is determined by \fIluit\fR.
Consult the \fIluit\fR manual page for further details.
.IP
See also the discussion of the \fB\-u8\fP option which supports UTF-8 locales.
.TP 8
.B +lc
Turn off support of automatic selection of locale encodings.
Conventional 8bit mode or, in UTF-8 locales or with \fB\-u8\fP option,
UTF-8 mode will be used.
.TP 8
.BI \-lcc " path"
File name for the encoding converter from/to locale encodings
and UTF-8 which is used with \fB\-lc\fP option or \fBlocale\fR resource.
This corresponds to the \fBlocaleFilter\fR resource.
.TP 8
.B \-leftbar
Force scrollbar to the left side of VT100 screen.
This is the default, unless you have set the rightScrollBar resource.
.TP 8
.BI \-lf " filename"
Specify the log-filename.
See the \fB\-l\fP option.
.TP 8
.B \-ls
This option indicates that the shell that is started in the \fI\*n\fP window
will be a login shell (i.e., the first character of argv[0] will be a dash,
indicating to the shell that it should read the user's .login or .profile).
.IP
The \fB\-ls\fP flag and the \fBloginShell\fP resource
are ignored if \fB\-e\fP is also given,
because \fI\*n\fP does not know how to make the shell
start the given command after whatever it does when it is a login
shell \- the user's shell of choice need not be a Bourne shell after all.
Also, \fI\*n\ \-e\fP is supposed to provide a consistent
functionality for other applications that need to start text-mode
programs in a window, and if \fBloginShell\fP were not ignored, the
result of ~/.profile might interfere with that.
.IP
If you do want the effect of \fB\-ls\fP and \fB\-e\fP simultaneously, you
may get away with something like
.NS 15
\*n \-e /bin/bash \-l \-c "my command here"
.NE
.IP
Finally, \fB\-ls\fP is not completely ignored,
because \fI\*n\ \-ls\ \-e\fP does write a \fI/etc/wtmp\fP entry
(if configured to do so),
whereas \fI\*n\ \-e\fP does not.
.TP 8
.B \-maximized
This option indicates that \fI\*n\fP should ask the window manager to
maximize its layout on startup.
This corresponds to the \fBmaximized\fP resource.
.IP
Maximizing is not the reverse of iconifying;
it is possible to do both with certain window managers.
.TP 8
.B +maximized
This option indicates that \fI\*n\fP should ask the window manager to
not maximize its layout on startup.
.TP 8
.B +ls
This option indicates that the shell that is started should not be a login
shell (i.e., it will be a normal \*(``subshell\*('').
.TP 8
.B \-mb
This option indicates that \fI\*n\fP should ring a margin bell when
the user types near the right end of a line.
.TP 8
.B +mb
This option indicates that margin bell should not be rung.
.TP 8
.BI \-mc " milliseconds"
This option specifies the maximum time between multi-click selections.
.TP 8
.B \-mesg
Turn off the \fBmessages\fP resource, i.e.,
disallow write access to the terminal.
.TP 8
.B +mesg
Turn on the \fBmessages\fP resource, i.e.,
allow write access to the terminal.
.TP 8
.B "\-mk_width"
Set the \fBmkWidth\fP resource to \*(``true\*(''.
This makes \fI\*n\fP use a built-in version of the wide-character width
calculation.
The default is \*(``false\*(''
.TP 8
.B "+mk_width"
Reset the \fBmkWidth\fP resource.
.TP 8
.BI \-ms " color"
This option specifies the color to be used for the pointer cursor.
The default
is to use the foreground color.
This sets the \fIpointerColor\fP resource.
.TP 8
.BI \-nb " number"
This option specifies the number of characters from the right end of a line
at which the margin bell, if enabled, will ring.
The default is \*(``10\*(''.
.TP 8
.B "\-nul"
This option disables the display of underlining.
.TP 8
.B "+nul"
This option enables the display of underlining.
.TP 8
.B \-pc
This option enables the PC-style use of bold colors (see boldColors
resource).
.TP 8
.B +pc
This option disables the PC-style use of bold colors.
.TP 8
.B \-pob
This option indicates that the window should be raised whenever a
Control-G is received.
.TP 8
.B +pob
This option indicates that the window should not be raised whenever a
Control-G is received.
.TP 8
.B \-rightbar
Force scrollbar to the right side of VT100 screen.
.TP 8
.B "\-rvc"
This option disables the display of characters with reverse attribute as color.
.TP 8
.B "+rvc"
This option enables the display of characters with reverse attribute as color.
.TP 8
.B \-rw
This option indicates that reverse-wraparound should be allowed.
This allows
the cursor to back up from the leftmost column of one line to the rightmost
column of the previous line.
This is very useful for editing long shell
command lines and is encouraged.
This option can be turned on and off from
the \*(``VT Options\*('' menu.
.TP 8
.B +rw
This option indicates that reverse-wraparound should not be allowed.
.TP 8
.B \-s
This option indicates that \fI\*n\fP may scroll asynchronously, meaning that
the screen does not have to be kept completely up to date while scrolling.
This allows \fI\*n\fP to run faster when network latencies are very high
and is typically useful when running across a very large internet or many
gateways.
.TP 8
.B +s
This option indicates that \fI\*n\fP should scroll synchronously.
.TP 8
.B \-samename
Does not send title and icon name change requests when the request
would have no effect: the name is not changed.
This has the advantage
of preventing flicker and the disadvantage of requiring an extra
round trip to the server to find out the previous value.
In practice
this should never be a problem.
.TP 8
.B +samename
Always send title and icon name change requests.
.TP 8
.B \-sb
This option indicates that some number of lines that are scrolled off the top
of the window should be saved and that a scrollbar should be displayed so that
those lines can be viewed.
This option may be turned on and off from the
\*(``VT Options\*('' menu.
.TP 8
.B +sb
This option indicates that a scrollbar should not be displayed.
.TP 8
.BI \-selbg " color"
This option specifies the color to use for the background of selected text.
If not specified, reverse video is used.
See the discussion of the \fBhighlightColor\fP resource.
.TP 8
.BI \-selfg " color"
This option specifies the color to use for selected text.
If not specified, reverse video is used.
See the discussion of the \fBhighlightTextColor\fP resource.
.TP 8
.B \-sf
This option indicates that Sun Function Key escape codes should be generated
for function keys.
.TP 8
.B +sf
This option indicates that the standard escape codes should be generated for
function keys.
.TP 8
.BI \-sh " number"
scale line-height values by the given number.
See the discussion of the \fBscaleHeight\fP resource.
.TP 8
.B \-si
This option indicates that output to a window should not automatically
reposition the screen to the bottom of the scrolling region.
This option can be turned on and off from the \*(``VT Options\*('' menu.
.TP 8
.B +si
This option indicates that output to a window should cause it to
scroll to the bottom.
.TP 8
.B \-sk
This option indicates that pressing a key while
using the scrollbar to review previous lines of text should
cause the window to be repositioned automatically in the normal position at the
bottom of the scroll region.
.TP 8
.B +sk
This option indicates that pressing a key while using the scrollbar
should not cause the window to be repositioned.
.TP 8
.BI \-sl " number"
This option specifies the number of lines to save that have been scrolled
off the top of the screen.
This corresponds to the \fBsaveLines\fP resource.
The default is \*(``64\*(''.
.TP 8
.B \-sm
This option, corresponding to the \fBsessionMgt\fR resource,
indicates that \fI\*n\fR should
set up session manager callbacks.
.TP 8
.B +sm
This option indicates that \fI\*n\fR should
not set up session manager callbacks.
.TP 8
.B \-sp
This option indicates that Sun/PC keyboard should be assumed,
providing mapping for keypad \*(``+' to \*(``,', and
CTRL-F1 to F13, CTRL-F2 to F14, etc.
.TP 8
.B +sp
This option indicates that the standard escape codes should be generated for
keypad and function keys.
.TP 8
.B \-t
This option indicates that \fI\*n\fP should start in Tektronix mode, rather
than in VT102 mode.
Switching between the two windows is done using the
\*(``Options\*('' menus.
.IR Termcap (5)
entries that work with
.I \*n
\*(``tek4014\*('',
\*(``tek4015\*('',
\*(``tek4012\*('',
\*(``tek4013\*('',
\*(``tek4010\*('', and
\*(``dumb\*(''.
.I \*n
automatically searches the termcap file in this order for these entries and then
sets the \*(``TERM\*('' and the \*(``TERMCAP\*('' environment variables.
.TP 8
.B +t
This option indicates that \fI\*n\fP should start in VT102 mode.
.TP 8
.B \-tb
This option, corresponding to the \fBtoolBar\fR resource,
indicates that \fI\*n\fR should display a toolbar (or menubar)
at the top of its window.
The buttons in the toolbar correspond to
the popup menus, e.g., control/left/mouse for \*(``Main Options\*(''.
.TP 8
.B +tb
This option indicates that \fI\*n\fR should
not set up a toolbar.
.TP 8
.BI \-ti " term_id"
Specify the name used by \fI\*n\fP to select the
correct response to terminal ID queries.
It also specifies the emulation level,
used to determine the type of response to a DA control sequence.
Valid values include vt52, vt100, vt101, vt102, vt220, and vt240
(the \*(``vt\*('' is optional).
The default is \*(``vt__default_termid__\*(''.
The term_id argument specifies the terminal ID to use.
(This is the same as the \fBdecTerminalID\fP resource).
.TP 8
.BI \-tm " string"
This option specifies a series of terminal setting keywords followed by the
characters that should be bound to those functions, similar to the \fIstty\fP
program.
The keywords and their values are described in detail in the \fBttyModes\fP
resource.
.TP 8
.BI \-tn " name"
This option specifies the name of the terminal type to be set in the TERM
environment variable.
It corresponds to the \fBtermName\fP resource.
This terminal type must exist in the terminal
database
(termcap or terminfo, depending on how \fI\*n\fP is built)
and should have \fIli#\fP and \fIco#\fP entries.
If the terminal type is not found, \fI\*n\fP uses the built-in list
\*(``xterm\*('', \*(``vt102\*('', etc.
.TP 8
.B \-u8
This option sets the \fButf8\fP resource.
When \fButf8\fP is set, \fI\*n\fP interprets incoming data as UTF-8.
This sets the \fBwideChars\fP resource as a side-effect,
but the UTF-8 mode set by this option prevents it from being turned off.
If you must turn it on and off, use the \fBwideChars\fP resource.
.IP
This option and the \fButf8\fR resource are overridden by
the \fB\-lc\fP and \fB\-en\fP options and \fBlocale\fR resource.
That is, if \fI\*n\fP has been compiled to support \fIluit\fR,
and the \fBlocale\fP resource is not \*(``false\*(''
this option is ignored.
We recommend using
the \fB\-lc\fR option or the \*(``\fBlocale:\ true\fR\*('' resource
in UTF-8 locales when your operating system supports locale,
or \fB\-en\ UTF-8\fP option or the \*(``\fBlocale:\ UTF-8\fR\*('' resource
when your operating system does not support locale.
.TP 8
.B +u8
This option resets the \fButf8\fP resource.
.TP 8
.B "\-uc"
This option makes the cursor underlined instead of a box.
.TP 8
.B "+uc"
This option makes the cursor a box instead of underlined.
.TP 8
.B "\-ulc"
This option disables the display of characters with underline attribute as
color rather than with underlining.
.TP 8
.B "+ulc"
This option enables the display of characters with underline attribute as
color rather than with underlining.
.TP 8
.B "\-ulit"
This option, corresponding to the \fBitalicULMode\fP resource,
disables the display of characters with underline attribute as
italics rather than with underlining.
.TP 8
.B "+ulit"
This option, corresponding to the \fBitalicULMode\fP resource,
enables the display of characters with underline attribute as
italics rather than with underlining.
.TP 8
.B \-ut
This option indicates that \fI\*n\fP should not write a record into the
the system \fIutmp\fP log file.
.TP 8
.B +ut
This option indicates that \fI\*n\fP should write a record into
the system \fIutmp\fP log file.
.TP 8
.B \-vb
This option indicates that a visual bell is preferred over an audible one.
Instead of ringing the terminal bell whenever a Control-G is received, the
window will be flashed.
.TP 8
.B +vb
This option indicates that a visual bell should not be used.
.TP 8
.B \-wc
This option sets the \fBwideChars\fP resource.
When \fBwideChars\fP is set, \fI\*n\fP maintains internal structures for 16-bit
characters.
If you do not set this resource to \*(``true\*('',
\fI\*n\fP will ignore the escape sequence which turns UTF-8 mode on and off.
The default is \*(``false\*(''.
.TP 8
.B +wc
This option resets the \fBwideChars\fP resource.
.TP 8
.B \-wf
This option indicates that \fI\*n\fP should wait for the window to be mapped
the first time before starting the subprocess so that the initial terminal
size settings and environment variables are correct.
It is the application's
responsibility to catch subsequent terminal size changes.
.TP 8
.B +wf
This option indicates that \fI\*n\fP should not wait before starting the
subprocess.
.TP 8
.B \-ziconbeep \fIpercent\fP
Same as \fBzIconBeep\fP resource.
If percent is non-zero, xterms that produce output while iconified
will cause an XBell sound at the given volume
and have \*(``***\*('' prepended to their icon titles.
Most window managers will detect this change immediately, showing you
which window has the output.
(A similar feature was in x10 \fI\*n\fP.)
.TP 8
.B \-C
This option indicates that this window should receive console output.
This
is not supported on all systems.
To obtain console output, you must be the
owner of the console device, and you must have read and write permission
for it.
If you are running X under \fIxdm\fP on the console screen you may
need to have the session startup and reset programs explicitly change the
ownership of the console device in order to get this option to work.
.TP 8
.B \-S\fIccn\fP
This option allows \fI\*n\fP to be used as an input and
output channel for an existing program and is sometimes used in specialized
applications.
The option value specifies the last few letters of the name of a pseudo-terminal
to use in slave mode, plus the number of the inherited file descriptor.
If the option contains a \*(``/\*('' character, that delimits the characters
used for the pseudo-terminal name from the file descriptor.
Otherwise, exactly two characters are used from the option for
the pseudo-terminal name, the remainder is the file descriptor.
Examples
(the first two are equivalent
since the descriptor follows the last \*(``/\*(''):
.NS 15
-S/dev/pts/123/45
-S123/45
-Sab34
.NE
.IP
Note that \fI\*n\fP does not close any file descriptor
which it did not open for its own use.
It is possible (though probably not portable) to have an application
which passes an open file descriptor down to \fI\*n\fP past the
initialization or the \fB\-S\fP option to a process running in the \fI\*n\fP.
.SS OLD OPTIONS
.PP
The following command line arguments are provided for compatibility with
older versions.
They may not be supported in the next release as the X
Toolkit provides standard options that accomplish the same task.
.TP 8
.B "%\fIgeom\fP"
This option specifies the preferred size and position of the Tektronix window.
It is shorthand for specifying the \*(``\fI*tekGeometry\fP\*('' resource.
.TP 8
.B "#\fIgeom\fP"
This option specifies the preferred position of the icon window.
It is shorthand for specifying the \*(``\fI*iconGeometry\fP\*('' resource.
.TP 8
.BI \-T " string"
This option specifies the title for \fI\*n\fP's windows.
It is equivalent to \fB\-title\fP.
.TP 8
.BI \-n " string"
This option specifies the icon name for \fI\*n\fP's windows.
It is shorthand for specifying the \*(``\fI*iconName\fP\*('' resource.
Note that this is not the same as the toolkit option \fB\-name\fP (see below).
The default icon name is the application name.
.IP
If no suitable icon is found, \fI\*n\fP provides a compiled-in pixmap.
.TP 8
.B \-r
This option indicates that reverse video should be simulated by swapping
the foreground and background colors.
It is equivalent to
\fB\-rv\fP.
.TP 8
.BI \-w " number"
This option specifies the width in pixels of the border surrounding the window.
It is equivalent to \fB\-borderwidth\fP or \fB\-bw\fP.
.
.SS X TOOLKIT OPTIONS
.PP
The following standard X Toolkit command line arguments are commonly used
with \fI\*n\fP:
.TP 8
.B \-bd \fIcolor\fP
This option specifies the color to use for the border of the window.
The corresponding resource name is \fIborderColor\fP.
\fI\*n\fP uses the X Toolkit default, which is \*(``XtDefaultForeground\*(''.
.TP 8
.B \-bg \fIcolor\fP
This option specifies the color to use for the background of the window.
The corresponding resource name is \fIbackground\fP.
The default is \*(``XtDefaultBackground\*(''.
.TP 8
.B \-bw \fInumber\fP
This option specifies the width in pixels of the border surrounding the window.
.IP
This appears to be a legacy of older X releases.
It sets the \fBborderWidth\fP resource of the shell widget,
and may provide advice to your window manager to set the thickness of the
window frame.
Most window managers do not use this information.
See the \fB\-b\fP option, which controls the inner border of the \fI\*n\fP
window.
.TP 8
.B \-display \fIdisplay\fP
This option specifies the X server to contact; see \fIX(__miscmansuffix__)\fP.
.TP 8
.B \-fg \fIcolor\fP
This option specifies the color to use for displaying text.
The corresponding resource name is \fIforeground\fP.
The default is
\*(``XtDefaultForeground\*(''.
.TP 8
.B \-fn \fIfont\fP
This option specifies the font to be used for displaying normal text.
The corresponding resource name is \fIfont\fP.
The resource value default is \fIfixed\fP.
.TP 8
.B \-font \fIfont\fP
This is the same as \fB\-fn\fP.
.TP 8
.B \-geometry \fIgeometry\fP
This option specifies the preferred size and position of the VT102 window;
see \fIX(__miscmansuffix__)\fP.
.TP 8
.B \-iconic
This option indicates that \fI\*n\fP should ask the window manager to
start it as an icon rather than as the normal window.
The corresponding resource name is \fIiconic\fP.
.TP 8
.B \-name \fIname\fP
This option specifies the application name under which resources are to be
obtained, rather than the default executable file name.
\fIName\fP should not contain \*(``.\*('' or \*(``*\*('' characters.
.TP 8
.B \-rv
This option indicates that reverse video should be simulated by swapping
the foreground and background colors.
The corresponding resource name is \fIreverseVideo\fP.
.TP 8
.B +rv
Disable the simulation of reverse video by swapping foreground and background
colors.
.TP 8
.B \-title \fIstring\fP
This option specifies the window title string, which may be displayed by
window managers if the user so chooses.
The default title is the command
line specified after the \fB\-e\fP option, if any, otherwise the application
name.
.TP 8
.B \-xrm \fIresourcestring\fP
This option specifies a resource string to be used.
This is especially
useful for setting resources that do not have separate command line options.
.
.
.SH RESOURCES
The program understands all of the core X Toolkit resource names and classes.
Application specific resources (e.g., \*(``\fB__default_class__.\fP\fINAME\fP\*('') follow:
.TP 8
.B "backarrowKeyIsErase (\fPclass\fB BackarrowKeyIsErase)"
Tie the VTxxx \fBbackarrowKey\fP and \fBptyInitialErase\fP resources
together by setting the DECBKM state according to whether the initial value of
\fIstty\fP erase is a backspace (8) or delete (127) character.
A \*(``false\*('' value disables this feature.
The default is \*(``__backarrow_is_erase__\*(''.
.TP 8
.B "fullscreen (\fPclass\fB Fullscreen)"
Specifies whether or not \fI\*n\fP should ask the window manager to
use a fullscreen layout on startup.
\fI\*N\fP accepts either a keyword (ignoring case)
or the number shown in parentheses:
.RS
.TP 3
false (0)
Fullscreen layout is not used initially,
but may be later via menu-selection or control sequence.
.TP 3
true (1)
Fullscreen layout is used initially,
but may be disabled later via menu-selection or control sequence.
.TP 3
always (2)
Fullscreen layout is used initially,
and cannot be disabled later via menu-selection or control sequence.
.TP 3
never (3)
Fullscreen layout is not used,
and cannot be enabled later via menu-selection or control sequence.
.RE
.IP
The default is
\*(``false\*(''.
.TP 8
.B "hold (\fPclass\fB Hold)"
If true,
\fI\*n\fP will not immediately destroy its window when the shell command completes.
It will wait until you use the window manager to destroy/kill the window, or
if you use the menu entries that send a signal, e.g., HUP or KILL.
You may scroll back, select text, etc., to perform most graphical operations.
Resizing the display will lose data, however, since this involves interaction
with the shell which is no longer running.
.TP 8
.B "hpFunctionKeys (\fPclass\fB HpFunctionKeys)"
Specifies whether or not HP Function Key escape codes should be generated for
function keys instead of standard escape sequences.
.IP
See also the \fBkeyboardType\fP resource.
.TP 8
.B "iconGeometry (\fPclass\fB IconGeometry)"
Specifies the preferred size and position of the application when iconified.
It is not necessarily obeyed by all window managers.
.TP 8
.B "iconHint (\fPclass\fB IconHint)"
Specifies a icon which will be added to the window manager hints.
\fI\*n\fP provides no default value.
.IP
Set this resource to \*(``none\*('' to omit the hint entirely,
using whatever the window manager may decide.
.IP
If the \fBiconHint\fP resource is given (or is set via the \fB\-n\fP option)
\fI\*n\fP searches for a pixmap file with that name,
in the current directory as well as in __pixmapsdir__.
if the resource does not specify an absolute pathname.
In each case, \fI\*n\fP adds \*(``_48x48\*(''
and/or \*(``.xpm\*('' to the filename
after trying without those suffixes.
If it is able to load the file, \fI\*n\fP sets the window manager
hint for the icon-pixmap.
These pixmaps are distributed with \fI\*n\fP, and can optionally be
compiled-in:
.RS
.bP
mini.\*n_16x16,
mini.\*n_32x32,
mini.\*n_48x48
.bP
filled-\*n_16x16
filled-\*n_32x32
filled-\*n_48x48
.bP
\*n_16x16
\*n_32x32
\*n_48x48
.bP
\*n-color_16x16
\*n-color_32x32
\*n-color_48x48
.RE
.IP
In either case, \fI\*n\fP allows for adding a \*(``_48x48\*('' to specify the
largest of the pixmaps as a default.
That is, \*(``mini.\*n\*('' is the same as \*(``mini.\*n_48x48\*(''.
.IP
If no explicit \fBiconHint\fP resource is given
(or if none of the compiled-in names matches),
\*n uses \*(``mini.\*n\*('' (which is always compiled-in).
.IP
The \fBiconHint\fP resource has no effect on \*(``desktop\*('' files,
including \*(``panel\*('' and \*(``menu\*(''.
Those are typically set via a \*(``.desktop\*('' file;
\fI\*n\fP provides samples for itself (and the \fIu\*n\fP script).
The more capable desktop systems allow changing the icon on a per-user basis.
.TP 8
.B "iconName (\fPclass\fB IconName)"
Specifies a label for \fI\*n\fP when iconified.
\fI\*n\fP provides no default value;
some window managers may assume the application name, e.g., \*(``\*n\*(''.
.IP
Setting the \fBiconName\fP resource sets the icon label
unless overridden by \fBzIconBeep\fP
or the control sequences which change the window and icon labels.
.TP 8
.B "keyboardType (\fPclass\fB KeyboardType)"
Enables one (or none) of the various keyboard-type resources:
\fBhpFunctionKeys\fP,
\fBscoFunctionKeys\fP,
\fBsunFunctionKeys\fP,
\fBtcapFunctionKeys\fP and
\fBsunKeyboard\fP.
The resource's value should be one of the corresponding strings
\*(``hp\*('',
\*(``sco\*('',
\*(``sun\*('',
\*(``tcap\*('' or
\*(``vt220\*(''.
The individual resources are provided for legacy support;
this resource is simpler to use.
.IP
The default is
\*(``unknown\*('', i.e., none of the associated resources are set
via this resource.
.TP 8
.B "maxBufSize (\fPclass\fB MaxBufSize)"
Specify the maximum size of the input buffer.
The default is \*(``32768\*(''.
You cannot set this to a value less than the \fBminBufSize\fR resource.
It will be increased as needed to make that value evenly divide this one.
.IP
On some systems you may want to increase one or both of the
\fBmaxBufSize\fP and
\fBminBufSize\fP resource values to achieve better performance
if the operating system prefers larger buffer sizes.
.TP 8
.B "maximized (\fPclass\fB Maximized)"
Specifies whether or not \fI\*n\fP should ask the window manager to
maximize its layout on startup.
The default is
\*(``false\*(''.
.TP 8
.B "messages (\fPclass\fB Messages)"
Specifies whether write access to the terminal is allowed initially.
See
.BR mesg (1).
The default is \*(``true\*(''.
.TP 8
.B "menuLocale (\fPclass\fB MenuLocale)"
Specify the locale used for character-set computations when loading
the popup menus.
Use this to improve initialization performance of the Athena popup menus,
which may load unnecessary (and very large) fonts, e.g.,
in a locale having UTF-8 encoding.
The default is \*(``C\*('' (POSIX).
.IP
To use the current locale
(only useful if you have localized the resource settings for the menu entries),
set the resource to an empty string.
.TP 8
.B "minBufSize (\fPclass\fB MinBufSize)"
Specify the minimum size of the input buffer, i.e., the amount of data
that \fI\*n\fR requests on each read.
The default is \*(``4096\*(''.
You cannot set this to a value less than 64.
.TP 8
.B "omitTranslation (\fPclass\fB OmitTranslation)"
Selectively omit one or more parts of \fI\*n\fP's default translations
at startup.
The resource value is a comma-separated list of keywords,
which may be abbreviated:
\*(``fullscreen\*('',
\*(``scroll-lock\*('',
\*(``shift-fonts\*('' or
\*(``wheel-mouse\*(''.
\fI\*N\fP also recognizes \*(``default\*('',
but omitting that will make the program unusable
unless you provide a similar definition in your resource settings.
.TP 8
.B "ptyHandshake (\fPclass\fB PtyHandshake)
If \*(``true\*('', \fI\*n\fP will perform handshaking during initialization
to ensure that the parent and child processes update the \fIutmp\fP
and \fIstty\fP state.
.IP
See also \fBwaitForMap\fP which waits for the pseudo-terminal's notion
of the screen size,
and \fBptySttySize\fP which resets the screen size after other terminal
initialization is complete.
The default is \*(``true\*(''.
.TP 8
.B "ptyInitialErase (\fPclass\fB PtyInitialErase)"
If \*(``true\*('', \fI\*n\fP will use the pseudo-terminal's sense of the \fIstty\fP erase
value.
If \*(``false\*('', \fI\*n\fP will set the \fIstty\fP erase value to match its own
configuration, using the \fBkb\fP string from the termcap entry as
a reference, if available.
In either case, the result is applied to the TERMCAP variable
which \fI\*n\fP sets.
.IP
See also the \fBttyModes\fP resource, which may modify this.
The default is \*(``false\*(''.
.TP 8
.B "ptySttySize (\fPclass\fB PtySttySize)
If \*(``true\*('', \fI\*n\fP will reset the screen size after
terminal initialization is complete.
This is needed for some systems whose pseudo-terminals cannot
propagate terminal characteristics.
Where it is not needed, it can interfere with other methods for
setting the intial screen size, e.g., via window manager interaction.
.IP
See also \fBwaitForMap\fP which waits for a handshake-message
giving the pseudo-terminal's notion of the screen size.
The default is \*(``false\*('' on Linux and OS X systems,
\*(``true\*('' otherwise.
.TP 8
.B "sameName (\fPclass\fB SameName)"
If the value of this resource is \*(``true\*('', \fI\*n\fP does not send
title and icon name change requests when the request
would have no effect: the name is not changed.
This has the advantage
of preventing flicker and the disadvantage of requiring an extra
round trip to the server to find out the previous value.
In practice
this should never be a problem.
The default is \*(``true\*(''.
.TP 8
.B "scaleHeight (\fPclass\fB ScaleHeight)"
Scale line-height values by the resource value,
which is limited to \*(``0.9\*('' to \*(``1.5\*(''.
The default value is \*(``1.0\*('',
.IP
While this resource applies to either bitmap or TrueType fonts,
its main purpose is to
help work around incompatible changes in the Xft library's font metrics.
\fI\*N\fP checks the font metrics to find what the library claims are
the bounding boxes for each glyph (character).
However, some of Xft's features (such as the autohinter) can cause the
glyphs to be scaled larger than the bounding boxes, and be partly overwritten
by the next row.
.IP
See \fBuseClipping\fP for a related resource.
.TP 8
.B "scoFunctionKeys (\fPclass\fB ScoFunctionKeys)"
Specifies whether or not SCO Function Key escape codes should be generated for
function keys instead of standard escape sequences.
.IP
See also the \fBkeyboardType\fP resource.
.TP 8
.B "sessionMgt (\fPclass\fB SessionMgt)"
If the value of this resource is \*(``true\*('',
\fI\*n\fP sets up session manager callbacks
for \fBXtNdieCallback\fR and \fBXtNsaveCallback\fR.
The default is \*(``true\*(''.
.TP 8
.B "sunFunctionKeys (\fPclass\fB SunFunctionKeys)"
Specifies whether or not Sun Function Key escape codes should be generated for
function keys instead of standard escape sequences.
.IP
See also the \fBkeyboardType\fP resource.
.TP 8
.B "sunKeyboard (\fPclass\fB SunKeyboard)"
Specifies whether or not Sun/PC keyboard layout should be assumed rather
than DEC VT220.
This causes the keypad \*(``+' to be mapped to \*(``,'.
and
CTRL F1-F12 to F11-F20, depending on the setting of the \fBctrlFKeys\fP
resource.
so \fI\*n\fP emulates a DEC VT220 more accurately.
Otherwise (the default, with \fBsunKeyboard\fP set to \*(``false\*(''),
\fI\*n\fP uses PC-style bindings for the function keys and keypad.
.IP
PC-style bindings
use the Shift, Alt, Control and Meta keys as modifiers for function-keys
and keypad
(see the document \fIXterm Control Sequences\fP for details).
The PC-style bindings are analogous to PCTerm, but not the same thing.
Normally these bindings do not conflict with the use of the Meta key
as described for the \fBeightBitInput\fP resource.
If they do, note that the PC-style bindings are evaluated first.
.IP
See also the \fBkeyboardType\fP resource.
.TP 8
.B "tcapFunctionKeys (\fPclass\fB TcapFunctionKeys)"
Specifies whether or not function key escape codes read from the
termcap/terminfo entry should be generated for
function keys instead of standard escape sequences.
The default is
\*(``false\*('', i.e., this feature is disabled.
.IP
See also the \fBkeyboardType\fP resource.
.TP 8
.B "termName (\fPclass\fB TermName)"
Specifies the terminal type name to be set in the TERM environment variable.
.TP 8
.B "title (\fPclass\fB Title)"
Specifies a string that may be used by the window manager when displaying
this application.
.TP 8
.B "toolBar (\fPclass\fB ToolBar)"
Specifies whether or not the toolbar should be displayed.
The default is
\*(``true\*(''.
.TP 8
.B "ttyModes (\fPclass\fB TtyModes)"
Specifies a string containing terminal setting keywords and the characters
to which they may be bound.
Allowable keywords include:
brk,
dsusp,
eof,
eol,
eol2,
erase,
erase2,
flush,
intr,
kill,
lnext,
quit,
rprnt,
start,
status,
stop,
susp,
swtch and
weras.
Control characters may be specified as ^char (e.g., ^c or ^u)
and \fB^?\fP may be used to indicate delete (127).
Use \fB^\-\fP to denote \fIundef\fP.
Use \fB\\034\fP to represent \fB^\\\fP, since a literal backslash in
an X resource escapes the next character.
.IP
This is very useful for overriding
the default terminal settings without having to do an \fIstty\fP every time
an \fI\*n\fP is started.
Note, however, that the \fIstty\fP program on a given host may use different
keywords; \fI\*n\fR's table is built-in.
.IP
If the \fBttyModes\fP resource specifies a value for \fBerase\fP,
that overrides the \fBptyInitialErase\fP resource setting,
i.e., \fI\*n\fP initializes the terminal to match that value.
.TP 8
.B "useInsertMode (\fPclass\fB UseInsertMode)"
Force use of insert mode by adding appropriate entries to the TERMCAP
environment variable.
This is useful if the system termcap is broken.
The default is \*(``false\*(''.
.TP 8
.B "utmpDisplayId (\fPclass\fB UtmpDisplayId)"
Specifies whether or not \fI\*n\fP should try to record the display
identifier (display number and screen number) as well as the hostname in
the system \fIutmp\fP log file.
The default is \*(``true\*(''.
.TP 8
.B "utmpInhibit (\fPclass\fB UtmpInhibit)"
Specifies whether or not \fI\*n\fP should try to record the user's terminal
in
the system \fIutmp\fP log file.
If true, \fI\*n\fP will not try.
The default is \*(``false\*(''.
.TP 8
.B "waitForMap (\fPclass\fB WaitForMap)"
Specifies whether or not \fI\*n\fP should wait for the initial window map
before starting the subprocess.
This is part of the
.B ptyHandshake
logic.
When \fI\*n\fP is directed to wait in this fashion,
it passes the terminal size from the display end of the pseudo-terminal
to the terminal I/O connection, e.g., according to the window manager.
Otherwise, it uses the size as given in resource values or command-line
option \fB\-geom\fP.
The default is \*(``false\*(''.
.TP 8
.B "zIconBeep (\fPclass\fB ZIconBeep)"
Same as \-ziconbeep command line argument.
If the value of this resource is non-zero, xterms that produce output
while iconified will cause an XBell sound at the given volume
and have \*(``***\ \*('' prepended to their icon titles.
Most window managers will detect this change immediately, showing you
which window has the output.
(A similar feature was in x10 \fI\*n\fR.)
The default is \*(``false\*(''.
.TP 8
.B "zIconTitleFormat (\fPclass\fB ZIconTitleFormat)"
Allow customization of the string used in the \fBzIconBeep\fP feature.
The default value is \*(``***\ %s\*(''.
.IP
If the resource value contains a \*(``%s\*('',
then \fI\*n\fP inserts the icon title at that point rather
than prepending the string to the icon title.
(Only the first \*(``%s\*('' is used).
.\"
.SS VT100 Widget Resources
.PP
The following resources are specified as part
of the \fIvt100\fP widget (class \fIVT100\fP).
They are specified by patterns such as \*(``\fB__default_class__.vt100.\fP\fINAME\fP\*(''.
.PP
If your \fI\*n\fP is configured to support the \*(``toolbar\*('', then those
patterns need an extra level for the form-widget which holds the
toolbar and vt100 widget.
A wildcard between the top-level
\*(``__default_class__\*('' and the \*(``vt100\*('' widget makes the resource settings work for
either, e.g., \*(``\fB__default_class__*vt100.\fP\fINAME\fP\*(''.
.TP 8
.B "activeIcon (\fPclass\fB ActiveIcon)"
Specifies whether or not active icon windows are to be used when the
\fI\*n\fP window is iconified, if this feature is compiled into \fI\*n\fR.
The active icon is a miniature representation of the content of the
window and will update as the content changes.
Not all window managers necessarily support application icon windows.
Some window managers
will allow you to enter keystrokes into the active icon window.
The default is \*(``default\*(''.
.IP
\fI\*N\fP accepts either a keyword (ignoring case)
or the number shown in parentheses:
.RS
.TP
false (0)
No active icon is shown.
.TP
true (1)
The active icon is shown.
If you are using \fItwm\fP, use this setting to enable active-icons.
.TP
default (2)
\fI\*n\fP checks at startup, and shows an active icon only for window
managers which it can identify and which are known to support the feature.
These are \fIfvwm\fP (full support), and \fIwindow maker\fP (limited).
A few other windows managers (such as \fItwm\fP and \fIctwm\fP)
support active icons,
but do not support the extensions which allow \fI\*n\fP
to identify the window manager.
.RE
.TP 8
.B "allowBoldFonts (\fPclass\fB AllowBoldFonts)"
When set to \*(``false\*('', \fI\*n\fP will not use bold fonts.
This overrides both the \fBalwaysBoldMode\fP and the \fBboldMode\fP resources.
.B "alwaysBoldMode (\fPclass\fB AlwaysBoldMode)"
.TP 8
.B "allowC1Printable (\fPclass\fB AllowC1Printable)"
If true, overrides the mapping of C1 controls
(codes 128-159) to make them be treated
as if they were printable characters.
Although this corresponds to no particular standard,
some users insist it is a VT100.
The default is \*(``false\*(''.
.TP
.B "allowColorOps (\fPclass\fB AllowColorOps)"
Specifies whether control sequences that set/query the dynamic colors should be allowed.
ANSI colors are unaffected by this resource setting.
The default is \*(``true\*(''.
.TP
.B "allowFontOps (\fPclass\fB AllowFontOps)"
Specifies whether control sequences that set/query the font should be allowed.
The default is \*(``true\*(''.
.TP 5
.B "allowPasteControls (\fPclass\fB AllowPasteControls)"
If true, allow control characters such as BEL and CAN to be pasted.
Formatting characters (tab, newline) are always allowed.
Other C0 control characters are suppressed unless this resource is enabled.
The exact set of control characters (C0 and C1)
depends upon whether UTF-8 encoding is used,
as well as the \fBallowC1Printable\fP resource.
The default is \*(``false\*(''.
.TP 8
.B "allowScrollLock (\fPclass\fB AllowScrollLock)"
Specifies whether control sequences that set/query
the Scroll Lock key should be allowed,
as well as whether the Scroll Lock key responds to user's keypress.
The default is \*(``false\*(''.
.IP
When this feature is enabled, \fI\*n\fP will sense the state of the
Scroll Lock key each time it acquires focus.
Pressing the Scroll Lock key toggles \fI\*n\fP's internal state,
as well as toggling the associated LED.
While the Scroll Lock is active, \fI\*n\fP attempts to keep a viewport on the
same set of lines.
If the current viewport is scrolled past the limit set by the
\fBsaveLines\fP resource, then Scroll Lock has no further effect.
.IP
The reason for setting the default to \*(``false\*('' is to avoid
user surprise.
This key is generally unused in keyboard configurations,
and has not acquired a standard meaning even when it is used in that manner.
Consequently, users have assigned it for ad hoc purposes.
.TP 8
.B "allowSendEvents (\fPclass\fB AllowSendEvents)"
Specifies whether or not synthetic key and button events (generated using
the X protocol SendEvent request) should be interpreted or discarded.
The default is \*(``false\*('' meaning they are discarded.
Note that allowing such events would create a very large security hole, therefore
enabling this resource forcefully disables the \fBallow\fP\fIXXX\fP\fBOps\fR resources.
The default is \*(``false\*(''.
.TP
.B "allowTcapOps (\fPclass\fB AllowTcapOps)"
Specifies whether control sequences that query the terminal's
notion of its function-key strings, as termcap or terminfo capabilities
should be allowed.
The default is \*(``true\*(''.
.IP
A few programs, e.g., \fIvim\fP, use this feature to get an accurate
description of the terminal's capabilities,
independent of the termcap/terminfo setting:
.RS
.bP
\fI\*n\fP can tell the querying program how many colors it supports.
This is a constant, depending on how it is compiled, typically 16.
It does not change if you alter resource settings,
e.g., the \fBboldColors\fP resource.
.bP
\fI\*n\fP can tell the querying program what strings are sent by modified
(shift-, control-, alt-) function- and keypad-keys.
Reporting control- and alt-modifiers is a feature that relies on the
\fIncurses\fP extended naming.
.RE
.TP
.B "allowTitleOps (\fPclass\fB AllowTitleOps)"
Specifies whether control sequences that modify the window title or icon name
should be allowed.
The default is \*(``true\*(''.
.TP
.B "allowWindowOps (\fPclass\fB AllowWindowOps)"
Specifies whether extended window control sequences
(as used in \fIdtterm\fP)
should be allowed.
These include several control sequences which manipulate the window size or
position, as well as reporting these values and the title or icon name.
Each of these can be abused in a script;
curiously enough most terminal emulators that implement these
restrict only a small part of the repertoire.
For fine-tuning, see \fBdisallowedWindowOps\fP.
The default is \*(``false\*(''.
.TP 8
.B "altIsNotMeta (\fPclass\fB AltIsNotMeta\fP)"
If \*(``true\*('', treat the Alt-key as if it were the Meta-key.
Your keyboard may happen to be configured so they are the same.
But if they are not, this allows you to use the same prefix- and shifting
operations with the Alt-key as with the Meta-key.
See \fBaltSendsEscape\fP and \fBmetaSendsEscape\fP.
The default is \*(``false\*(''.
.TP 8
.B "altSendsEscape (\fPclass\fB AltSendsEscape\fP)"
This is an additional keyboard operation that may be processed
after the logic for \fBmetaSendsEscape\fP.
It is only available if the \fBaltIsNotMeta\fP resource is set.
.RS
.bP
If \*(``true\*('', Alt characters
(a character combined with the modifier associated with left/right Alt-keys)
are converted into a two-character
sequence with the character itself preceded by ESC.
This applies as well to function key control sequences, unless \fI\*n\fP
sees that \fBAlt\fP is used in your key translations.
.bP
If \*(``false\*('', Alt characters input from the keyboard cause a shift to
8-bit characters (just like \fBmetaSendsEscape\fP).
By combining the Alt- and Meta-modifiers, you can create corresponding
combinations of ESC-prefix and 8-bit characters.
.RE
.IP
The default is \*(``__alt_sends_esc__\*(''.
\fI\*N\fP provides a menu option for toggling this resource.
.TP 8
.B "alternateScroll (\fPclass\fB ScrollCond)"
If \*(``true\*('',
the \fBscroll-back\fP and \fBscroll-forw\fP actions
send cursor\-up and \-down keys when \*n is displaying the alternate screen.
The default is \*(``false\*(''.
.IP
The \fBalternateScroll\fP state can also be set using a control sequence.
.TP 8
.B "alwaysBoldMode (\fPclass\fB AlwaysBoldMode)"
Specifies whether \fI\*n\fP should check if the normal and bold
fonts are distinct before deciding whether to use overstriking to
simulate bold fonts.
If this resource is true,
\fI\*n\fP does not make the check for
distinct fonts when deciding how to handle the \fBboldMode\fP resource.
The default is \*(``false\*(''.
.ne 9
.TS
l l l l
_ _ _ _
l l l l.
\fIboldMode\fR \fIalwaysBoldMode\fR \fIComparison\fR \fIAction\fP
false false ignored use font
false true ignored use font
true false same overstrike
true false different use font
true true ignored overstrike
.TE
.RS
.LP
This resource is used only for bitmap fonts:
.bP
When using bitmap fonts, it is possible that the font server will
approximate the bold font by rescaling it from
a different font size than expected.
The \fBalwaysBoldMode\fP resource
allows the user to override the (sometimes poor)
resulting bold font with overstriking (which is at least consistent).
.bP
The problem does not occur with TrueType fonts (though there can be
other unnecessary issues such as different coverage of the normal
and bold fonts).
.RE
.IP
As an alternative, setting the \fBallowBoldFonts\fP resource to false
overrides both the \fBalwaysBoldMode\fP and the \fBboldMode\fP resources.
.TP 8
.B "alwaysHighlight (\fPclass\fB AlwaysHighlight)"
Specifies whether or not \fI\*n\fP should always display a highlighted
text cursor.
By default (if this resource is false),
a hollow text cursor is displayed whenever the
pointer moves out of the window or the window loses the input focus.
The default is \*(``false\*(''.
.TP 8
.B "alwaysUseMods (\fPclass\fB AlwaysUseMods)"
Override the \fBnumLock\fP resource, telling \fI\*n\fR to use the Alt and Meta
modifiers to construct parameters for function key sequences even if
those modifiers appear in the translations resource.
Normally \fI\*n\fP checks if Alt or Meta is used in a translation that
would conflict with function key modifiers, and will ignore these modifiers
in that special case.
The default is \*(``false\*(''.
.TP 8
.B "answerbackString (\fPclass\fB AnswerbackString)"
Specifies the string that \fI\*n\fR sends in response to an ENQ (control/E)
character from the host.
The default is a blank string, i.e., \*(``\*(''.
A hardware VT100 implements this feature as a setup option.
.TP 8
.B "appcursorDefault (\fPclass\fB AppcursorDefault)"
If \*(``true\*('', the cursor keys are initially in application mode.
This is the same as the VT102 private DECCKM mode,
The default is \*(``false\*(''.
.TP 8
.B "appkeypadDefault (\fPclass\fB AppkeypadDefault)"
If \*(``true\*('', the keypad keys are initially in application mode.
The default is \*(``false\*(''.
.TP 8
.B "assumeAllChars (\fPclass\fB AssumeAllChars)"
If \*(``true\*('', this enables a special case in bitmap fonts to
allow the font server to choose how to display missing glyphs.
The default is \*(``false\*(''.
.TP 8
.B "autoWrap (\fPclass\fB AutoWrap)"
Specifies whether or not auto-wraparound should be enabled.
This is the same as the VT102 DECAWM.
The
default is \*(``true\*(''.
.TP 8
.B "awaitInput (\fPclass\fB AwaitInput)"
Specifies whether or not the \fI\*n\fR uses a 50 millisecond timeout to
await input (i.e., to support the Xaw3d arrow scrollbar).
The default is \*(``false\*(''.
.TP 8
.B "backarrowKey (\fPclass\fB BackarrowKey)"
Specifies whether the backarrow key transmits
a backspace (8)
or delete (127) character.
This corresponds to the DECBKM control sequence.
A \*(``true\*('' value specifies backspace.
The default is \*(``__backarrow_is_bs__\*(''.
Pressing the control key toggles this behavior.
.TP 8
.B "background (\fPclass\fB Background)"
Specifies the color to use for the background of the window.
The default is
\*(``XtDefaultBackground\*(''.
.TP 8
.B "bellIsUrgent (\fPclass\fB BellIsUrgent)"
Specifies whether to set the Urgency hint for the window manager
when making a bell sound.
The default is \*(``false\*(''.
.TP 8
.B "bellOnReset (\fPclass\fB BellOnReset)"
Specifies whether to sound a bell when doing a hard reset.
The default is \*(``true\*(''.
.TP 8
.B "bellSuppressTime (\fPclass\fB BellSuppressTime)"
Number of milliseconds after a bell command is sent during which additional
bells will be suppressed.
Default is 200.
If set non-zero,
additional bells
will also be suppressed until the server reports that processing of
the first bell has been completed; this feature is most useful with
the visible bell.
.TP 8
.B "boldColors (\fPclass\fB ColorMode)"
Specifies whether to combine bold attribute with colors like the IBM PC,
i.e., map colors 0 through 7 to colors 8 through 15.
These normally are the brighter versions of the first 8 colors, hence bold.
The default is \*(``true\*(''.
.TP 8
.B "boldFont (\fPclass\fB BoldFont)"
Specifies the name of the bold font to use instead of overstriking.
There is no default for this resource.
.IP
This font must be the same height and width as the normal font, otherwise it is ignored.
If only one of the normal or bold fonts is specified, it will be used as the
normal font and the bold font will be produced by overstriking this font.
.IP
See also the discussion of \fBboldMode\fP and \fBalwaysBoldMode\fP resources.
.TP 8
.B "boldMode (\fPclass\fB BoldMode)"
This specifies whether or not text with the bold attribute should be
overstruck to simulate bold fonts if the resolved bold font is the
same as the normal font.
It may be desirable to disable bold fonts when color is being
used for the bold attribute.
.IP
Note that \fI\*n\fP has one bold font which you may set explicitly.
\fI\*N\fP attempts to derive a bold font for the other font selections
(\fBfont1\fP through \fBfont6\fP).
If it cannot find a bold font, it will use the normal font.
In each case (whether the explicit resource or the derived font),
if the normal and bold fonts are distinct, this resource has no effect.
The default is \*(``true\*(''.
.IP
See the \fBalwaysBoldMode\fP resource which can modify the behavior
of this resource.
.IP
Although \fI\*n\fP attempts to derive a bold font for other font selections,
the font server may not cooperate.
Since X11R6, bitmap fonts have been scaled.
The font server claims to provide the bold font that \fI\*n\fP requests,
but the result is not always readable.
XFree86 introduced a feature which can be used to suppress the scaling.
In the X server's configuration file (e.g., \*(``/etc/X11/XFree86\*(''), you
can add \*(``:unscaled\*('' to the end of the directory specification for the
\*(``misc\*('' fonts,
which comprise the fixed-pitch fonts that are used by \fI\*n\fP.
For example
.NS
FontPath "/usr/lib/X11/fonts/misc/"
.NE
.IP
would become
.NS
FontPath "/usr/lib/X11/fonts/misc/:unscaled"
.NE
.IP
Depending on your configuration, the font server may have its own configuration
file.
The same \*(``:unscaled\*('' can be added to its configuration file at the
end of the directory specification for \*(``misc\*(''.
.IP
The bitmap scaling feature is also used by \fI\*n\fP to implement
VT102 double-width and double-height characters.
.TP 8
.B "brokenLinuxOSC (\fPclass\fB BrokenLinuxOSC)"
If true, \fI\*n\fP applies a workaround to ignore malformed control
sequences that a Linux script might send.
Compare the palette control sequences documented in \fIconsole_codes\fR
with ECMA-48.
The default is \*(``true\*(''.
.TP 8
.B "brokenSelections (\fPclass\fB BrokenSelections)"
If true, \fI\*n\fP in 8-bit mode will interpret
.B STRING
selections as carrying text in the current locale's encoding.
Normally
.B STRING
selections carry ISO-8859-1 encoded text.
Setting this resource to
\*(``true\*('' violates the ICCCM; it may, however, be useful for interacting
with some broken X clients.
The default is \*(``false\*(''.
.TP 8
.B "brokenStringTerm (\fPclass\fB BrokenStringTerm)"
provides a work-around for some ISDN routers which start an application
control string without completing it.
Set this to \*(``true\*('' if \fI\*n\fP appears to freeze when connecting.
The default is \*(``false\*(''.
.IP
\fI\*N\fP's state parser recognizes
several types of control strings which can contain text, e.g.,
.sp
.RS
\fBAPC\fP (Application Program Command),
.br
\fBDCS\fP (Device Control String),
.br
\fBOSC\fP (Operating System Command),
.br
\fBPM\fP (Privacy Message), and
.br
\fBSOS\fP (Start of String),
.RE
.IP
Each should end with a string-terminator (a special character which
cannot appear in these strings).
Ordinary control characters found within the string are not ignored;
they are processed without interfering with the process of accumulating
the control string's content.
\fI\*N\fP recognizes these controls in all modes,
although some of the functions may be suppressed after parsing the control.
.IP
When enabled, this feature allows the user to exit from an unterminated
control string when any of these ordinary control characters are found:
.sp
.RS
control/D (used as an end of file in many shells),
.br
control/H (backspace),
.br
control/I (tab-feed),
.br
control/J (line feed aka newline),
.br
control/K (vertical tab),
.br
control/L (form feed),
.br
control/M (carriage return),
.br
control/N (shift-out),
.br
control/O (shift-in),
.br
control/Q (XOFF),
.br
control/X (cancel)
.RE
.TP 8
.B "c132 (\fPclass\fB C132)"
Specifies whether or not the VT102 DECCOLM escape sequence,
used to switch between 80 and 132 columns, should be honored.
The default is \*(``false\*(''.
.TP 8
.B "cacheDoublesize (\fPclass\fB CacheDoublesize)"
Tells whether to cache double-sized fonts by \fI\*n\fR.
Set this to zero to disable double-sized fonts altogether.
.TP 8
.B "cdXtraScroll (\fPclass\fB CdXtraScroll)"
Specifies whether \fI\*n\fP should scroll to a new page when clearing
the whole screen.
Like \fBtiXtraScroll\fP,
the intent of this option is to provide a picture of the full-screen
application's display on the scrollback before wiping out the text.
The default for this resource is \*(``false\*(''.
.TP 8
.B "charClass (\fPclass\fB CharClass)"
Specifies comma-separated lists of character class bindings of the form
[\fIlow\fP-]\fIhigh\fP:\fIvalue\fP.
These are used in determining which
sets of characters should be treated the same when doing cut and paste.
See the \fBCHARACTER CLASSES\fP section.
.TP 8
.B "cjkWidth (\fPclass\fB CjkWidth)"
Specifies whether \fI\*n\fP should follow
the traditional East Asian width convention.
When turned on, characters with East Asian Ambiguous (A) category in UTR
11 have a column width of 2.
You may have to set this option to \*(``true\*(''
if you have some old East Asian terminal based programs that assume that
line-drawing characters have a column width of 2.
If this resource is false, the \fBmkWidth\fP resource controls the
choice between the system's \fBwcwidth\fP and \fI\*n\fP's built-in tables.
The default is \*(``false\*(''.
.TP 8
.B "color0 (\fPclass\fB Color0)"
.TP 8
.B "color1 (\fPclass\fB Color1)"
.TP 8
.B "color2 (\fPclass\fB Color2)"
.TP 8
.B "color3 (\fPclass\fB Color3)"
.TP 8
.B "color4 (\fPclass\fB Color4)"
.TP 8
.B "color5 (\fPclass\fB Color5)"
.TP 8
.B "color6 (\fPclass\fB Color6)"
.TP 8
.B "color7 (\fPclass\fB Color7)"
These specify the colors for the ISO-6429 extension.
The defaults are,
respectively,
black,
red3,
green3,
yellow3,
a customizable dark blue,
magenta3,
cyan3,
and
gray90.
The default shades of color are chosen to allow the colors 8-15
to be used as brighter versions.
.TP 8
.B "color8 (\fPclass\fB Color8)"
.TP 8
.B "color9 (\fPclass\fB Color9)"
.TP 8
.B "color10 (\fPclass\fB Color10)"
.TP 8
.B "color11 (\fPclass\fB Color11)"
.TP 8
.B "color12 (\fPclass\fB Color12)"
.TP 8
.B "color13 (\fPclass\fB Color13)"
.TP 8
.B "color14 (\fPclass\fB Color14)"
.TP 8
.B "color15 (\fPclass\fB Color15)"
These specify the colors for the ISO-6429 extension if the bold attribute
is also enabled.
The default resource values are respectively,
gray30,
red,
green,
yellow,
a customizable light blue,
magenta,
cyan,
and
white.
.TP 8
.B "color16 (\fPclass\fB Color16)"
.TP 8
through
.TP 8
.B "color255 (\fPclass\fB Color255)"
These specify the colors for the 256-color extension.
The default resource values
are for colors 16 through 231 to make a 6x6x6 color cube, and colors
232 through 255 to make a grayscale ramp.
.IP
Resources past \fBcolor15\fP are available as a compile-time option.
Due to a hardcoded limit in the X libraries on the total number of
resources (to 400), the resources for 256-colors
are omitted when wide-character support and \fIluit\fP are enabled.
Besides inconsistent behavior if only part of the resources were allowed,
determining the exact cutoff is difficult, and the X libraries tend
to crash if the number of resources exceeds the limit.
The color palette is still initialized to the same default values,
and can be modified via control sequences.
.IP
On the other hand, the resource limit does permit including the entire
range for 88-colors.
.TP 8
.B "colorAttrMode (\fPclass\fB ColorAttrMode)"
Specifies whether \fBcolorBD\fP, \fBcolorBL\fP, \fBcolorRV\fP, and
\fBcolorUL\fP should override ANSI colors.
If not, these are displayed only when no ANSI colors
have been set for the corresponding position.
The default is \*(``false\*(''.
.TP 8
.B "colorBD (\fPclass\fB ColorBD)"
This specifies the color to use to display bold characters if
the \*(``colorBDMode\*('' resource is enabled.
The default is \*(``XtDefaultForeground\*(''.
.IP
See also the \fBveryBoldColors\fP resource which allows combining bold and color.
.TP 8
.B "colorBDMode (\fPclass\fB ColorAttrMode)"
Specifies whether characters with the bold attribute should be displayed in
color or as bold characters.
Note that setting \fBcolorMode\fR off disables
all colors, including bold.
The default is \*(``false\*(''.
.TP 8
.B "colorBL (\fPclass\fB ColorBL)"
This specifies the color to use to display blink characters if
the \*(``colorBLMode\*('' resource is enabled.
The default is \*(``XtDefaultForeground\*(''.
.IP
See also the \fBveryBoldColors\fP resource which allows combining underline and color.
.TP 8
.B "colorBLMode (\fPclass\fB ColorAttrMode)"
Specifies whether characters with the blink attribute should be displayed in
color.
Note that setting \fBcolorMode\fR off disables all colors, including this.
The default is \*(``false\*(''.
.TP 8
.B "colorMode (\fPclass\fB ColorMode)"
Specifies whether or not recognition of ANSI (ISO-6429)
color change escape sequences should be enabled.
The default is \*(``true\*(''.
.TP 8
.B "colorRV (\fPclass\fB ColorRV)"
This specifies the color to use to display reverse characters if
the \*(``colorRVMode\*('' resource is enabled.
The default is \*(``XtDefaultForeground\*(''.
.IP
See also the \fBveryBoldColors\fP resource which allows combining reverse and color.
.TP 8
.B "colorRVMode (\fPclass\fB ColorAttrMode)"
Specifies whether characters with the reverse attribute should be displayed in
color.
Note that setting \fBcolorMode\fR off disables all colors, including this.
The default is \*(``false\*(''.
.TP 8
.B "colorUL (\fPclass\fB ColorUL)"
This specifies the color to use to display underlined characters if
the \*(``colorULMode\*('' resource is enabled.
The default is \*(``XtDefaultForeground\*(''.
.IP
See also the \fBveryBoldColors\fP resource which allows combining underline and color.
.TP 8
.B "colorULMode (\fPclass\fB ColorAttrMode)"
Specifies whether characters with the underline attribute should be displayed
in color or as underlined characters.
Note that setting \fBcolorMode\fR off
disables all colors, including underlining.
The default is \*(``false\*(''.
.TP 8
.B "combiningChars (\fPclass\fB CombiningChars)"
Specifies the number of wide-characters which can be stored in a cell
to overstrike (combine) with the base character of the cell.
This can be set to values in the range 0 to 4.
The default is \*(``2\*(''.
.TP 8
.B "ctrlFKeys (\fPclass\fB CtrlFKeys)"
In VT220 keyboard mode (see \fBsunKeyboard\fP resource),
specifies the amount by which to shift F1-F12 given a control modifier (CTRL).
This allows you to generate key symbols for F10-F20 on a Sun/PC keyboard.
The default is \*(``10\*('', which means that CTRL F1 generates the key
symbol for F11.
.TP 8
.B "curses (\fPclass\fB Curses)"
Specifies whether or not the last column bug in
.IR more (1)
should be worked around.
See the \fB\-cu\fP option for details.
The default is \*(``false\*(''.
.TP 8
.B "cursorBlink (\fPclass\fB CursorBlink)"
Specifies whether to make the cursor blink.
The default is \*(``false\*(''.
.IP
\fI\*N\fP uses two variables to determine whether the cursor blinks.
One is set by this resource.
The other is set by control sequences (private mode 12 and DECSCUSR).
\fI\*N\fP tests the XOR of the two variables.
.TP 8
.B "cursorColor (\fPclass\fB CursorColor)"
Specifies the color to use for the text cursor.
The default is \*(``XtDefaultForeground\*(''.
By default,
\fI\*n\fP attempts to keep this color from being the same as the background
color, since it draws the cursor by filling the background of a text cell.
The same restriction applies to control sequences which may change this color.
.IP
Setting this resource overrides
most of \fI\*n\fP's adjustments to cursor color.
It will still use reverse-video to disallow some cases, such as a black
cursor on a black background.
.TP 8
.B "cursorOffTime (\fPclass\fB CursorOffTime)"
Specifies the duration of the \*(``off\*('' part of the cursor blink cycle-time
in milliseconds.
The same timer is used for text blinking.
The default is \*(``300\*(''.
.TP 8
.B "cursorOnTime (\fPclass\fB CursorOnTime)"
Specifies the duration of the \*(``on\*('' part of the cursor blink cycle-time,
in milliseconds.
The same timer is used for text blinking.
The default is \*(``600\*(''.
.TP 8
.B "cutNewline (\fPclass\fB CutNewline)"
If \*(``false\*('', triple clicking to select a line does not include the Newline
at the end of the line.
If \*(``true\*('', the Newline is selected.
The default is \*(``true\*(''.
.TP 8
.B "cursorUnderLine (\fPclass\fB CursorUnderLine)"
Specifies whether to make the cursor underlined or a box.
The default is \*(``false\*(''.
.TP 8
.B "cutToBeginningOfLine (\fPclass\fB CutToBeginningOfLine)"
If \*(``false\*('', triple clicking to select a line selects only from the
current word forward.
If \*(``true\*('', the entire line is selected.
The default is \*(``true\*(''.
.TP 8
.B "decTerminalID (\fPclass\fB DecTerminalID)"
Specifies the emulation level (100=VT100, 220=VT220, etc.), used to determine
the type of response to a DA control sequence.
Leading non-digit characters are ignored,
e.g., \*(``vt100\*('' and \*(``100\*('' are the same.
The default is \*(``__default_termid__\*(''.
.TP 8
.B "defaultString (\fPclass\fB DefaultString)"
Specify the character (or string) which \fI\*n\fP will substitute when
pasted text includes a character which cannot be represented in the
current encoding.
For instance, pasting UTF-8 text into a display of ISO-8859-1 characters
will only be able to display codes 0-255, while UTF-8 text can include
Unicode values above 255.
The default is \*(``#\*('' (a single pound sign).
.IP
If the undisplayable text would be double-width,
\fI\*n\fP will add a space after the \*(``#\*('' character, to give roughly
the same layout on the screen as the original text.
.TP 8
.B "deleteIsDEL (\fPclass\fB DeleteIsDEL)"
Specifies whether the Delete key on the editing keypad should send DEL (127)
or the VT220-style Remove escape sequence.
A \*(``false\*('' value enables the latter.
The default is \*(``__delete_is_del__\*(''.
.TP 8
.B "disallowedColorOps (\fPclass\fB DisallowedColorOps)"
Specify which features will be disabled if \fBallowColorOps\fP is false.
This is a comma-separated list of names.
The default value is
.RS
SetColor,GetColor,GetAnsiColor
.RE
.IP
The names are listed below.
\fI\*n\fP ignores capitalization, but
they are shown in mixed-case for clarity.
.RS
.TP 5
SetColor
Set a specific dynamic color.
.TP 5
GetColor
Report the current setting of a given dynamic color.
.TP 5
GetAnsiColor
Report the current setting of a given ANSI color (actually any of the colors
set via ANSI-style controls).
.RE
.TP 8
.B "disallowedFontOps (\fPclass\fB DisallowedFontOps)"
Specify which features will be disabled if \fBallowFontOps\fP is false.
This is a comma-separated list of names.
The default value is
.RS
SetFont,GetFont
.RE
.IP
The names are listed below.
\fI\*n\fP ignores capitalization, but
they are shown in mixed-case for clarity.
.RS
.TP 5
SetFont
Set the specified font.
.TP 5
GetFont
Report the specified font.
.RE
.TP 8
.B "disallowedTcapOps (\fPclass\fB DisallowedTcapOps)"
Specify which features will be disabled if \fBallowTcapOps\fP is false.
This is a comma-separated list of names.
The default value is
.RS
SetTcap,GetTcap
.RE
.IP
The names are listed below.
\fI\*n\fP ignores capitalization, but
they are shown in mixed-case for clarity.
.RS
.TP 5
SetTcap
(not implemented)
.TP 5
GetTcap
Report specified function- and other special keys.
.RE
.TP 8
.B "disallowedWindowOps (\fPclass\fB DisallowedWindowOps)"
Specify which features will be disabled if \fBallowWindowOps\fP is false.
This is a comma-separated list of names, or (for the controls adapted
from \fIdtterm\fP the operation number).
The default value is
.RS
20,21,SetXprop,SetSelection
.RE
.IP
The names are listed below.
\fI\*n\fP ignores capitalization, but
they are shown in mixed-case for clarity.
Where a number can be used
as an alternative, it is given in parentheses after the name.
.RS
.TP 5
GetIconTitle (20)
Report \*n window's icon label as a string.
.TP 5
GetScreenSizeChars (19)
Report the size of the screen in characters as numbers.
.TP 5
GetSelection
Report selection data as a base64 string.
.TP 5
GetWinPosition (13)
Report \*n window position as numbers.
.TP 5
GetWinSizeChars (18)
Report the size of the text area in characters as numbers.
.TP 5
GetWinSizePixels (14)
Report \*n window in pixels as numbers.
.TP 5
GetWinState (11)
Report \*n window state as a number.
.TP 5
GetWinTitle (21)
Report \*n window's title as a string.
.TP 5
LowerWin (6)
Lower the \*n window to the bottom of the stacking order.
.TP 5
MaximizeWin (9)
Maximize window (i.e., resize to screen size).
.TP 5
FullscreenWin (10)
Use full screen (i.e., resize to screen size, without window decorations).
.TP 5
MinimizeWin (2)
Iconify window.
.TP 5
PopTitle (23)
Pop title from internal stack.
.TP 5
PushTitle (22)
Push title to internal stack.
.TP 5
RaiseWin (5)
Raise the \*n window to the front of the stacking order.
.TP 5
RefreshWin (7)
Refresh the \*n window.
.TP 5
RestoreWin (1)
De-iconify window.
.TP 5
SetSelection
Set selection data.
.TP 5
SetWinLines
Resize to a given number of lines, at least 24.
.TP 5
SetWinPosition (3)
Move window to given coordinates.
.TP 5
SetWinSizeChars (8)
Resize the text area to given size in characters.
.TP 5
SetWinSizePixels (4)
Resize the \*n window to given size in pixels.
.TP 5
SetXprop
Set X property on top-level window.
.RE
.TP 8
.B "dynamicColors (\fPclass\fB DynamicColors)"
Specifies whether or not escape sequences to change colors assigned to
different attributes are recognized.
.TP 8
.B "eightBitControl (\fPclass\fB EightBitControl\fP)"
Specifies whether or not control sequences sent by the
terminal should be eight-bit characters or escape sequences.
The default is \*(``false\*(''.
.TP 8
.B "eightBitInput (\fPclass\fB EightBitInput\fP)"
If \*(``true\*('', Meta characters
(a single-byte character combined with the \fIMeta\fP modifier key)
input from the keyboard are presented as a
single character, modified according to the \fBeightBitMeta\fP resource.
If \*(``false\*('', Meta characters are converted into a two-character
sequence with the character itself preceded by ESC.
The default is \*(``true\*(''.
.IP
The \fBmetaSendsEscape\fP
and \fBaltSendsEscape\fP resources may override this feature.
Generally keyboards do not have a key labeled \*(``Meta\*('',
but \*(``Alt\*('' keys are common,
and they are conventionally used for \*(``Meta\*(''.
If they were synonymous, it would have been reasonable to name this
resource \*(``\fBaltSendsEscape\fP\*('', reversing its sense.
For more background on this, see the \fBmeta\fP function in curses.
.IP
Note that the \fIAlt\fP key is not necessarily the same as the
\fIMeta\fP modifier.
\fIxmodmap\fP lists your key modifiers.
X defines modifiers for shift, (caps) lock and control,
as well as 5 additional modifiers which are generally used to configure
key modifiers.
\fI\*n\fP inspects the same information to find the modifier associated
with either \fIMeta\fP key (left or right),
and uses that key as the \fIMeta\fP modifier.
It also looks for the NumLock key,
to recognize the modifier which is associated with that.
.IP
If your \fIxmodmap\fP configuration
uses the same keycodes for Alt- and Meta-keys,
\fI\*n\fP will only see the Alt-key definitions, since those are tested
before Meta-keys.
NumLock is tested first.
It is important to keep these keys distinct;
otherwise some of \fI\*n\fP's functionality is not available.
.IP
The \fBeightBitInput\fP resource is tested at startup time.
If \*(``true\*('',
the \fI\*n\fP tries to put the terminal into 8-bit mode.
If \*(``false\*('',
on startup, \fI\*n\fP tries to put the terminal into 7-bit mode.
For some configurations this is unsuccessful; failure is ignored.
After startup, \fI\*n\fP does not
change the terminal between 8-bit and 7-bit mode.
.IP
As originally implemented in X11,
the resource value did not change after startup.
However
(since patch #216 in 2006)
\fI\*n\fP can modify \fBeightBitInput\fP after startup
via a control sequence.
The corresponding terminfo capabilities \fBsmm\fP (set meta mode)
and \fBrmm\fP (reset meta mode)
have been recognized by \fIbash\fP for some time.
Interestingly enough, \fIbash\fP's notion of "meta mode"
differs from the standard definition (in the \fIterminfo\fP manual),
which describes the change to the eighth bit of a character.
It happens that \fIbash\fP views "meta mode"
as the ESC character that \fI\*n\fP puts before a character when a
special meta key is pressed.
\fIbash\fP's early documentation talks about the ESC character
and ignores the eighth bit.
.TP 8
.B "eightBitMeta (\fPclass\fB EightBitMeta\fP)"
This controls the way \fI\*n\fP modifies the eighth bit of a single-byte
key when the \fBeightBitInput\fP resource is set.
The default is \*(``locale\*(''.
.IP
The resource value is a string, evaluated as a boolean after startup.
.RS
.TP 5
false
The key is sent unmodified.
.TP 5
locale
The key is modified only if the locale uses eight-bit encoding.
.TP 5
true
The key is sent modified.
.TP 5
never
The key is always sent unmodified.
.RE
.IP
Except for the \fBnever\fP choice, \fI\*n\fP honors the
terminfo capabilities \fBsmm\fP (set meta mode)
and \fBrmm\fP (reset meta mode),
allowing the feature to be turned on or off dynamically.
.IP
If \fBeightBitMeta\fP is enabled when the locale uses UTF-8,
\fI\*n\fP encodes the value as UTF-8
(since patch #183 in 2003).
.TP 8
.B "eightBitOutput (\fPclass\fB EightBitOutput\fP)"
Specifies whether or not eight-bit characters sent from the host should be
accepted as is or stripped when printed.
The default is \*(``true\*('',
which means that they are accepted as is.
.TP 8
.B "eightBitSelectTypes (\fPclass\fB EightBitSelectTypes\fP)"
Override \fI\*n\fP's default selection target list (see SELECT/PASTE) for
selections in normal (ISO-8859-1) mode.
The default is an empty string, i.e., \*(``\*('',
which does not override anything.
.TP 8
.B "faceName (\fPclass\fB FaceName)"
Specify the pattern for scalable fonts selected from the FreeType
library if support for that library was compiled into \fI\*n\fR.
There is no default value.
.IP
If not specified,
or if there is no match for both normal and bold fonts,
\fI\*n\fR uses the bitmap \fBfont\fP and related resources.
.IP
It is possible to select suitable bitmap fonts using a script such as this:
.NS
\!/bin/sh
\&FONT=`xfontsel -print`
\&test -n "$FONT" && xfd -fn "$FONT"
.NE
.IP
However (even though \fIxfd\fP accepts a \*(``\fB\-fa\fP\*('' option
to denote FreeType fonts),
\fIxfontsel\fP has not been similarly extended.
As a workaround, you may try
.NS
fc-list :scalable=true:spacing=mono: family
.NE
.IP
to find a list of scalable fixed-pitch fonts
which may be used for the \fBfaceName\fP resource value.
.TP 8
.B "faceNameDoublesize (\fPclass\fB FaceNameDoublesize)"
Specify a double-width scalable font for cases where an application requires
this, e.g., in CJK applications.
There is no default value.
.IP
If the application uses double-wide characters and this resource is not given,
\fI\*n\fP will use a scaled version of the font given by \fBfaceName\fP.
.TP 8
.B "faceSize (\fPclass\fB FaceSize)"
Specify the pointsize for fonts selected from the FreeType
library if support for that library was compiled into \fI\*n\fR.
The default is \*(``14.0\*(''
On the \fBVT\ Fonts\fP menu, this corresponds to the \fIDefault\fP entry.
.IP
Although the default is \*(``14.0\*('',
this may not be the same as the pointsize for the default bitmap font,
i.e., that assigned with the \fB\-fn\fP option,
or the \fBfont\fP resource.
For example, the \*(``fixed\*('' font usually has a pointsize of \*(``8.0\*(''.
If you set \fBfaceSize\fP to match the size of the bitmap font,
then switching between bitmap and TrueType fonts via the font menu
will give comparable sizes for the window.
.IP
You can specify the pointsize for TrueType fonts selected with the other
size-related menu entries such as Medium, Huge, etc., by using one of
the following resource values.
If you do not specify a value,
they default to \*(``0.0\*('',
which causes \fI\*n\fP to use the ratio of font sizes
from the corresponding bitmap
font resources to obtain a TrueType pointsize.
.IP
If all of the \fBfaceSize\fP resources are set, then \fI\*n\fP
will use this information to determine the next smaller/larger
TrueType font for the
\fBlarger-vt-font()\fP and
\fBsmaller-vt-font()\fP actions.
If any are not set, \fI\*n\fP will use only the areas of the bitmap fonts.
.TP 8
.B "faceSize1 (\fPclass\fB FaceSize1)"
Specifies the pointsize of the first alternative font.
.TP 8
.B "faceSize2 (\fPclass\fB FaceSize2)"
Specifies the pointsize of the second alternative font.
.TP 8
.B "faceSize3 (\fPclass\fB FaceSize3)"
Specifies the pointsize of the third alternative font.
.TP 8
.B "faceSize4 (\fPclass\fB FaceSize4)"
Specifies the pointsize of the fourth alternative font.
.TP 8
.B "faceSize5 (\fPclass\fB FaceSize5)"
Specifies the pointsize of the fifth alternative font.
.TP 8
.B "faceSize6 (\fPclass\fB FaceSize6)"
Specifies the pointsize of the sixth alternative font.
.TP 8
.B "font (\fPclass\fB Font)"
Specifies the name of the normal font.
The default is \*(``fixed\*(''.
.IP
See the discussion of the \fBlocale\fP resource,
which describes how this font may be overridden.
.IP
NOTE: some resource files use patterns such as
.NS
*font: fixed
.NE
.IP
which are overly broad, affecting both
.NS
xterm.vt100.font
.NE
.IP
and
.NS
xterm.vt100.utf8Fonts.font
.NE
.IP
which is probably not what you intended.
.TP 8
.B "fastScroll (\fPclass\fB FastScroll)"
Modifies the effect of jump scroll (\fBjumpScroll\fP)
by suppressing screen refreshes
for the special case when output to the screen has completely shifted
the contents off-screen.
For instance, \fIcat\fP'ing a large file to the screen does this.
.TP 8
.B "font1 (\fPclass\fB Font1)"
Specifies the name of the first alternative font,
corresponding to \*(``Unreadable\*('' in the standard menu.
.TP 8
.B "font2 (\fPclass\fB Font2)"
Specifies the name of the second alternative font,
corresponding to \*(``Tiny\*('' in the standard menu.
.TP 8
.B "font3 (\fPclass\fB Font3)"
Specifies the name of the third alternative font,
corresponding to \*(``Small\*('' in the standard menu.
.TP 8
.B "font4 (\fPclass\fB Font4)"
Specifies the name of the fourth alternative font,
corresponding to \*(``Medium\*('' in the standard menu.
.TP 8
.B "font5 (\fPclass\fB Font5)"
Specifies the name of the fifth alternative font,
corresponding to \*(``Large\*('' in the standard menu.
.TP 8
.B "font6 (\fPclass\fB Font6)"
Specifies the name of the sixth alternative font,
corresponding to \*(``Huge\*('' in the standard menu.
.TP 8
.B "fontDoublesize (\fPclass\fB FontDoublesize)"
Specifies whether \fI\*n\fP should attempt to use font scaling to draw
double-sized characters.
Some older font servers cannot do this properly, will return misleading
font metrics.
The default is \*(``true\*(''.
If disabled, \fI\*n\fP will simulate double-sized characters by drawing
normal characters with spaces between them.
.TP 8
.B "fontWarnings (\fPclass\fB FontWarnings)"
Specify whether \fI\*n\fP should report an error if it fails to load a font:
.RS
.TP 5
0
Never report an error (though the X libraries may).
.TP 5
1
Report an error if the font name was given as a resource setting.
.TP 5
2
Always report an error on failure to load a font.
.RE
.IP
The default is \*(``1\*(''.
.TP 8
.B "forceBoxChars (\fPclass\fB ForceBoxChars)"
Specifies whether \fI\*n\fP should assume the normal and bold fonts
have VT100 line-drawing characters:
.RS
.bP
The fixed-pitch ISO-8859-*-encoded fonts used by \fI\*n\fP
normally have the VT100 line-drawing glyphs in cells 1-31.
Other fixed-pitch fonts may be more attractive, but lack these glyphs.
.bP
When using an ISO-10646-1 font and the \fBwideChars\fP resource is true,
\fI\*n\fP uses the Unicode glyphs which match the VT100 line-drawing glyphs.
.RE
.IP
If \*(``false\*('', \fI\*n\fP checks for missing glyphs in the font
and makes line-drawing characters directly as needed.
If \*(``true\*('', \fI\*n\fP assumes the font does not contain the
line-drawing characters, and draws them directly.
The default is \*(``false\*(''.
.TP 8
.B "forcePackedFont (\fPclass\fB ForcePackedFont)"
Specifies whether \fI\*n\fP should use the maximum or minimum glyph
width when displaying using a bitmap font.
Use the maximum width to help with proportional fonts.
The default is \*(``true\*('', denoting the minimum width.
.TP 8
.B "foreground (\fPclass\fB Foreground)"
Specifies the color to use for displaying text in the window.
Setting the
class name instead of the instance name is an easy way to have everything
that would normally appear in the text color change color.
The default
is \*(``XtDefaultForeground\*(''.
.TP 8
.B "formatOtherKeys (\fPclass\fB FormatOtherKeys)"
Overrides the format of the escape sequence used to report modified keys
with the \fImodifyOtherKeys\fP resource.
.RS
.TP 3
0
send modified keys as parameters for function-key 27 (default).
.TP 3
1
send modified keys as parameters for CSI\ u.
.RE
.TP 8
.B "freeBoldBox (\fPclass\fB FreeBoldBox)"
Specifies whether \fI\*n\fP should assume the bounding boxes for
normal and bold fonts are compatible.
If \*(``false\*('', \fI\*n\fP compares them and will reject choices of
bold fonts that do not match the size of the normal font.
The default is \*(``false\*('', which means that the comparison is performed.
.TP 8
.B "geometry (\fPclass\fB Geometry)"
Specifies the preferred size and position of the VT102 window.
There is no default for this resource.
.TP 8
.B "highlightColor (\fPclass\fB HighlightColor)"
Specifies the color to use for the background of selected (highlighted) text.
If not specified (i.e., matching the default foreground), reverse video is used.
The default is \*(``XtDefaultForeground\*(''.
.TP 8
.B "highlightColorMode (\fPclass\fB HighlightColorMode)"
Specifies whether \fI\*n\fP should use
\fBhighlightTextColor\fP and \fBhighlightColor\fP
to override the reversed foreground/background colors in a selection.
The default is unspecified:
at startup, \fI\*n\fP checks if those resources are set to something
other than the default foreground and background colors.
Setting this resource disables the check.
.IP
The following table shows the interaction of the highlighting
resources, abbreviated as shown to fit in this page:
.RS
.TP 3
HCM
highlightColorMode
.TP 3
HR
highlightReverse
.TP 3
HBG
highlightColor
.TP 3
HFG
highlightTextColor
.RE
.IP
.ne 34
.TS
l l l l l
_ _ _ _ _
l l l l l.
\fIHCM\fR \fIHR\fR \fIHBG\fR \fIHFG\fR \fIHighlight\fP
false false default default bg/fg
false false default set bg/fg
false false set default fg/HBG
false false set set fg/HBG
=
false true default default bg/fg
false true default set bg/fg
false true set default fg/HBG
false true set set fg/HBG
=
true false default default bg/fg
true false default set HFG/fg
true false set default bg/HBG
true false set set HFG/HBG
=
true true default default fg/fg (useless)
true true default set HFG/fg
true true set default fg/HBG
true true set set HFG/HBG
=
default false default default bg/fg
default false default set bg/fg
default false set default fg/HBG
default false set set HFG/HBG
=
default true default default bg/fg
default true default set bg/fg
default true set default fg/HBG
default true set set HFG/HBG
=
.TE
.TP 8
.B "highlightReverse (\fPclass\fB HighlightReverse)"
Specifies whether \fI\*n\fP should reverse the selection foreground
and background colors when selecting text with reverse-video attribute.
This applies only to
the \fBhighlightColor\fP and \fBhighlightTextColor\fP resources,
e.g., to match the color scheme of \fIxwsh\fP.
If \*(``true\*('', \fI\*n\fP reverses the colors,
If \*(``false\*('', \fI\*n\fP does not reverse colors,
The default is \*(``true\*(''.
.TP 8
.B "highlightSelection (\fPclass\fB HighlightSelection)"
If \*(``false\*('', selecting with the mouse highlights all positions on the screen
between the beginning of the selection and the current position.
If \*(``true\*('', \fI\*n\fP highlights only the positions that contain text that
can be selected.
The default is \*(``false\*(''.
.IP
Depending on the way your applications write to the screen, there may
be trailing blanks on a line.
\fI\*N\fP stores data as it is shown on the screen.
Erasing the display changes the internal state of each cell
so it is not considered a blank for the purpose of selection.
Blanks written since the last erase are selectable.
If you do not wish to have trailing blanks in a selection,
use the \fBtrimSelection\fP resource.
.TP 8
.B "highlightTextColor (\fPclass\fB HighlightTextColor)"
Specifies the color to use for the foreground of selected (highlighted) text.
If not specified (i.e., matching the default background), reverse video is used.
The default is \*(``XtDefaultBackground\*(''.
.TP 8
.B "hpLowerleftBugCompat (\fPclass\fB HpLowerleftBugCompat)"
Specifies whether to work around a bug in HP's \fIxdb\fP,
which ignores termcap and always sends
ESC F to move to the lower left corner.
\*(``true\*('' causes \fI\*n\fP to interpret ESC F as a request to move to the
lower left corner of the screen.
The default is \*(``false\*(''.
.TP 8
.B "i18nSelections (\fPclass\fB I18nSelections)"
If false, \fI\*n\fP will not request the targets
.B COMPOUND_TEXT
or
.BR TEXT .
The default is \*(``true\*(''. It may be set to false in order to work around
ICCCM violations by other X clients.
.TP 8
.B "iconBorderColor (\fPclass\fB BorderColor)"
Specifies the border color for the active icon window if this feature
is compiled into \fI\*n\fR.
Not all window managers will make the icon
border visible.
.TP 8
.B "iconBorderWidth (\fPclass\fB BorderWidth)"
Specifies the border width for the active icon window if this feature
is compiled into \fI\*n\fR.
The default is \*(``2\*(''.
Not all window managers will make the border visible.
.TP 8
.B "iconFont (\fPclass\fB IconFont)"
Specifies the font for the miniature active icon window, if this feature
is compiled into \fI\*n\fR.
The default is \*(``nil2\*(''.
.TP 8
.B "initialFont (\fPclass\fB InitialFont)"
Specifies which of the VT100 fonts to use initially.
Values are the same as for the \fBset-vt-font\fP action.
The default is \*(``d\*('', i.e., \*(``default\*(''.
.TP 8
.B "inputMethod (\fPclass\fB XtCInputMethod)"
Tells \fI\*n\fP which type of input method to use.
There is no default method.
.TP 8
.B "internalBorder (\fPclass\fB BorderWidth)"
Specifies the number of pixels between the characters and the window border.
The default is \*(``2\*(''.
.TP 8
.B "italicULMode (\fPclass\fB ColorAttrMode)"
Specifies whether characters with the underline attribute should be displayed
in an italic font or as underlined characters.
It is implemented only for TrueType fonts.
.TP 8
.B "jumpScroll (\fPclass\fB JumpScroll)"
Specifies whether or not jump scroll should be used.
This corresponds to the VT102 DECSCLM private mode.
The default is \*(``true\*(''.
See \fBfastScroll\fP for a variation.
.TP 8
.B "keepSelection (\fPclass\fB KeepSelection)"
Specifies whether \fI\*n\fR will keep the selection even after the
selected area was touched by some output to the terminal.
The default is \*(``true\*(''.
.TP 8
.B "keyboardDialect (\fPclass\fB KeyboardDialect)"
Specifies the initial keyboard dialect, as well as the default value when
the terminal is reset.
The value given is the same as the final character in the control sequences
which change character sets.
The default is \*(``B\*('', which corresponds to US ASCII.
.TP 8
.B "\fIname\fP\fBKeymap\fP (class\fB \fIName\fP\fBKeymap\fP)"
See the discussion of the \fBkeymap()\fP action.
.TP 8
.B "limitResize (\fPclass\fB LimitResize)"
Limits resizing of the screen via control sequence to a given multiple of
the display dimensions.
The default is \*(``1\*(''.
.TP 8
.B "locale (\fPclass\fB Locale)"
Specifies how to use \fIluit\fR, an encoding converter between UTF-8
and locale encodings.
The resource value (ignoring case) may be:
.RS
.TP 4
.I true
\fI\*n\fR will use the
encoding specified by the users' LC_CTYPE locale (i.e., LC_ALL,
LC_CTYPE, or LANG variables) as far as possible.
This is realized
by always enabling UTF-8 mode and invoking \fIluit\fR in non-UTF-8
locales.
.TP
.I medium
\fI\*n\fR will follow users'
LC_CTYPE locale only for UTF-8, east Asian, and Thai locales,
where the encodings were not supported by conventional 8bit mode
with changing fonts.
For other locales, \fI\*n\fR will use conventional 8bit mode.
.TP
.I checkfont
If mini-luit is compiled-in, \fI\*n\fR will check if a Unicode font has
been specified.
If so, it checks if the character encoding for the
current locale is POSIX, Latin-1 or Latin-9, uses the appropriate
mapping to support those with the Unicode font.
For other encodings, \fI\*n\fR assumes that UTF-8 encoding is required.
.TP
.I false
\fI\*n\fR will use conventional 8bit mode
or UTF-8 mode according to \fButf8\fR resource or \fB\-u8\fP option.
.RE
.IP
Any other value, e.g., \*(``UTF-8\*('' or \*(``ISO8859-2\*('',
is assumed to be an encoding name;
\fIluit\fR will be invoked to support the encoding.
The actual list of supported encodings depends on \fIluit\fR.
The default is \*(``medium\*(''.
.IP
Regardless of your locale and encoding,
you need an ISO-10646-1 font to display the result.
Your configuration may not include this font,
or locale-support by \fI\*n\fP may not be needed.
At startup, \fI\*n\fP uses a mechanism equivalent to
the \fBload-vt-fonts(utf8Fonts,\ Utf8Fonts)\fP action
to load font name subresources of the VT100 widget.
That is,
resource patterns such as \*(``\fB*vt100.utf8Fonts.font\fP\*('' will be loaded,
and (if this resource is enabled), override the normal fonts.
If no subresources are found,
the normal fonts such as \*(``\fB*vt100.font\fP\*('', etc., are used.
The resource files distributed with \fI\*n\fP use ISO-10646-1 fonts,
but do not rely on them unless you are using the locale mechanism.
.TP 8
.B "localeFilter (\fPclass\fB LocaleFilter)"
Specifies the file name for the encoding converter from/to locale
encodings and UTF-8 which is used with the \fB\-lc\fR option or \fBlocale\fR resource.
The help message shown by \*(``\*n \-help\*('' lists the default value,
which depends on your system configuration.
.IP
If the encoding converter requires command-line parameters,
you can add those after the command, e.g.,
.NS
*localeFilter: xterm-filter -p
.NE
.IP
Alternatively,
you may put those parameter within a shell script to execute the converter,
and set this resource to point to the shell script.
.IP
When using a locale-filter, e.g., with the \fI\-e\fP option, or the shell,
\fI\*n\fP first tries passing control via that filter.
If it fails, \fI\*n\fP will retry without the locale-filter.
\fI\*N\fP warns about the failure before retrying.
.TP 8
.B "loginShell (\fPclass\fB LoginShell)"
Specifies whether or not the shell to be run in the window should be started
as a login shell.
The default is \*(``false\*(''.
.TP 8
.B "marginBell (\fPclass\fB MarginBell)"
Specifies whether or not the bell should be rung when the user types near the
right margin.
The default is \*(``false\*(''.
.TP 8
.B "metaSendsEscape (\fPclass\fB MetaSendsEscape\fP)"
If \*(``true\*('', Meta characters
(a character combined with the \fIMeta\fP modifier key)
are converted into a two-character
sequence with the character itself preceded by ESC.
This applies as well to function key control sequences, unless \fI\*n\fP
sees that \fBMeta\fP is used in your key translations.
If \*(``false\*('', Meta characters input from the keyboard are handled according
to the \fBeightBitInput\fP resource.
The default is \*(``__meta_sends_esc__\*(''.
.TP 8
.B "mkSamplePass (\fPclass\fB MkSamplePass)"
If \fBmkSampleSize\fP is nonzero,
and \fBmkWidth\fP (and \fBcjkWidth\fP) are false,
on startup \fI\*n\fP compares its built-in tables to the system's
wide character width data to decide if it will use the system's data.
It tests the first \fBmkSampleSize\fP character values,
and allows up to \fBmkSamplePass\fP mismatches before the test fails.
The default (for the allowed number of mismatches) is 256.
.TP 8
.B "mkSampleSize (\fPclass\fB MkSampleSize)"
With \fBmkSamplePass\fP, this specifies a startup test used for
initializing wide character width calculations.
The default (number of characters to check) is 1024.
.TP 8
.B "mkWidth (\fPclass\fB MkWidth)"
Specifies whether \fI\*n\fP should use a built-in version of the wide
character width calculation.
See also the \fBcjkWidth\fP resource which can override this.
The default is \*(``false\*(''.
.IP
Here is a summary of the resources which control the choice of
wide character width calculation:
.ne 8
.TS
l l l
_ _ _
l l l.
\fIcjkWidth\fR \fImkWidth\fR \fIAction\fP
false false use system tables subject to \fBmkSamplePass\fP
false true use built-in tables
true false use built-in CJK tables
true true use built-in CJK tables
.TE
.TP 8
.B "modifyCursorKeys (\fPclass\fB ModifyCursorKeys\fP)"
Tells how to handle the special case where
Control-, Shift-, Alt- or Meta-modifiers are used to add a parameter to
the escape sequence returned by a cursor-key.
The default is \*(``2\*('':
.RS
.TP 5
\-1
disables the feature.
.TP 5
0
uses the old/obsolete behavior.
.TP 5
1
prefixes modified sequences with CSI.
.TP 5
2
forces the modifier to be the second parameter if it would
otherwise be the first.
.TP 5
3
marks the sequence with a \*(``>\*('' to hint that it is private.
.RE
.TP 8
.B "modifyFunctionKeys (\fPclass\fB ModifyFunctionKeys\fP)"
Tells how to handle the special case where
Control-, Shift-, Alt- or Meta-modifiers are used to add a parameter to
the escape sequence returned by a (numbered) function-key.
The default is \*(``2\*(''.
The resource values are similar to \fBmodifyCursorKeys\fP:
.RS
.TP 5
\-1
permits the user to use shift- and control-modifiers
to construct function-key strings using the normal encoding scheme.
.TP 5
0
uses the old/obsolete behavior.
.TP 5
1
prefixes modified sequences with CSI.
.TP 5
2
forces the modifier to be the second parameter if it would
otherwise be the first.
.TP 5
3
marks the sequence with a \*(``>\*('' to hint that it is private.
.RE
.IP
If \fBmodifyFunctionKeys\fP is zero,
\fI\*n\fP uses Control- and Shift-modifiers to allow the user to
construct numbered function-keys beyond the set provided by the
keyboard:
.RS
.TP 5
Control
adds the value given by the \fBctrlFKeys\fP resource.
.TP 5
Shift
adds twice the value given by the \fBctrlFKeys\fP resource.
.TP 5
Control/Shift
adds three times the value given by the \fBctrlFKeys\fP resource.
.RE
.IP
.TP 8
.B "modifyKeyboard (\fPclass\fB ModifyKeyboard\fP)"
Normally \fI\*n\fP makes a special case regarding
modifiers (shift, control, etc.)
to handle special keyboard layouts (\fBlegacy\fP and \fBvt220\fP).
This is done to provide compatible keyboards for DEC VT220 and related
terminals that implement user-defined keys (UDK).
.IP
The bits of the resource value selectively enable
modification of the given category when these keyboards are selected.
The default is \*(``0\*('':
.RS
.TP 5
0
The legacy/vt220 keyboards interpret only the
Control-modifier when constructing numbered function-keys.
Other special keys are not modified.
.TP 5
1
allows modification of the numeric keypad
.TP 5
2
allows modification of the editing keypad
.TP 5
4
allows modification of function-keys,
overrides use of Shift-modifier for UDK.
.TP 5
8
allows modification of other special keys
.RE
.TP 8
.B "modifyOtherKeys (\fPclass\fB ModifyOtherKeys\fP)"
Like \fBmodifyCursorKeys\fP, tells \fI\*n\fP to construct an
escape sequence for other keys (such as \*(``2\*('') when modified by
Control-, Alt- or Meta-modifiers.
This feature does not apply to function keys and well-defined
keys such as ESC or the control keys.
The default is \*(``0\*('':
.RS
.TP 5
0
disables this feature.
.TP 5
1
enables this feature for keys except for those with
well-known behavior, e.g., Tab, Backarrow and some special
control character cases, e.g., Control-Space to make a NUL.
.TP 5
2
enables this feature for keys including the exceptions listed.
.RE
.TP 8
.B "multiClickTime (\fPclass\fB MultiClickTime)"
Specifies the maximum time in milliseconds between multi-click select
events.
The default is \*(``250\*('' milliseconds.
.TP 8
.B "multiScroll (\fPclass\fB MultiScroll)"
Specifies whether or not scrolling should be done asynchronously.
The default is \*(``false\*(''.
.TP 8
.B "nMarginBell (\fPclass\fB Column)"
Specifies the number of characters from the right margin at which the margin
bell should be rung, when enabled by the \fBmarginBell\fP resource.
The default is \*(``10\*(''.
.TP 8
.B "numLock (\fPclass\fB NumLock)"
If \*(``true\*('', \fI\*n\fR checks if NumLock is used as a modifier (see \fIxmodmap\fP(__mansuffix__)).
If so, this modifier is used to simplify the logic when implementing special
NumLock for the \fBsunKeyboard\fP resource.
Also (when \fBsunKeyboard\fP is false), similar logic is used to find the
modifier associated with the left and right Alt keys.
The default is \*(``true\*(''.
.TP 8
.B "oldXtermFKeys (\fPclass\fB OldXtermFKeys)"
If \*(``true\*('', \fI\*n\fR will use old-style control sequences for function keys F1 to F4,
for compatibility with X Consortium \fI\*n\fR.
Otherwise, it uses the VT100-style
codes for PF1 to PF4.
The default is \*(``false\*(''.
.TP 8
.B "on2Clicks (\fPclass\fB On2Clicks)"
.TP
.B "on3Clicks (\fPclass\fB On3Clicks)"
.TP
.B "on4Clicks (\fPclass\fB On4Clicks)"
.TP
.B "on5Clicks (\fPclass\fB On5Clicks)"
Specify selection behavior in response to multiple mouse clicks.
A single mouse click is always interpreted as described in
the \fBSELECTION\fP section (see \fBPOINTER USAGE\fP).
Multiple mouse clicks (using the button which activates the \fBselect-start\fP
action) are interpreted according to the resource values of
\fBon2Clicks\fP, etc.
The resource value can be one of these:
.RS
.TP 3
word
Select a \*(``word\*('' as determined by the \fBcharClass\fP resource.
See the \fBCHARACTER CLASSES\fP section.
.TP
line
Select a line (counting wrapping).
.TP
group
Select a group of adjacent lines (counting wrapping).
The selection stops on a blank line,
and does not extend outside the current page.
.TP
page
Select all visible lines, i.e., the page.
.TP
all
Select all lines, i.e., including the saved lines.
.TP
regex
Select a \*(``word\*('' as determined by the regular expression which
follows in the resource value.
.TP
none
No selection action is associated with this resource.
\fI\*n\fP interprets it as the end of the list.
For example, you may use it to disable triple (and higher) clicking
by setting \fBon3Clicks\fP to \*(``none\*(''.
.RE
.IP
The default values for \fBon2Clicks\fP and \fBon3Clicks\fP are
\*(``word\*('' and \*(``line\*('', respectively.
There is no default value for \fBon4Clicks\fP or \fBon5Clicks\fP,
making those inactive.
On startup, \fI\*n\fP determines the maximum number of clicks
by the \fBon\fP\fIX\fP\fBClicks\fP resource values which are set.
.TP 8
.B "openIm (\fPclass\fB XtCOpenIm)"
Tells \fI\*n\fP whether to open the input method at startup.
The default is \*(``true\*(''.
.TP 8
.B "pointerColor (\fPclass\fB PointerColor)"
Specifies the foreground color of the pointer.
The default is
\*(``XtDefaultForeground\*(''.
.TP 8
.B "pointerColorBackground (\fPclass\fB PointerColorBackground)"
Specifies the background color of the pointer.
The default is
\*(``XtDefaultBackground\*(''.
.TP 8
.B "pointerMode (\fPclass\fB PointerMode)"
Specifies when the pointer may be hidden as the user types.
It will be redisplayed if the user moves the mouse,
or clicks one of its buttons.
.RS
.TP 3
0
never
.TP 3
1
the application running in \fI\*n\fP has not activated mouse mode.
This is the default.
.TP 3
2
always.
.RE
.TP 8
.B "pointerShape (\fPclass\fB Cursor)"
Specifies the name of the shape of the pointer.
The default is \*(``xterm\*(''.
.TP 8
.B "popOnBell (\fPclass\fB PopOnBell)"
Specifies whether the window would be raised when Control-G is received.
The default is \*(``false\*(''.
.IP
If the window is iconified, this has no effect.
However, the \fBzIconBeep\fP resource provides you with the ability to
see which iconified windows have sounded a bell.
.TP 8
.B "precompose (\fPclass\fB XtCPrecompose)"
Tells \fI\*n\fP whether to precompose UTF-8 data into Normalization Form C,
which combines commonly-used accents onto base characters.
If it does not do this, accents are left as separatate characters.
The default is \*(``true\*(''.
.TP 8
.B "preeditType (\fPclass\fB XtCPreeditType)"
Tells \fI\*n\fP which types of preedit (preconversion) string to display.
The default is \*(``OverTheSpot,Root\*(''.
.TP 8
.B "printAttributes (\fPclass\fB PrintAttributes)"
Specifies whether to print graphic attributes along with the text.
A real DEC VTxxx terminal will print the underline, highlighting codes
but your printer may not handle these.
.RS
.bP
\*(``0\*('' disables the attributes.
.bP
\*(``1\*('' prints the normal set of attributes (bold, underline, inverse and blink)
as VT100-style control sequences.
.bP
\*(``2\*('' prints ANSI color attributes as well.
.RE
.IP
The default is \*(``1\*(''.
.TP 8
.B "printFileImmediate (\fPPrintFileImmediate)"
When the \fBprint-immediate\fP action is invoked,
\fI\*n\fP prints the screen contents directly to a file.
Set this resource to the prefix of the filename
(a timestamp will be appended to the actual name).
.IP
The default is an empty string, i.e., \*(``\*('',
However, when the \fBprint-immediate\fP action is invoked,
if the string is empty, then \*(``__default_class__\*('' is used.
.TP 8
.B "printFileOnXError (\fPPrintFileOnXError)"
If \fI\*n\fP exits with an X error,
e.g., your connection is broken when the server crashes,
it can be told to write the contents of the screen to a file.
To enable the feature, set this resource to the prefix of the filename
(a timestamp will be appended to the actual name).
.IP
The default is an empty string, i.e., \*(``\*('',
which disables this feature.
However, when the \fBprint-on-error\fP action is invoked,
if the string is empty, then \*(``XTermError\*('' is used.
.IP
These error codes are handled:
ERROR_XERROR,
ERROR_XIOERROR and
ERROR_ICEERROR.
.TP 8
.B "printModeImmediate (\fPPrintModeImmediate)"
When the \fBprint-immediate\fP action is invoked,
\fI\*n\fP prints the screen contents directly to a file.
You can use the \fBprintModeImmediate\fP resource to tell it to
use escape sequences to reconstruct the video attributes and colors.
This uses the same values as the \fBprintAttributes\fP resource.
The default is \*(``0\*(''.
.TP 8
.B "printModeOnXError (\fPPrintModeOnXError)"
\fI\*N\fP implements the \fBprintFileOnXError\fP feature using
the printer feature, although the output is written directly to a file.
You can use the \fBprintModeOnXError\fP resource to tell it to
use escape sequences to reconstruct the video attributes and colors.
This uses the same values as the \fBprintAttributes\fP resource.
The default is \*(``0\*(''.
.TP 8
.B "printOptsImmediate (\fPPrintOptsImmediate)"
Specify the range of text which is printed to a file when
the \fBprint-immediately\fP action is invoked.
.RS
.bP
If zero (0), then this selects the current (visible screen) plus the
saved lines, except if the alternate screen is being used.
In that case, only the alternate screen is selectd.
.bP
If nonzero,
the bits of this resource value (checked in descending order)
select the range:
.RS
.TP 3
8
selects the saved lines.
.TP 3
4
selects the alternate screen.
.TP 3
2
selects the normal screen.
.TP 3
1
selects the current screen,
which can be either the normal or alternate screen.
.RE
.RE
.IP
The default is \*(``9\*('', which selects the current visible screen
plus saved lines, with no special case for the alternated screen.
.TP 8
.B "printOptsOnXError (\fPPrintOptsOnXError)"
Specify the range of text which is printed to a file when
the \fBprint-on-error\fP action is invoked.
The resource value is interpreted the same as in \fBprintOptsImmediate\fP.
.IP
The default is \*(``9\*('', which selects the current visible screen
plus saved lines, with no special case for the alternated screen.
.TP 8
.B "printerAutoClose (\fPclass\fB PrinterAutoClose)"
If \*(``true\*('', \fI\*n\fR will close the printer (a pipe) when the application switches
the printer offline with a Media Copy command.
The default is \*(``false\*(''.
.TP 8
.B "printerCommand (\fPclass\fB PrinterCommand)"
Specifies a shell command to which
.I \*n
will open a pipe when the first
MC (Media Copy) command is initiated.
The default is an empty string, i.e., \*(``\*(''.
If the resource value is given as an empty string, the printer is disabled.
.TP 8
.B "printerControlMode (\fPclass\fB PrinterControlMode)"
Specifies the printer control mode.
A \*(``1\*('' selects autoprint mode, which causes
.I \*n
to print a line from the screen when you move the cursor off that
line with a line feed, form feed or vertical tab character, or an
autowrap occurs.
Autoprint mode is overridden by printer controller mode (a \*(``2\*(''),
which causes all of the output to be directed to the printer.
The default is \*(``0\*(''.
.TP 8
.B "printerExtent (\fPclass\fB PrinterExtent)"
Controls whether a print page function will print the entire page (true), or
only the the portion within the scrolling margins (false).
The default is \*(``false\*(''.
.TP 8
.B "printerFormFeed (\fPclass\fB PrinterFormFeed)"
Controls whether a form feed is sent to the printer at the end of a print
page function.
The default is \*(``false\*(''.
.TP 8
.B "printerNewLine (\fPclass\fB PrinterNewLine)"
Controls whether a newline is sent to the printer at the end of a print
page function.
The default is \*(``true\*(''.
.TP 8
.B "privateColorRegisters (\fPclass\fB privateColorRegisters)"
If true, allocate separate color registers for each sixel
device control string, e.g., for DECGCI.
If not true, color registers are allocated only once,
when the terminal is reset.
The default is \*(``true\*(''.
.TP 8
.B "quietGrab (\fPclass\fB QuietGrab)"
Controls whether the cursor is repainted
when \fINotifyGrab\fP and \fINotifyUngrab\fP
event types are received during change of focus.
The default is \*(``false\*(''.
.TP 8
.B "renderFont (\fPclass\fB RenderFont)"
If \fI\*n\fR is built with the Xft library,
this controls whether the \fBfaceName\fR resource is used.
The default is \*(``default\*(''.
.IP
The resource values are strings, evaluated as booleans after startup.
.RS
.TP 5
false
.br
disable the feature and use the normal (bitmap) font.
.TP 5
true
.br
startup using the TrueType font specified by the \fBfaceName\fP and
\fBfaceSize\fP resource settings.
If there is no value for \fBfaceName\fP, disable the feature and use
the normal (bitmap) font.
.IP
After startup, you can still switch to/from the bitmap font using the
\*(``TrueType Fonts\*('' menu entry.
.TP 5
default
.br
startup using the normal (bitmap) font,
but enable the \*(``TrueType Fonts\*(''
menu entry to allow runtime switching to/from TrueType fonts.
.IP
If there is no \fBfaceName\fP resource set,
then runtime switching to TrueType fonts is disabled.
\fI\*N\fP has a separate compiled-in value for \fBfaceName\fP
for the special case where \fBrenderFont\fP is \*(``default\*(''.
That is normally \*(``mono\*(''.
.RE
.TP 8
.B "resizeGravity (\fPclass\fB ResizeGravity)"
Affects the behavior when the window is resized to be taller or
shorter.
\fBNorthWest\fP
specifies that the top line of text on the screen stay fixed.
If the window
is made shorter, lines are dropped from the bottom; if the window is
made taller, blank lines are added at the bottom.
This is compatible
with the behavior in R4.
\fBSouthWest\fP (the default) specifies that
the bottom line of text on the screen stay fixed.
If the window is
made taller, additional saved lines will be scrolled down onto the
screen; if the window is made shorter, lines will be scrolled off the
top of the screen, and the top saved lines will be dropped.
.TP 8
.B "retryInputMethod (\fPclass\fB XtCRetryInputMethod)"
Tells \fI\*n\fP how many times to retry,
in case the input-method server is not responding.
This is a different issue than unsupported preedit type, etc.
You may encounter retries if your X configuration (and its libraries)
are missing pieces.
Setting this resource to zero ``0'' will cancel the retrying.
The default is ``3''.
.TP 8
.B "reverseVideo (\fPclass\fB ReverseVideo)"
Specifies whether or not reverse video should be simulated.
The default is
\*(``false\*(''.
.IP
There are several aspects to reverse video in \fI\*n\fP:
.RS
.bP
The command-line \fB\-rv\fP option tells the X libraries to reverse
the foreground and background colors.
\fI\*N\fP's command-line options set resource values.
In particular, the X Toolkit sets the \fBreverseVideo\fP resource
when the \fB\-rv\fP option is used.
.bP
If the user has also used command-line options \fB\-fg\fP or \fB\-bg\fP
to set the foreground and background colors,
\fI\*n\fP does not see these options directly.
Instead,
it examines the resource values to reconstruct the command-line options,
and determine which of the colors is the user's intended foreground, etc.
Their actual values are irrelevant to the reverse video function;
some users prefer the X defaults (black text on a white background),
others prefer white text on a black background.
.bP
After startup,
the user can toggle the \*(``Enable Reverse Video\*('' menu entry.
This exchanges the current foreground and background colors
of the VT100 widget,
and repaints the screen.
Because of the X resource hierarchy,
the \fBreverseVideo\fP resource applies to more than the VT100 widget.
.RE
.IP
Programs running in an \fI\*n\fP can also use control sequences
to enable the VT100 reverse video mode.
These are independent of the \fIreverseVideo\fP resource and the menu entry.
\fI\*N\fP exchanges the current foreground and background colors
when drawing text affected by these control sequences.
.IP
Other control sequences can alter the foreground and background colors
which are used:
.RS
.bP
Programs can also use the ANSI color control sequences to set the
foreground and background colors.
.bP
Extensions to the ANSI color controls (such as 16-, 88- or 256-colors)
are treated similarly to the ANSI control.
.bP
Using other control sequences (the \*(``\fIdynamic colors\fR\*('' feature),
a program can change the foreground and background colors.
.RE
.TP 8
.B "reverseWrap (\fPclass\fB ReverseWrap)"
Specifies whether or not reverse-wraparound should be enabled.
This corresponds to \fI\*n\fP's private mode 45.
The default is
\*(``false\*(''.
.TP 8
.B "rightScrollBar (\fPclass\fB RightScrollBar)"
Specifies whether or not the scrollbar should be displayed on the right
rather than the left.
The default is \*(``false\*(''.
.TP 8
.B "saveLines (\fPclass\fB SaveLines)"
Specifies the number of lines to save beyond the top of the screen when a
scrollbar is turned on.
The default is \*(``64\*(''.
.TP 8
.B "scrollBar (\fPclass\fB ScrollBar)"
Specifies whether or not the scrollbar should be displayed.
The default is
\*(``false\*(''.
.TP 8
.B "scrollBarBorder (\fPclass\fB ScrollBarBorder)"
Specifies the width of the scrollbar border.
Note that this is drawn to overlap the border of the \fI\*n\fP window.
Modifying the scrollbar's border affects only the line between the VT100
widget and the scrollbar.
The default value is 1.
.TP 8
.B "scrollKey (\fPclass\fB ScrollCond)"
Specifies whether or not pressing a key should automatically cause the
scrollbar to go to the bottom of the scrolling region.
This corresponds to \fI\*n\fP's private mode 1011.
The default is
\*(``false\*(''.
.TP 8
.B "scrollLines (\fPclass\fB ScrollLines)"
Specifies the number of lines that the \fIscroll-back\fP and
\fBscroll-forw\fP actions should use as a default.
The default value is 1.
.TP 8
.B "scrollTtyOutput (\fPclass\fB ScrollCond)"
Specifies whether or not output to the terminal should automatically cause
the scrollbar to go to the bottom of the scrolling region.
The default is \*(``true\*(''.
.TP
.B "selectToClipboard (\fPclass\fB SelectToClipboard)"
Tells \fI\*n\fP whether to use the PRIMARY or CLIPBOARD for
SELECT tokens in the selection mechanism.
The \fBset-select\fP action can change this at runtime,
allowing the user to work with programs that handle only one of these
mechanisms.
The default is \*(``false\*('', which tells it to use PRIMARY.
.TP 8
.B "shiftFonts (\fPclass\fB ShiftFonts)"
Specifies whether to enable the actions
\fBlarger-vt-font()\fP and
\fBsmaller-vt-font()\fP, which are normally bound to
the shifted KP_Add and KP_Subtract.
The default is \*(``true\*(''.
.TP 8
.B "showBlinkAsBold (\fPclass\fB ShowBlinkAsBold)"
Tells \fI\*n\fP whether to display text with blink-attribute the same
as bold.
If \fI\*n\fP has not been configured to support blinking text,
the default is \*(``true\*('', which corresponds to older versions of \fI\*n\fP,
otherwise the default is \*(``false\*(''.
.TP 8
.B "showMissingGlyphs (\fPclass\fB ShowMissingGlyphs)"
Tells \fI\*n\fP whether to display a box outlining places where
a character has been used that the font does not represent.
The default is \*(``false\*(''.
.TP 8
.B "showWrapMarks (\fPclass\fB ShowWrapMarks)"
For debugging \fI\*n\fP and applications that may manipulate the
wrapped-line flag by writing text at the right margin,
show a mark on the right inner-border of the window.
The mark shows which lines have the flag set.
.TP 8
.B "signalInhibit (\fPclass\fB SignalInhibit)"
Specifies whether or not the entries in the \*(``Main Options\*('' menu for sending
signals to \fI\*n\fP should be disallowed.
The default is \*(``false\*(''.
.TP 8
.B "sixelScrolling (\fPclass\fB SixelScrolling)"
If true, graphics scroll up one line at a time when sixels would be written
past the bottom line on the window.
The default is \*(``false\*(''.
.TP 8
.B "tekGeometry (\fPclass\fB Geometry)"
Specifies the preferred size and position of the Tektronix window.
There is no default for this resource.
.TP 8
.B "tekInhibit (\fPclass\fB TekInhibit)"
Specifies whether or not
the escape sequence to enter
Tektronix mode should be ignored.
The default is
\*(``false\*(''.
.TP 8
.B "tekSmall (\fPclass\fB TekSmall)"
Specifies whether or not the Tektronix mode window should start in its smallest
size if no explicit geometry is given.
This is useful when running \fI\*n\fP
on displays with small screens.
The default is \*(``false\*(''.
.TP 8
.B "tekStartup (\fPclass\fB TekStartup)"
Specifies whether or not \fI\*n\fP should start up in Tektronix mode.
The default is \*(``false\*(''.
.TP 8
.B "tiXtraScroll (\fPclass\fB TiXtraScroll)"
Specifies whether \fI\*n\fP should scroll to a new page when processing
the \fIti\fP termcap entry, i.e., the private modes 47, 1047 or 1049.
This is only in effect if \fBtiteInhibit\fP is \*(``true\*('',
because the intent of this option is to provide a picture of the full-screen
application's display on the scrollback without wiping out the text that
would be shown before the application was initialized.
The default for this resource is \*(``false\*(''.
.TP 8
.B "titeInhibit (\fPclass\fB TiteInhibit)"
Specifies whether or not \fI\*n\fP should remove \fIti\fP and \fIte\fP
termcap entries (used to switch between alternate screens on startup of many
screen-oriented programs) from the TERMCAP string.
If set,
\fI\*n\fP also ignores the escape sequence to switch to the
alternate screen.
\fI\*N\fP supports terminfo in a different way, supporting composite control
sequences (also known as private modes) 1047, 1048 and 1049 which have the same
effect as the original 47 control sequence.
The default for this resource is \*(``false\*(''.
.TP 8
.B "titleModes (\fPclass\fB TitleModes)"
Tells \fI\*n\fP whether to accept or return
window- and icon-labels in ISO-8859-1
(the default) or UTF-8.
Either can be encoded in hexadecimal.
The default for this resource is \*(``0\*(''.
.IP
Each bit (bit \*(``0\*('' is 1, bit \*(``1\*('' is 2, etc.)
corresponds to one of the
parameters set by the title modes control sequence:
.RS
.TP 5
0
Set window/icon labels using hexadecimal
.TP 5
1
Query window/icon labels using hexadecimal
.TP 5
2
Set window/icon labels using UTF-8 (overrides \fButf8Title\fP resource).
.TP 5
3
Query window/icon labels using UTF-8
.RE
.TP 8
.B "translations (\fPclass\fB Translations)"
Specifies the key and button bindings for menus, selections, \*(``programmed
strings\*('', etc.
The \fBtranslations\fP resource,
which provides much of \fI\*n\fP's configurability,
is a feature of the X Toolkit Intrinsics library (Xt).
See the \fBACTIONS\fP section.
.TP 8
.B "trimSelection (\fPclass\fB TrimSelection)"
If you set \fBhighlightSelection\fP,
you can see the text which is selected, including any trailing spaces.
Clearing the screen (or a line) resets it to a state containing no spaces.
Some lines may contain trailing spaces when an application writes them to
the screen.
However, you may not wish to paste lines with trailing spaces.
If this resource is true, \fI\*n\fP will trim trailing spaces from
text which is selected.
It does not affect spaces which result in a wrapped line, nor will it
trim the trailing newline from your selection.
The default is \*(``false\*(''.
.TP 8
.B "underLine (\fPclass\fB UnderLine)"
This specifies whether or not text with the underline attribute should be
underlined.
It may be desirable to disable underlining when color is being
used for the underline attribute.
The default is \*(``true\*(''.
.TP 8
.B "useClipping (\fPclass\fB UseClipping)"
Tell \fI\*n\fP whether to use clipping to keep
from producing dots outside the text drawing area.
Originally used to work around for overstriking effects,
this is also needed to work with some incorrectly-sized fonts.
The default is \*(``true\*(''.
.TP 8
.B "utf8 (\fPclass\fB Utf8)"
This specifies whether \fI\*n\fP will run in UTF-8 mode.
If you set this resource, \fI\*n\fP also sets the \fBwideChars\fP resource as a side-effect.
The resource can be set via the menu entry \*(``UTF-8 Encoding\*(''.
The default is \*(``default\*(''.
.IP
\fI\*N\fP accepts either a keyword (ignoring case)
or the number shown in parentheses:
.RS
.TP 3
false (0)
UTF-8 mode is initially off.
The command-line option \fB+u8\fP sets the resource to this value.
Escape sequences for turning UTF-8 mode on/off are allowed.
.TP
true (1)
UTF-8 mode is initially on.
Escape sequences for turning UTF-8 mode on/off are allowed.
.TP
always (2)
The command-line option \fB\-u8\fP sets the resource to this value.
Escape sequences for turning UTF-8 mode on/off are ignored.
.TP
default (3)
This is the default value of the resource.
It is changed during initialization depending on
whether the \fBlocale\fP resource was set,
to false (0) or always (2).
See the \fBlocale\fR resource for additional discussion of non-UTF-8 locales.
.RE
.IP
If you want to set the value of \fButf8\fP, it should be in this range.
Other nonzero values are treated the same as \*(``1\*('',
i.e., UTF-8 mode is initially on, and
escape sequences for turning UTF-8 mode on/off are allowed.
.TP 8
.B "utf8Fonts (\fPclass\fB Utf8Fonts)"
See the discussion of the \fBlocale\fP resource.
This specifies whether \fI\*n\fP will use UTF-8 fonts specified via
resource patterns such as \*(``\fB*vt100.utf8Fonts.font\fP\*(''
or normal (ISO-8859-1) fonts via patterns such as \*(``\fB*vt100.font\fP\*(''.
The resource can be set via the menu entry \*(``UTF-8 Fonts\*(''.
The default is \*(``default\*(''.
.IP
\fI\*N\fP accepts either a keyword (ignoring case)
or the number shown in parentheses:
.RS
.TP
false (0)
Use the ISO-8859-1 fonts.
The menu entry is enabled, allowing the choice of fonts to be changed
at runtime.
.TP
true (1)
Use the UTF-8 fonts.
The menu entry is enabled, allowing the choice of fonts to be changed
at runtime.
.TP
always (2)
Always use the UTF-8 fonts.
This also disables the menu entry.
.TP
default (3)
At startup, the resource is set to true or false,
according to the effective value of the \fButf8\fP resource.
.RE
.TP 8
.B "utf8Latin1 (\fPclass\fB Utf8Latin1)"
If true,
allow an ISO-8859-1 \fInormal\fP
font to be combined with an ISO-10646 font if the latter is given
via the \fB\-fw\fP option or its corresponding resource value.
The default is \*(``false\*(''.
.TP 8
.B "utf8SelectTypes (\fPclass\fB Utf8SelectTypes)"
Override \fI\*n\fP's default selection target list (see SELECT/PASTE) for
selections in wide-character (UTF-8) mode.
The default is an empty string, i.e., \*(``\*('',
which does not override anything.
.TP 8
.B "utf8Title (\fPclass\fB Utf8Title)"
Applications can set \fI\*n\fP's title by writing a control sequence.
Normally this control sequence follows the VT220 convention,
which encodes the string in ISO-8859-1 and
allows for an 8-bit string terminator.
If \fI\*n\fP is started in a UTF-8 locale,
it translates the ISO-8859-1 string to UTF-8 to work with the X libraries
which assume the string is UTF-8.
.IP
However, some users may wish to write a title string encoded in UTF-8.
The window manager is responsible for drawing window titles.
Some window managers (not all) support UTF-8 encoding of window titles.
Set this resource to \*(``true\*('' to allow UTF-8 encoded title strings.
That cancels the translation to UTF-8,
allowing UTF-8 strings to be displayed as is.
.IP
This feature is available as a menu entry, since it is related to
the particular applications you are running within \fI\*n\fP.
You can also use a control sequence
(see the discussion of \*(``Title Modes\*(''
in the control sequences document), to set an equivalent flag.
The \fBtitleModes\fP resource sets the same value,
which overrides this resource.
.IP
The default is \*(``false\*(''.
.TP 8
.B "veryBoldColors (\fPclass\fB VeryBoldColors)"
Specifies whether to combine video attributes with colors specified by
\fBcolorBD\fR, \fBcolorBL\fR, \fBcolorRV\fR and \fBcolorUL\fR.
The resource value is the sum of values for each attribute:
.RS 10
.nf
1 for reverse,
2 for underline,
4 for bold and
8 for blink.
.fi
.RE
.IP
The default is \*(``0\*(''.
.TP 8
.B "visualBell (\fPclass\fB VisualBell)"
Specifies whether or not a visible bell (i.e., flashing) should be used instead
of an audible bell when Control-G is received.
The default is \*(``false\*('', which tells \fI\*n\fP to use an audible bell.
.TP 8
.B "visualBellDelay (\fPclass\fB VisualBellDelay)"
Number of milliseconds to delay when displaying a visual bell.
Default is 100.
If set to zero, no visual bell is displayed.
This is useful for very slow displays, e.g., an LCD display on a laptop.
.TP 8
.B "visualBellLine (\fPclass\fB VisualBellLine)"
Specifies whether to flash only the current line when displaying a visual bell.
rather than flashing the entire screen:
The default is \*(``false\*('',
which tells \fI\*n\fP to flash the entire screen.
.TP 8
.B "vt100Graphics (\fPclass\fB VT100Graphics)"
This specifies whether \fI\*n\fP will interpret VT100 graphic character
escape sequences while in UTF-8 mode.
The default is \*(``true\*('', to provide support for various legacy applications.
.TP 8
.B "wideBoldFont (\fPclass\fB WideBoldFont)"
This option specifies the font to be used for displaying bold wide text.
By default,
it will attempt to use a font twice as wide as the font that will be used to
draw bold text.
If no double-width font is found, it will improvise, by stretching
the bold font.
.TP 8
.B "wideChars (\fPclass\fB WideChars)"
Specifies if \fI\*n\fP should respond to control sequences that
process 16-bit characters.
The default is \*(``false\*(''.
.TP 8
.B "wideFont (\fPclass\fB WideFont)"
This option specifies the font to be used for displaying wide text.
By default,
it will attempt to use a font twice as wide as the font that will be used to
draw normal text.
If no double-width font is found, it will improvise, by stretching
the normal font.
.TP 8
.B "ximFont (\fPclass\fB XimFont)"
This option specifies the font to be used for displaying the preedit string
in the \*(``OverTheSpot\*('' input method.
.IP
In \*(``OverTheSpot\*('' preedit type, the preedit (preconversion)
string is displayed at the position of the cursor.
It is the XIM server's responsibility to display the preedit string.
The XIM client must inform the XIM server of the cursor position.
For best results, the preedit string must be displayed with a proper font.
Therefore, \fI\*n\fP informs the XIM server of the proper font.
The font is be supplied by a "fontset", whose default value is \*(``*\*(''.
This matches every font, the X library automatically chooses fonts with
proper charsets.
The \fBximFont\fP resource is provided to override this default font setting.
.\"
.SS Tek4014 Widget Resources
.PP
The following resources are specified
as part of the \fItek4014\fP widget (class \fITek4014\fP).
These are specified by patterns such as \*(``\fB__default_class__.tek4014.\fP\fINAME\fP\*('':
.TP 8
.B "font2 (\fPclass\fB Font)"
Specifies font number 2 to use in the Tektronix window.
.TP 8
.B "font3 (\fPclass\fB Font)"
Specifies font number 3 to use in the Tektronix window.
.TP 8
.B "fontLarge (\fPclass\fB Font)"
Specifies the large font to use in the Tektronix window.
.TP 8
.B "fontSmall (\fPclass\fB Font)"
Specifies the small font to use in the Tektronix window.
.TP 8
.B "ginTerminator (\fPclass\fB GinTerminator)"
Specifies what character(s) should follow a GIN report or status report.
The possibilities are \*(``none\*('', which sends no terminating characters,
\*(``CRonly\*('', which sends CR, and \*(``CR&EOT\*('', which sends both CR and EOT.
The default is \*(``none\*(''.
.TP 8
.B "height (\fPclass\fB Height)"
Specifies the height of the Tektronix window in pixels.
.TP 8
.B "initialFont (\fPclass\fB InitialFont)"
Specifies which of the four Tektronix fonts to use initially.
Values are the same as for the \fBset-tek-text\fP action.
The default is \*(``large\*(''.
.TP 8
.B "width (\fPclass\fB Width)"
Specifies the width of the Tektronix window in pixels.
.\"
.SS Menu Resources
.PP
The resources that may be specified for the various menus are described in
the documentation for the Athena \fBSimpleMenu\fP widget.
The name and classes of the entries in each of the menus are listed below.
Resources named \*(``\fBline\fR\fIN\fR\*('' where \fIN\fR is a number
are separators with class \fBSmeLine\fR.
.PP
As with all X resource-based widgets,
the labels mentioned are customary defaults for the application.
.
.PP
The \fIMain Options\fP menu (widget name \fImainMenu\fP)
has the following entries:
.TP 8
.B "toolbar (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-toolbar(toggle)\fP action.
.TP 8
.B "securekbd (\fPclass\fB SmeBSB)"
This entry invokes the \fBsecure()\fP action.
.TP 8
.B "allowsends (\fPclass\fB SmeBSB)"
This entry invokes the \fBallow-send-events(toggle)\fP action.
.TP 8
.B "redraw (\fPclass\fB SmeBSB)"
This entry invokes the \fBredraw()\fP action.
.TP 8
.B "logging (\fPclass\fB SmeBSB)"
This entry invokes the \fBlogging(toggle)\fP action.
.TP 8
.B "print-immediate (\fPclass\fB SmeBSB)"
This entry invokes the \fBprint-immediate()\fP action.
.TP 8
.B "print-on-error (\fPclass\fB SmeBSB)"
This entry invokes the \fBprint-on-error()\fP action.
.TP 8
.B "print (\fPclass\fB SmeBSB)"
This entry invokes the \fBprint()\fP action.
.TP 8
.B "print-redir (\fPclass\fB SmeBSB)"
This entry invokes the \fBprint-redir()\fP action.
.TP 8
.B "8-bit-control (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-8-bit-control(toggle)\fP action.
.TP 8
.B "backarrow\ key (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-backarrow(toggle)\fP action.
.TP 8
.B "num-lock (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-num-lock(toggle)\fP action.
.TP 8
.B "alt-esc (\fPclass\fB SmeBSB)"
This entry invokes the \fBalt-sends-escape(toggle)\fP action.
.TP 8
.B "meta-esc (\fPclass\fB SmeBSB)"
This entry invokes the \fBmeta-sends-escape(toggle)\fP action.
.TP 8
.B "delete-is-del (\fPclass\fB SmeBSB)"
This entry invokes the \fBdelete-is-del(toggle)\fP action.
.TP 8
.B "oldFunctionKeys (\fPclass\fB SmeBSB)"
This entry invokes the \fBold-function-keys(toggle)\fP action.
.TP 8
.B "hpFunctionKeys (\fPclass\fB SmeBSB)"
This entry invokes the \fBhp-function-keys(toggle)\fP action.
.TP 8
.B "scoFunctionKeys (\fPclass\fB SmeBSB)"
This entry invokes the \fBsco-function-keys(toggle)\fP action.
.TP 8
.B "sunFunctionKeys (\fPclass\fB SmeBSB)"
This entry invokes the \fBsun-function-keys(toggle)\fP action.
.TP 8
.B "sunKeyboard (\fPclass\fB SmeBSB)"
This entry invokes the \fBsunKeyboard(toggle)\fP action.
.TP 8
.B "suspend (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(tstp)\fP action on systems that
support job control.
.TP 8
.B "continue (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(cont)\fP action on systems that
support job control.
.TP 8
.B "interrupt (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(int)\fP action.
.TP 8
.B "hangup (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(hup)\fP action.
.TP 8
.B "terminate (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(term)\fP action.
.TP 8
.B "kill (\fPclass\fB SmeBSB)"
This entry invokes the \fBsend-signal(kill)\fP action.
.TP 8
.B "quit (\fPclass\fB SmeBSB)"
This entry invokes the \fBquit()\fP action.
.
.PP
The \fIVT Options\fP menu (widget name \fIvtMenu\fP)
has the following entries:
.TP 8
.B "scrollbar (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-scrollbar(toggle)\fP action.
.TP 8
.B "jumpscroll (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-jumpscroll(toggle)\fP action.
.TP 8
.B "reversevideo (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-reverse-video(toggle)\fP action.
.TP 8
.B "autowrap (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-autowrap(toggle)\fP action.
.TP 8
.B "reversewrap (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-reversewrap(toggle)\fP action.
.TP 8
.B "autolinefeed (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-autolinefeed(toggle)\fP action.
.TP 8
.B "appcursor (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-appcursor(toggle)\fP action.
.TP 8
.B "appkeypad (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-appkeypad(toggle)\fP action.
.TP 8
.B "scrollkey (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-scroll-on-key(toggle)\fP action.
.TP 8
.B "scrollttyoutput (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-scroll-on-tty-output(toggle)\fP action.
.TP 8
.B "allow132 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-allow132(toggle)\fP action.
.TP 8
.B "cursesemul (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-cursesemul(toggle)\fP action.
.TP 8
.B "visualbell (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-visualbell(toggle)\fP action.
.TP 8
.B "bellIsUrgent (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-bellIsUrgent(toggle)\fP action.
.TP 8
.B "poponbell (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-poponbell(toggle)\fP action.
.TP 8
.B "cursorblink (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-cursorblink(toggle)\fP action.
.TP 8
.B "titeInhibit (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-titeInhibit(toggle)\fP action.
.TP 8
.B "activeicon (\fPclass\fB SmeBSB)"
This entry toggles active icons on and off if this feature was
compiled into \fI\*n\fP.
It is enabled only if \fI\*n\fP
was started with the command line option +ai or the \fBactiveIcon\fP
resource is set to \*(``true\*(''.
.TP 8
.B "softreset (\fPclass\fB SmeBSB)"
This entry invokes the \fBsoft-reset()\fP action.
.TP 8
.B "hardreset (\fPclass\fB SmeBSB)"
This entry invokes the \fBhard-reset()\fP action.
.TP 8
.B "clearsavedlines (\fPclass\fB SmeBSB)"
This entry invokes the \fBclear-saved-lines()\fP action.
.TP 8
.B "tekshow (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-visibility(tek,toggle)\fP action.
.TP 8
.B "tekmode (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-terminal-type(tek)\fP action.
.TP 8
.B "vthide (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-visibility(vt,off)\fP action.
.TP 8
.B "altscreen (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-altscreen(toggle)\fP action.
.TP 8
.B "sixelScrolling (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-sixel-scrolling(toggle)\fP action.
.
.PP
The \fIVT Fonts\fP menu (widget name \fIfontMenu\fP)
has the following entries:
.TP 8
.B "fontdefault (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(d)\fP action,
setting the font using the \fBfont\fP (default) resource,
e.g., \*(``Default\*('' in the menu.
.TP 8
.B "font1 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(1)\fP action,
setting the font using the \fBfont1\fP resource,
e.g., \*(``Unreadable\*('' in the menu.
.TP 8
.B "font2 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(2)\fP action,
setting the font using the \fBfont2\fP resource,
e.g., \*(``Tiny\*('' in the menu.
.TP 8
.B "font3 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(3)\fP action,
setting the font using the \fBfont3\fP resource,
e.g., \*(``Small\*('' in the menu.
.TP 8
.B "font4 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(4)\fP action,
letting the font using the \fBfont4\fP resource,
e.g., \*(``Medium\*('' in the menu.
.TP 8
.B "font5 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(5)\fP action,
letting the font using the \fBfont5\fP resource,
e.g., \*(``Large\*('' in the menu.
.TP 8
.B "font6 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(6)\fP action,
letting the font using the \fBfont6\fP resource,
e.g., \*(``Huge\*('' in the menu.
.TP 8
.B "fontescape (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(e)\fP action.
.TP 8
.B "fontsel (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-vt-font(s)\fP action.
.TP 8
.B "font-linedrawing (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-font-linedrawing(s)\fP action.
.TP 8
.B "font-packed (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-font-packed(s)\fP action.
.TP 8
.B "font-doublesize (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-font-doublesize(s)\fP action.
.TP 8
.B "render-font (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-render-font(s)\fP action.
.TP 8
.B "utf8-mode (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-utf8-mode(s)\fP action.
.TP 8
.B "utf8-title (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-utf8-title(s)\fP action.
.
.PP
The \fITEK Options\fP menu (widget name \fItekMenu\fP)
has the following entries:
.TP 8
.B "tektextlarge (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-tek-text(large)\fP action.
.TP 8
.B "tektext2 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-tek-text(2)\fP action.
.TP 8
.B "tektext3 (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-tek-text(3)\fP action.
.TP 8
.B "tektextsmall (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-tek-text(small)\fP action.
.TP 8
.B "tekpage (\fPclass\fB SmeBSB)"
This entry invokes the \fBtek-page()\fP action.
.TP 8
.B "tekreset (\fPclass\fB SmeBSB)"
This entry invokes the \fBtek-reset()\fP action.
.TP 8
.B "tekcopy (\fPclass\fB SmeBSB)"
This entry invokes the \fBtek-copy()\fP action.
.TP 8
.B "vtshow (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-visibility(vt,toggle)\fP action.
.TP 8
.B "vtmode (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-terminal-type(vt)\fP action.
.TP 8
.B "tekhide (\fPclass\fB SmeBSB)"
This entry invokes the \fBset-visibility(tek,toggle)\fP action.
.\"
.SS Scrollbar Resources
.PP
The following resources are useful when specified for the Athena Scrollbar
widget:
.TP 8
.B "thickness (\fPclass\fB Thickness)"
Specifies the width in pixels of the scrollbar.
.TP 8
.B "background (\fPclass\fB Background)"
Specifies the color to use for the background of the scrollbar.
.TP 8
.B "foreground (\fPclass\fB Foreground)"
Specifies the color to use for the foreground of the scrollbar.
The \*(``thumb\*(''
of the scrollbar is a simple checkerboard pattern alternating pixels for
foreground and background color.
.
.
.SH "POINTER USAGE"
.
.PP
Once the VT102 window is created,
.I \*n
allows you to select text and copy it within the same or other windows.
.
.SS "SELECTION"
.PP
The selection functions are invoked when the pointer buttons are used with no
modifiers, and when they are used with the \*(``shift\*('' key.
The assignment of the functions described below to keys and buttons may
be changed through the resource database; see \fBACTIONS\fP below.
.
.PP
Pointer button one (usually left) is used to save text into the cut buffer.
Move the cursor to beginning of the text,
and then hold the button down while moving the cursor to the end of the region
and releasing the button.
The selected text is highlighted and is saved in the global cut buffer
and made the PRIMARY selection when the button is released.
Normally (but see the discussion of \fBon2Clicks\fP, etc):
.bP
Double-clicking selects by words.
.bP
Triple-clicking
selects by lines.
.bP
Quadruple-clicking goes back to characters, etc.
.PP
Multiple-click is determined by the time from button up to
button down, so you can change the selection unit in the middle of a selection.
Logical words and lines selected by double- or triple-clicking may wrap
across more than one screen line if lines were wrapped by \fI\*n\fP
itself rather than by the application running in the window.
If the key/button bindings specify that an X selection is to be made,
\fI\*n\fP will leave the selected text highlighted for as long as it
is the selection owner.
.
.PP
Pointer button two (usually middle) \*(``types\*('' (pastes) the text from
the PRIMARY selection, if any, otherwise from
the cut buffer,
inserting it as keyboard input.
.
.PP
Pointer button three (usually right) extends the current selection.
(Without loss of generality,
you can swap \*(``right\*('' and \*(``left\*('' everywhere in the rest of this
paragraph.) If pressed while closer to
the right edge of the selection than the left, it extends/contracts the
right edge of the selection.
If you contract the selection past
the left edge of the selection,
.I \*n
assumes you really meant the left edge, restores the original selection, then
extends/contracts the left edge of the selection.
Extension starts in the
selection unit mode
that the last selection or extension was performed in; you can multiple-click
to cycle through them.
.
.PP
By cutting and pasting pieces of text without trailing new lines,
you can take text from several places in different windows and form a command
to the shell, for example, or take output from a program and insert it into
your favorite editor.
Since cut buffers are globally shared among different applications,
you may regard each as a \*(``file\*('' whose contents you know.
The terminal emulator and other text programs should be treating it as if it
were a text file, i.e., the text is delimited by new lines.
.
.SS "SCROLLING"
.PP
The scroll region displays the position and amount of text currently showing
in the window (highlighted) relative to the amount of text actually saved.
As more text is saved (up to the maximum), the size of the highlighted area
decreases.
.
.PP
Clicking button one with the pointer in the scroll region moves the
adjacent line to the top of the display window.
.
.PP
Clicking button three moves the top line of the display window down to the
pointer position.
.
.PP
Clicking button two moves the display to a position in the saved text
that corresponds to the pointer's position in the scrollbar.
.
.SS "TEKTRONIX POINTER"
.PP
Unlike the VT102 window, the Tektronix window does not allow the copying of
text.
It does allow Tektronix GIN mode, and in this mode
the cursor will change from an arrow to a cross.
Pressing any key will send that key and the current coordinate of the
cross cursor.
Pressing button one, two, or three will return the letters \*(``l\*('', \*(``m\*('', and
\*(``r\*('', respectively.
If the \*(``shift\*('' key is pressed when a pointer button is pressed, the corresponding
upper case letter is sent.
To distinguish a pointer button from a key, the high bit of the character is
set (but this is bit is normally stripped unless the terminal mode is RAW;
see
.IR tty (4)
for details).
.
.
.SH SELECT/PASTE
X clients provide select and paste support by responding to requests conveyed
by the server.
.SS PRIMARY
When configured to use the primary selection,
(the default) \fI\*n\fP can
provide the selection data in ways which help to retain character
encoding information as it is pasted.
.PP
A user \*(``selects\*('' text on \*n, which highlights the selected text.
A subsequent \*(``paste\*('' to another client forwards a request to the client owning
the selection.
If \fI\*n\fP owns the primary selection, it makes the data
available in the form of one or more \*(``selection targets\*(''.
If it does not own the primary selection,
e.g., if it has released it or another client has
asserted ownership, it relies on cut-buffers to pass the data.
But cut-buffers handle only ISO-8859-1 data
(officially \- some clients ignore the rules).
.
.SS CLIPBOARD
When configured to use the clipboard (see resource \fBselectToClipboard\fP),
the problem with persistence of ownership is bypassed.
Otherwise, there is no difference regarding the data which can be
passed via selection.
.
.SS SELECTION TARGETS
The different types of data which are passed depend on what the receiving
client asks for.
These are termed \fIselection targets\fP.
.PP
When asking for the selection data,
\fI\*n\fP tries the following types in this order:
.RS
.TP 5
UTF8_STRING
This is an XFree86 extension, which denotes that the data is encoded in UTF-8.
When \fI\*n\fP is built with wide-character support,
it both accepts and provides this type.
.TP 5
TEXT
the text is in the encoding which corresponds to your current locale.
.TP 5
.\" see xc/doc/specs/CTEXT/ctext.tbl.ms
.\" (it says the data is stored as a type of ISO 2022)
COMPOUND_TEXT
this is a format for multiple character set data, such as multi-lingual text.
It can store UTF-8 data as a special case.
.TP 5
STRING
This is Latin 1 (ISO-8859-1) data.
.RE
.PP
The middle two (TEXT and COMPOUND_TEXT) are added if \fI\*n\fP
is configured with the \fBi18nSelections\fP resource set to \*(``true\*(''.
.PP
UTF8_STRING is preferred (therefore first in the list)
since \fI\*n\fP stores text as Unicode data when
running in wide-character mode, and no translation is needed.
On the other hand, TEXT and COMPOUND_TEXT may require translation.
If the translation is incomplete, they will insert X's \*(``defaultString\*(''
whose value cannot be set, and may simply be empty.
\fI\*N\fP's \fBdefaultString\fP resource specifies the string to
use for incomplete translations of the UTF8_STRING.
.PP
You can alter the types which \fI\*n\fP tries using the
\fBeightBitSelectTypes\fP or \fButf8SelectTypes\fP resources.
For instance, you might have some specific locale setting
which does not use UTF-8 encoding.
The resource value is a comma-separated list of the selection targets,
which consist of the names shown.
You can use the special name I18N
to denote the optional inclusion of TEXT and COMPOUND_TEXT.
The names are matched ignoring case, and can be abbreviated.
The default list can be expressed in several ways, e.g.,
.sp
.RS
.nf
UTF8_STRING,I18N,STRING
utf8,i18n,string
u,i,s
.fi
.RE
.
.SH MENUS
.
.PP
.I Xterm
has four menus, named
.IR mainMenu ,
.IR vtMenu ,
.IR fontMenu ,
and
.IR tekMenu .
Each menu pops up under the correct combinations of key and button presses.
Each menu is divided into sections, separated by a horizontal line.
Some menu entries correspond to modes that can be altered.
A check mark appears next to a mode that is currently active.
Selecting one of these modes toggles its state.
Other menu entries are commands;
selecting one of these performs the indicated function.
.PP
All of the menu entries correspond to X actions.
In the list below, the menu label is shown followed by the action's
name in parenthesis.
.
.\" ************************************************************************
.SS "Main Options"
.PP
The \fI\*n\fP \fImainMenu\fP pops up
when the \*(``control\*('' key and pointer button one are pressed in a window.
This menu contains items that apply to both the VT102 and Tektronix windows.
There are several sections:
.TP
Commands for managing X events:
.RS
.TP
Toolbar
Clicking on the \*(``Toolbar\*('' menu entry hides the toolbar if it is visible,
and shows it if it is not.
.TP
Secure Keyboard (securekbd)
The
.B Secure Keyboard
mode is helpful when typing in passwords or other sensitive data in an
unsecure environment;
see \fBSECURITY\fP below (but read the limitations carefully).
.TP
Allow SendEvents (allowsends)
Specifies whether or not synthetic key and button events generated using
the X protocol SendEvent request should be interpreted or discarded.
This corresponds to the \fBallowSendEvents\fP resource.
.TP
Redraw Window (redraw)
Forces the X display to repaint;
useful in some environments.
.RE
.TP
Commands for capturing output:
.RS
.TP
Log to File (logging)
Captures text sent to the screen in a logfile,
as in the \fB\-l\fP logging option.
.TP
Print-All Immediately
Invokes the \fBprint-immediate\fP action,
sending the text of the current window directly to a file,
as specified by the
\fBprintFileImmediate\fP,
\fBprintModeImmediate\fP and
\fBprintOptsImmediate\fP
resources.
.TP
Print-All on Error
Invokes the \fBprint-on-error\fP action,
which toggles a flag telling \fI\*n\fP that if it exits with an X error,
to send the text of the current window directly to a file,
as specified by the
\fBprintFileXError\fP,
\fBprintModeXError\fP and
\fBprintOptsXError\fP
resources.
.TP
Print Window (print)
Sends the text of the current window to the program given in the
\fBprinterCommand\fP resource.
.TP
Redirect to Printer (print-redir)
This sets the \fBprinterControlMode\fR to 0 or 2.
You can use this to turn the printer on as if an application had sent
the appropriate control sequence.
It is also useful for switching the printer
off if an application turns it on without resetting the print control mode.
.RE
.TP
Modes for setting keyboard style:
.RS
.TP
8-Bit Controls (8-bit-control)
Enabled for VT220 emulation, this controls whether \fI\*n\fP will send
8-bit control sequences rather than using 7-bit (ASCII) controls,
e.g., sending a byte in the range 128-159 rather than the escape character
followed by a second byte.
\fI\*N\fP always interprets both 8-bit and 7-bit control sequences
(see the document \fIXterm Control Sequences\fP).
This corresponds to the \fBeightBitControl\fP resource.
.TP
Backarrow Key (BS/DEL) (backarrow\ key)
Modifies the behavior of the backarrow key, making it transmit
either a backspace (8)
or delete (127) character.
This corresponds to the \fBbackarrowKey\fP resource.
.TP
Alt/NumLock Modifiers (num-lock)
Controls the treatment of Alt- and NumLock-key modifiers.
This corresponds to the \fBnumLock\fP resource.
.TP
Meta Sends Escape (meta-esc)
Controls whether \fIMeta\fP keys are converted into a two-character
sequence with the character itself preceded by ESC.
This corresponds to the \fBmetaSendsEscape\fP resource.
.TP
Delete is DEL (delete-is-del)
Controls whether the Delete key on the editing keypad should send DEL (127)
or the VT220-style Remove escape sequence.
This corresponds to the \fBdeleteIsDEL\fP resource.
.TP
Old Function-Keys (oldFunctionKeys)
.TP
HP Function-Keys (hpFunctionKeys)
.TP
SCO Function-Keys (scoFunctionKeys)
.TP
Sun Function-Keys (sunFunctionKeys)
.TP
VT220 Keyboard (sunKeyboard)
These act as a radio-button, selecting one style for the keyboard layout.
It corresponds to more than one resource setting:
.BR "sunKeyboard" ","
.BR "sunFunctionKeys" ","
.BR "scoFunctionKeys" " and"
.BR "hpFunctionKeys "."
.RE
.TP
Commands for process signalling:
.RS
.TP
Send STOP Signal (suspend)
.TP
Send CONT Signal (continue)
.TP
Send INT Signal (interrupt)
.TP
Send HUP Signal (hangup)
.TP
Send TERM Signal (terminate)
.TP
Send KILL Signal (kill)
These send the SIGTSTP, SIGCONT, SIGINT, SIGHUP, SIGTERM and SIGKILL
signals respectively, to the process group of the process running under
.I \*n
(usually the shell).
The
.B SIGCONT
function is especially useful if the user has accidentally typed CTRL-Z,
suspending the process.
.TP
Quit (quit)
Stop processing X events except to support the \fB-hold\fP option,
and then send a SIGHUP signal to the
the process group of the process running under
.I \*n
(usually the shell).
.RE
.PP
.
.\" ************************************************************************
.SS "VT Options"
.PP
The
.I vtMenu
sets various modes in the VT102 emulation, and is popped up when the
\*(``control\*('' key and pointer button two are pressed in the VT102 window.
.TP
VT102/VT220 Modes:
.RS
.
.TP
Enable Scrollbar (scrollbar)
Enable (or disable) the scrollbar.
This corresponds to the
.B \-sb
option and the
.B scrollBar
resource.
.
.TP
Enable Jump Scroll (jumpscroll)
Enable (or disable) jump scrolling.
This corresponds to the
.B \-j
option and the
.B jumpScroll
resource.
.
.TP
Enable Reverse Video (reversevideo)
Enable (or disable) reverse-video.
This corresponds to the
.B \-rv
option and the
.B reverseVideo
resource.
.
.TP
Enable Auto Wraparound (autowrap)
Enable (or disable) auto-wraparound.
This corresponds to the
.B \-aw
option and the
.B autoWrap
resource.
.
.TP
Enable Reverse Wraparound (reversewrap)
Enable (or disable) reverse wraparound.
This corresponds to the
.B \-rw
option and the
.B reverseWrap
resource.
.
.TP
Enable Auto Linefeed (autolinefeed)
Enable (or disable) auto-linefeed.
This is the VT102 NEL function,
which causes the emulator to emit a linefeed after each carriage return.
There is no corresponding command-line option or resource setting.
.
.TP
Enable Application Cursor Keys (appcursor)
Enable (or disable) application cursor keys.
This corresponds to the
.B appcursorDefault
resource.
There is no corresponding command-line option.
.
.TP
Enable Application Keypad (appkeypad)
Enable (or disable) application keypad keys.
This corresponds to the
.B appkeypadDefault
resource.
There is no corresponding command-line option.
.
.TP
Scroll to Bottom on Key Press (scrollkey)
Enable (or disable) scrolling to the bottom of the scrolling region on a keypress.
This corresponds to the
.B \-sk
option and the
.B scrollKey
resource.
.IP
As a special case, the XON / XOFF keys (control/S and control/Q) are ignored.
.
.TP
Scroll to Bottom on Tty Output (scrollttyoutput)
Enable (or disable) scrolling to the bottom of the scrolling region on output to the terminal.
This corresponds to the
.B \-si
option and the
.B scrollTtyOutput
resource.
.
.TP
Allow 80/132 Column Switching (allow132)
Enable (or disable) switching between 80 and 132 columns.
This corresponds to the
.B \-132
option and the
.B c132
resource.
.
.TP
Keep Selection (keepSelection)
Tell \fI\*n\fP whether to disown the selection when it stops highlighting it,
e.g., when an application modifies the display so that it no longer matches
the text which has been highlighted.
As long as \fI\*n\fP continues to own the selection,
it can provide the corresponding text to other clients via cut/paste.
This corresponds to the
.B keepSelection
resource.
There is no corresponding command-line option.
.
.TP
Select to Clipboard (selectToClipboard)
Tell \fI\*n\fP whether to use the PRIMARY or CLIPBOARD
for SELECT tokens in the \fBtranslations\fP resource which
maps keyboard and mouse actions to select/paste actions.
This corresponds to the
.B selectToClipboard
resource.
There is no corresponding command-line option.
.
.TP
Enable Visual Bell (visualbell)
Enable (or disable) visible bell (i.e., flashing) instead of an audible bell.
This corresponds to the
.B \-vb
option and the
.B visualBell
resource.
.
.TP
Enable Bell Urgency (bellIsUrgent)
Enable (or disable) Urgency window manager hint when Control-G is received.
This corresponds to the
.B bellIsUrgent
resource.
.
.TP
Enable Pop on Bell (poponbell)
Enable (or disable) raising of the window when Control-G is received.
This corresponds to the
.B \-pop
option and the
.B popOnBell
resource.
.
.TP
Enable Blinking Cursor (cursorblink)
Enable (or disable) the blinking-cursor feature.
This corresponds to the
.B \-bc
option and the
.B cursorBlink
resource.
There is also an escape sequence
(see the document \fIXterm Control Sequences\fP).
The menu entry and the escape sequence states are XOR'd:
if both are enabled, the cursor will not blink,
if only one is enabled, the cursor will blink.
.
.TP
Enable Alternate Screen Switching (titeInhibit)
Enable (or disable) switching between the normal and alternate screens.
This corresponds to the
.B titeInhibit
resource.
There is no corresponding command-line option.
.
.TP
Enable Active Icon (activeicon)
Enable (or disable) the active-icon feature.
This corresponds to the
.B \-ai
option and the
.B activeIcon
resource.
.
.TP
Sixel Scrolling (sixelScrolling)
When enabled,
sixel graphics are positioned at the current text cursor location, scroll
the image vertically if larger than the screen, and leave the text cursor
after the image when returning to text mode.
When disabled,
sixel graphics are positioned at the upper left of the screen, are
cropped to fit the screen, and do not affect the text cursor location
(this is the default).
This corresponds to the
.B sixelScrolling
resource.
There is no corresponding command-line option.
.
.TP
Private Color Registers (privateColorRegisters)
When enabled,
each graphic image uses a separate set of color registers, so that it
essentially has a private palette (this is the default). If it is not set,
all graphics images share a common set of registers which is how sixel and
ReGIS graphics worked on actual hardware. The default is likely a more
useful mode on modern TrueColor hardware.
This corresponds to the
.B privateColorRegisters
resource.
There is no corresponding command-line option.
.RE
.
.TP
VT102/VT220 Commands:
.RS
.TP
Do Soft Reset (softreset)
Reset scroll regions.
This can be convenient when some program has left the scroll regions
set incorrectly (often a problem when using VMS or TOPS-20).
This corresponds to the VT220 DECSTR control sequence.
.
.TP
Do Full Reset (hardreset)
The full reset entry will clear the screen, reset tabs to every
eight columns, and reset the terminal modes (such as wrap and smooth scroll)
to their initial states just after
.I \*n
has finished processing the command line options.
This corresponds to the VT102 RIS control sequence,
with a few obvious differences.
For example, your session is not disconnected as a real VT102 would do.
.
.TP
Reset and Clear Saved Lines (clearsavedlines)
Perform a full reset,
and also clear the saved lines.
.RE
.
.TP
Commands for setting the current screen:
.RS
.
.TP
Show Tek Window (tekshow)
When enabled,
pops the Tektronix 4014 window up (makes it visible).
When disabled,
hides the Tektronix 4014 window.
.
.TP
Switch to Tek Mode (tekmode)
When enabled,
pops the Tektronix 4014 window up if it is not already visible,
and switches the input stream to that window.
When disabled,
hides the Tektronix 4014 window and
switches input back to the VTxxx window.
.
.TP
Hide VT Window (vthide)
When enabled,
hides the VTxxx window,
shows the Tektronix 4014 window if
it was not already visible
and switches the input stream to that window.
When disabled,
shows the VTxxx window,
and switches the input stream to that window.
.
.TP
Show Alternate Screen (altscreen)
When enabled,
shows the alternate screen.
When disabled,
shows the normal screen.
Note that the normal screen may have saved lines;
the alternate screen does not.
.RE
.PP
.
.SS "VT Fonts"
.PP
The \fIfontMenu\fP pops up when
when the \*(``control\*('' key and pointer button three are pressed in a window.
It sets the font used in the VT102 window,
or modifies the way the font is specified or displayed.
There are several sections.
.PP
The first section allows you to select the font from a set of alternatives:
.RS
.TP
Default (fontdefault)
Set the font to the default, i.e., that given by the
.B *VT100.font
resource.
.TP
Unreadable (font1)
Set the font to that given by the
.B *VT100.font1
resource.
.TP
Tiny (font2)
Set the font to that given by the
.B *VT100.font2
resource.
.TP
Small (font3)
Set the font to that given by the
.B *VT100.font3
resource.
.TP
Medium (font4)
Set the font to that given by the
.B *VT100.font4
resource.
.TP
Large (font5)
Set the font to that given by the
.B *VT100.font5
resource.
.TP
Huge (font6)
Set the font to that given by the
.B *VT100.font6
resource.
.TP
Escape Sequence
This allows you to set the font last specified by the Set
Font escape sequence (see the document \fIXterm Control Sequences\fP).
.TP
Selection (fontsel)
This allows you to set the font specified
the current selection as a font name (if the PRIMARY selection is owned).
.RE
.PP
The second section allows you to modify the way it is displayed:
.RS
.TP
Bold Fonts
This is normally checked (enabled).
When unchecked, \fI\*n\fP will not use bold fonts.
The setting corresponds to the \fBallowBoldFonts\fP resource.
.TP
Line-Drawing Characters (font-linedrawing)
When set, tells \fI\*n\fP to draw its own line-drawing characters.
Otherwise it relies on the font containing these.
Compare to the \fBforceBoxChars\fP resource.
.TP
Packed Font (font-packed)
When set, tells \fI\*n\fP to use the minimum glyph-width from a font
when displaying characters.
Use the maximum width (unchecked) to help display proportional fonts.
Compare to the \fBforcePackedFont\fP resource.
.TP
Doublesized Characters (font-doublesize)
When set, \fI\*n\fP may ask the font server to produce scaled versions
of the normal font, for VT102 double-size characters.
.RE
.PP
The third section allows you to modify the way it is specified:
.RS
.TP
TrueType Fonts (render-font)
If the
.B "renderFont
and corresponding resources were set,
this is a further control whether \fI\*n\fP will actually use the
Xft library calls to obtain a font.
.TP
UTF-8 Encoding (utf8-mode)
This controls whether \fI\*n\fP uses UTF-8 encoding of input/output.
It is useful for temporarily switching \fI\*n\fP to display
text from an application which does not follow the locale settings.
It corresponds to the \fButf8\fP resource.
.TP
UTF-8 Fonts (utf8-fonts)
This controls whether \fI\*n\fP uses UTF-8 fonts for display.
It is useful for temporarily switching \fI\*n\fP to display
text from an application which does not follow the locale settings.
It combines the \fButf8\fP and \fButf8Fonts\fP resources.
.TP
UTF-8 Titles (utf8-titles)
This controls whether \fI\*n\fP accepts UTF-8 encoding for
title control sequences.
It corresponds to the \fButf8Fonts\fP resource.
.IP
Initially the checkmark is set according to both the \fButf8\fP
and \fButf8Fonts\fP resource values.
If the latter is set to \*(``always\*('', the checkmark is disabled.
Likewise, if there are no fonts given in the \fButf8Fonts\fP
subresources, then the checkmark also is disabled.
.IP
The standard \fB__default_class__\fP app-defaults file defines both sets of fonts,
while the \fBU__default_class__\fP app-defaults file defines only one set.
assuming the standard app-defaults files,
this command will launch \fI\*n\fP able to switch between UTF-8
and ISO-8859-1 encoded fonts:
.NS
u\*n -class __default_class__
.NE
.RE
.IP
The fourth section allows you to enable or disable special operations
which can be controlled by writing escape sequences to the terminal.
These are disabled if the SendEvents feature is enabled:
.RS
.TP
Allow Color Ops (allow-font-ops)
This corresponds to the \fBallowColorOps\fP resource.
Enable or disable control sequences that set/query the colors.
.TP
Allow Font Ops (allow-font-ops)
This corresponds to the \fBallowFontOps\fP resource.
Enable or disable control sequences that set/query the font.
.TP
Allow Tcap Ops (allow-tcap-ops)
Enable or disable control sequences that query the terminal's
notion of its function-key strings, as termcap or terminfo capabilities.
This corresponds to the \fBallowTcapOps\fP resource.
.TP
Allow Title Ops (allow-title-ops)
Enable or disable control sequences that modify the window title or icon name.
This corresponds to the \fBallowTitleOps\fP resource.
.TP
Allow Window Ops (allow-window-ops)
Enable or disable extended window control sequences (as used in dtterm).
This corresponds to the \fBallowWindowOps\fP resource.
.RE
.
.SS "TEK Options"
.PP
The
.I tekMenu
sets various modes in the Tektronix emulation, and is popped up when the
\*(``control\*('' key and pointer button two are pressed in the Tektronix window.
The current font size is checked in the modes section of the menu.
.RS
.TP
Large Characters (tektextlarge)
.TP
\ Size Characters (tektext2)
.TP
\ Size Characters (tektext3)
.TP
Small Characters (tektextsmall)
.RE
.PP
Commands:
.RS
.TP
PAGE (tekpage)
Clear the Tektronix window.
.TP
RESET (tekreset)
.TP
COPY (tekcopy)
.RE
.PP
Windows:
.RS
.TP
Show VT Window (vtshow)
.TP
Switch to VT Mode (vtmode)
.TP
Hide Tek Window (tekhide)
.RE
.
.
.SH SECURITY
.
.PP
X environments differ in their security consciousness.
.bP
Most servers,
run under \fIxdm\fP,
are capable of using a \*(``magic cookie\*('' authorization
scheme that can provide a reasonable level of security for many people.
If your server is only using a host-based mechanism to control access to
the server (see \fIxhost(__mansuffix__)\fP), then if you enable access for a host and
other users are also permitted to run clients on that same host,
it is possible that someone can run an application which uses the
basic services of the X protocol to snoop on your activities,
potentially capturing a transcript of everything you type at the keyboard.
.bP
Any process which has access to your X display can manipulate it
in ways that you might not anticipate,
even redirecting your keyboard to itself
and sending events to your application's windows.
This is true even with the \*(``magic cookie\*('' authorization scheme.
While the \fBallowSendEvents\fP provides some protection against
rogue applications tampering with your programs,
guarding against a snooper is harder.
.
.bP
The X input extension for instance allows an application to bypass
all of the other (limited) authorization and security features,
including the GrabKeyboard protocol.
.
.bP
The possibility of an application spying on your keystrokes
is of particular concern when you want to type in a password
or other sensitive data.
The best solution to this problem is to use a better
authorization mechanism than is provided by X.
.PP
Subject to all of these caveats,
a simple mechanism exists for protecting keyboard input in \fI\*n\fP.
.
.PP
The \fI\*n\fP menu (see \fBMENUS\fP above) contains a \fBSecure Keyboard\fP
entry which, when enabled,
attempts to ensure that all keyboard input is directed
\fIonly\fP to \fI\*n\fP (using the GrabKeyboard protocol request).
When an application prompts you for a password
(or other sensitive data), you can enable \fBSecure Keyboard\fP using the
menu, type in the data, and then disable \fBSecure Keyboard\fP using
the menu again.
.bP
This ensures that you know which window is accepting your keystrokes.
.bP
It cannot ensure that there are no processes which have access to your
X display that might be observing the keystrokes as well.
.
.PP
Only one X client at a time can grab the keyboard,
so when you attempt to enable \fBSecure Keyboard\fP it may fail.
In this case, the bell will sound.
If the \fBSecure Keyboard\fP succeeds,
the foreground and background colors will be exchanged (as if you
selected the \fBReverse Video\fP entry in the \fBModes\fP menu);
they will be exchanged again when you exit secure mode.
If the colors
do \fInot\fP switch, then
you should be \fIvery\fP suspicious that you are being spoofed.
If the application you are running displays a prompt before asking for
the password, it is safest to enter secure mode \fIbefore\fP the
prompt gets displayed, and to make sure that the prompt gets displayed
correctly (in the new colors), to minimize the probability of
spoofing.
You can also bring up the menu again and make sure that a check
mark appears next to the entry.
.
.PP
\fBSecure Keyboard\fP mode will be disabled automatically if your \fI\*n\fP
window becomes iconified (or otherwise unmapped), or if you start up
a reparenting window manager (that places a title bar or other decoration
around the window) while in \fBSecure Keyboard\fP mode.
(This is a
feature of the X protocol not easily overcome.) When this happens,
the foreground and background colors will be switched back and the bell
will sound in warning.
.
.
.SH "CHARACTER CLASSES"
Clicking the left pointer button twice in rapid succession
(double-clicking) causes all characters of the same class
(e.g., letters, white space, punctuation) to be selected as a \*(``word\*(''.
Since different people have different preferences for what should
be selected (for example, should filenames be selected as a whole or only
the separate subnames), the default mapping can be overridden through the use
of the \fBcharClass\fP (class \fICharClass\fP) resource.
.
.PP
This resource is a
series of comma-separated
of \fIrange\fP:\fIvalue\fP pairs.
The
\fIrange\fP is either a single number or \fIlow\fP-\fIhigh\fP in the range of 0
to 65535, corresponding to the code for the character or characters to be
set.
The \fIvalue\fP is arbitrary, although the default table uses the
character number of the first character occurring in the set.
When not in
UTF-8 mode, only the first 256 bytes of this table will be used.
.
.PP
The default table starts as follows \-
.NS
static int charClass[256] = {
/\(** NUL SOH STX ETX EOT ENQ ACK BEL */
32, 1, 1, 1, 1, 1, 1, 1,
/\(** BS HT NL VT NP CR SO SI */
1, 32, 1, 1, 1, 1, 1, 1,
/\(** DLE DC1 DC2 DC3 DC4 NAK SYN ETB */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** CAN EM SUB ESC FS GS RS US */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** SP ! " # $ % & \*(AQ */
.\" " <- for emacs autocolor to work well :-)
32, 33, 34, 35, 36, 37, 38, 39,
/\(** ( ) * + , \- . / */
40, 41, 42, 43, 44, 45, 46, 47,
/\(** 0 1 2 3 4 5 6 7 */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** 8 9 : ; < = > ? */
48, 48, 58, 59, 60, 61, 62, 63,
/\(** @ A B C D E F G */
64, 48, 48, 48, 48, 48, 48, 48,
/\(** H I J K L M N O */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** P Q R S T U V W */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** X Y Z [ \\ ] ^ _ */
48, 48, 48, 91, 92, 93, 94, 48,
/\(** ` a b c d e f g */
96, 48, 48, 48, 48, 48, 48, 48,
/\(** h i j k l m n o */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** p q r s t u v w */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** x y z { | } ~ DEL */
48, 48, 48, 123, 124, 125, 126, 1,
/\(** x80 x81 x82 x83 IND NEL SSA ESA */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** HTS HTJ VTS PLD PLU RI SS2 SS3 */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** DCS PU1 PU2 STS CCH MW SPA EPA */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** x98 x99 x9A CSI ST OSC PM APC */
1, 1, 1, 1, 1, 1, 1, 1,
/\(** \- i c/ L ox Y\- | So */
160, 161, 162, 163, 164, 165, 166, 167,
/\(** .. c0 ip << _ R0 \- */
168, 169, 170, 171, 172, 173, 174, 175,
/\(** o +\- 2 3 \*(AQ u q| . */
176, 177, 178, 179, 180, 181, 182, 183,
/\(** , 1 2 >> 1/4 1/2 3/4 ? */
184, 185, 186, 187, 188, 189, 190, 191,
/\(** A` A\*(AQ A^ A~ A: Ao AE C, */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** E` E\*(AQ E^ E: I` I\*(AQ I^ I: */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** D\- N~ O` O\*(AQ O^ O~ O: X */
48, 48, 48, 48, 48, 48, 48, 215,
/\(** O/ U` U\*(AQ U^ U: Y\*(AQ P B */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** a` a\*(AQ a^ a~ a: ao ae c, */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** e` e\*(AQ e^ e: i` i\*(AQ i^ i: */
48, 48, 48, 48, 48, 48, 48, 48,
/\(** d n~ o` o\*(AQ o^ o~ o: \-: */
48, 48, 48, 48, 48, 48, 48, 247,
/\(** o/ u` u\*(AQ u^ u: y\*(AQ P y: */
48, 48, 48, 48, 48, 48, 48, 48};
.NE
.IP
For example, the string \*(``33:48,37:48,45\-47:48,38:48\*('' indicates that the
exclamation mark, percent sign, dash, period, slash, and ampersand characters
should be treated the same way as characters and numbers.
This is useful
for cutting and pasting electronic mailing addresses and filenames.
.
.
.SH KEY BINDINGS
.PP
It is possible to rebind keys (or sequences of keys) to arbitrary strings
for input, by changing the \fBtranslations\fP resources
for the vt100 or tek4014 widgets.
Changing the \fBtranslations\fP resource
for events other than key and button events is not expected,
and will cause unpredictable behavior.
.SS ACTIONS
The following
actions are provided for use within the \fIvt100\fP or \fItek4014\fP
\fBtranslations\fP resources:
.TP 8
.B "allow-color-ops(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowColorOps\fP resource and is also
invoked by the \fBallow-color-ops\fP entry in \fIfontMenu\fP.
.TP 8
.B "allow-font-ops(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowFontOps\fP resource and is also
invoked by the \fBallow-font-ops\fP entry in \fIfontMenu\fP.
.TP 8
.B "allow-send-events(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowSendEvents\fP resource and is also
invoked by the \fBallowsends\fP entry in \fImainMenu\fP.
.TP 8
.B "allow-tcap-ops(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowTcapOps\fP resource and is also
invoked by the \fBallow-tcap-ops\fP entry in \fIfontMenu\fP.
.TP 8
.B "allow-title-ops(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowTitleOps\fP resource and is also
invoked by the \fBallow-title-ops\fP entry in \fIfontMenu\fP.
.TP 8
.B "allow-window-ops(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBallowWindowOps\fP resource and is also
invoked by the \fBallow-window-ops\fP entry in \fIfontMenu\fP.
.TP 8
.B "alt-sends-escape()"
This action toggles the state of the \fBaltSendsEscape\fP resource.
.TP 8
.B "bell([\fIpercent\fP])"
This action rings the keyboard bell at the specified percentage
above or below the base volume.
.TP 8
.B "clear-saved-lines()"
This action does \fBhard-reset()\fP (see below) and also clears the history
of lines saved off the top of the screen.
It is also invoked from the \fBclearsavedlines\fP entry in \fIvtMenu\fP.
The effect is identical to a hardware reset (RIS) control sequence.
.TP 8
.B "copy-selection(\fIdestname\fP [, ...])"
This action puts the currently selected text into all of the selections or
cutbuffers specified by \fIdestname\fP.
Unlike \fBselect-end\fP, it does not send a mouse position or otherwise
modify the internal selection state.
.TP 8
.B "create-menu(\fIm/v/f/t\fP)"
This action creates one of the menus used by \fI\*n\fP,
if it has not been previously created.
The parameter values are the menu names:
\fImainMenu\fP, \fIvtMenu\fP, \fIfontMenu\fP, \fItekMenu\fP, respectively.
.TP 8
.B "dabbrev-expand()"
Expands the word before cursor by searching in the preceding text on the
screen and in the scrollback buffer for words starting with that
abbreviation.
Repeating \fBdabbrev-expand()\fP several times in sequence searches for an
alternative expansion by looking farther back.
Lack of more matches is signaled by a \fBbeep()\fP.
Attempts to expand an empty word
(i.e., when cursor is preceded by a space) yield successively all previous
words.
Consecutive identical expansions are ignored.
The word here is defined as a sequence of non-whitespace characters.
This feature partially emulates the behavior
of \*(``dynamic abbreviation\*('' expansion in Emacs (bound there to M\-/).
Here is a resource setting for \fI\*n\fP which will do the same thing:
.NS
*VT100*translations: #override \\n\\\&
Meta /:dabbrev-expand()
.NE
.TP 8
.B "deiconify()"
Changes the window state back to normal, if it was iconified.
.TP 8
.B "delete-is-del()"
This action toggles the state of the \fBdeleteIsDEL\fP resource.
.TP 8
.B "dired-button()"
Handles a button event (other than press and release)
by echoing the event's position
(i.e., character line and column) in the following format:
.sp
.in +8
^X ESC G
.in -8
.TP 8
.B "fullscreen(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBfullscreen\fP resource.
.TP 8
.B "iconify()"
Iconifies the window.
.TP 8
.B "hard-reset()"
This action resets the scrolling region, tabs, window size, and cursor keys
and clears the screen.
It is also invoked from the \fBhardreset\fP
entry in \fIvtMenu\fP.
.TP 8
.B "ignore()"
This action ignores the event but checks for special pointer position
escape sequences.
.TP 8
.B "insert()"
This action inserts the character or string associated with
the key that was pressed.
.TP 8
.B "insert-eight-bit()"
This action inserts an eight-bit (Meta) version of the character or string
associated with the key that was pressed.
Only single-byte values are treated specially.
The exact action depends on the value of
the \fBaltSendsEscape\fP and
the \fBmetaSendsEscape\fP and
the \fBeightBitInput\fP resources.
The \fBmetaSendsEscape\fP resource is tested first.
See the \fBeightBitInput\fP resource for a full discussion.
.IP
The term \*(``eight-bit\*('' is misleading:
\fI\*n\fP checks if the key is in the range 128 to 255
(the eighth bit is set).
If the value is in that range,
depending on the resource values,
\fI\*n\fP may then do one of the following:
.RS
.bP
add 128 to the value, setting its eighth bit,
.bP
send an ESC byte before the key, or
.bP
send the key unaltered.
.RE
.TP 8
.B "exec-formatted(\fIformat\fP, \fIsourcename\fP [, ...])"
Execute an external command,
using the current selection for part of the command's parameters.
The first parameter, \fIformat\fP gives the basic command.
Succeeding parameters specify the selection source as in \fBinsert-selection\fP.
.IP
The \fIformat\fP parameter allows these substitutions:
.RS
.TP 5
%%
inserts a "%".
.TP 5
%P
the screen-position at the beginning of the highlighted region,
as a semicolon-separated pair of integers using the
values that the CUP control sequence would use.
.TP 5
%p
the screen-position after the beginning of the highlighted region,
using the same convention as \*(``%P\*(''.
.TP 5
%S
the length of the string that \*(``%s\*('' would insert.
.TP 5
%s
the content of the selection, unmodified.
.TP 5
%T
the length of the string that \*(``%t\*('' would insert.
.TP 5
%t
the selection, trimmed of leading/trailing whitespace, and newlines
changed to single spaces.
.TP 5
%V
the video attributes at the beginning of the highlighted region,
as a semicolon-separated list of integers using the
values that the SGR control sequence would use.
.TP 5
%v
the video attributes after the end of the highlighted region,
using the same convention as \*(``%V\*(''.
.RE
.IP
After constructing the command-string,
\fI\*n\fP forks a subprocess and executes the command,
which completes independently of \*n.
.TP 8
.B "exec-selectable(\fIformat\fP, \fIonClicks\fP)"
Execute an external command,
using data copied from the screen for part of the command's parameters.
The first parameter, \fIformat\fP gives
the basic command as in \fBexec-formatted\fP.
The second parameter specifies the method for copying
the data as in the \fBonClicks\fP resource.
.TP 8
.B "insert-formatted(\fIformat\fP, \fIsourcename\fP [, ...])"
Insert the current selection or data related to it, formatted.
The first parameter, \fIformat\fP gives the template for the data
as in \fBexec-formatted\fP.
Succeeding parameters specify the selection source as in \fBinsert-selection\fP.
.TP 8
.B "insert-selectable(\fIformat\fP, \fIonClicks\fP)"
Insert data copied from the screen, formatted.
The first parameter, \fIformat\fP gives the template for the data
as in \fBexec-formatted\fP.
The second parameter specifies the method for copying
the data as in the \fBonClicks\fP resource.
.TP 8
.B "insert-selection(\fIsourcename\fP [, ...])"
This action inserts the string found in the selection or cutbuffer indicated
by \fIsourcename\fP.
Sources are checked in the order given (case is
significant) until one is found.
Commonly-used selections include:
\fIPRIMARY\fP, \fISECONDARY\fP, and \fICLIPBOARD\fP.
Cut buffers are
typically named \fICUT_BUFFER0\fP through \fICUT_BUFFER7\fP.
.TP 8
.B "insert-seven-bit()"
This action is a synonym for \fBinsert()\fP
The term \*(``seven-bit\*('' is misleading:
it only implies that \fI\*n\fP does not try to add 128 to the key's value
as in \fBinsert-eight-bit()\fP.
.TP 8
.B "interpret(\fIcontrol-sequence\fP)"
Interpret the given control sequence locally, i.e., without passing it to
the host.
This works by inserting the control sequence at the front
of the input buffer.
Use \*(``\\\*('' to escape octal digits in the string.
Xt does not allow you to put a null character (i.e., \*(``\\000\*('') in the string.
.TP 8
.B "keymap(\fIname\fP)"
This action dynamically defines a new translation table whose resource
name is \fIname\fP with the suffix \fIKeymap\fP (case is significant).
The name \fINone\fP restores the original translation table.
.TP 8
.B "larger-vt-font()"
Set the font to the next larger one, based on the font dimensions.
See also \fBset-vt-font()\fP.
.TP 8
.B "load-vt-fonts(\fIname\fP[,\fIclass\fP])"
Load fontnames from the given subresource name and class.
That is, load the \*(``*VT100.\fIname\fP.font\*('',
resource as \*(``*VT100.font\*('' etc.
If no name is given, the original set of fontnames is restored.
.IP
Unlike \fBset-vt-font()\fR, this does not affect the escape- and select-fonts,
since those are not based on resource values.
It does affect the fonts loosely organized under the \*(``Default\*('' menu
entry, including \fBfont\fP, \fBboldFont\fP, \fBwideFont\fP and \fBwideBoldFont\fP.
.TP 8
.B "maximize()"
Resizes the window to fill the screen.
.TP 8
.B "meta-sends-escape()"
This action toggles the state of the \fBmetaSendsEscape\fP resource.
.TP 8
.B "popup-menu(\fImenuname\fP)"
This action displays the specified popup menu.
Valid names (case is
significant) include: \fImainMenu\fP, \fIvtMenu\fP, \fIfontMenu\fP,
and \fItekMenu\fP.
.TP 8
.B "print(\fIprinter-flags\fP)"
This action prints the window.
It is also invoked by the \fIprint\fP entry in \fImainMenu\fP.
.IP
The action accepts optional parameters, which temporarily override
resource settings.
The parameter values are matched ignoring case:
.RS
.TP 5
noFormFeed
no form feed will be sent at the end of the last line printed
(i.e., \fBprinterFormFeed\fP is ``false'').
.TP 5
FormFeed
a form feed will be sent at the end of the last line printed
(i.e., \fBprinterFormFeed\fP is ``true'').
.TP 5
noNewLine
no newline will be sent at the end of the last line printed,
and wrapped lines will be combined into long lines
(i.e., \fBprinterNewLine\fP is ``false'').
.TP 5
NewLine
a newline will be sent at the end of the last line printed,
and each line will be limited (by adding a newline) to the screen width
(i.e., \fBprinterNewLine\fP is ``true'').
.TP 5
noAttrs
the page is printed without attributes
(i.e., \fBprintAttributes\fP is ``0'').
.TP 5
monoAttrs
the page is printed with monochrome (vt220) attributes
(i.e., \fBprintAttributes\fP is ``1'').
.TP 5
colorAttrs
the page is printed with ANSI color attributes
(i.e., \fBprintAttributes\fP is ``2'').
.RE
.TP 8
.B "print-everything(\fIprinter-flags\fP)"
This action sends the entire text history, in addition to the text
currently visible, to the program given in the \fBprinterCommand\fP resource.
It allows the same optional parameters as the \fBprint\fP action.
With a suitable printer command, the action can be used to load the text
history in an editor.
.TP 8
.B "print-immediate()"
Sends the text of the current window directly to a file,
as specified by the
\fBprintFileImmediate\fP,
\fBprintModeImmediate\fP and
\fBprintOptsImmediate\fP
resources.
.TP 8
.B "print-on-error()"
Toggles a flag telling \fI\*n\fP that if it exits with an X error,
to send the text of the current window directly to a file,
as specified by the
\fBprintFileXError\fP,
\fBprintModeXError\fP and
\fBprintOptsXError\fP
resources.
.TP 8
.B "print-redir()"
This action toggles the \fBprinterControlMode\fR between 0 and 2.
The corresponding popup menu entry is useful for switching the printer
off if you happen to change your mind after deciding to print random
binary files on the terminal.
.TP 8
.B "quit()"
This action sends a SIGHUP to the subprogram and exits.
It is also invoked
by the \fBquit\fP entry in \fImainMenu\fP.
.TP 8
.B "readline-button()"
Supports the optional readline feature by echoing repeated cursor forward
or backward control sequences on button release event,
to request that the host application update its notion of the cursor's
position to match the button event.
.TP 8
.B "redraw()"
This action redraws the window.
It is also invoked by the \fIredraw\fP entry in \fImainMenu\fP.
.TP 8
.B "restore()"
Restores the window to the size before it was last maximized.
.TP 8
.B "scroll-back(\fIcount\fP [,\fIunits\fP [,\fImouse\fP] ])"
This action scrolls the text window backward so that text that had previously
scrolled off the top of the screen is now visible.
.IP
The \fIcount\fP argument
indicates the number of \fIunits\fP (which may be \fIpage\fP, \fIhalfpage\fP,
\fIpixel\fP, or \fIline\fP) by which to scroll.
.IP
An adjustment can be specified for these values
by appending a \*(``+\*('' or \*(``\-\*(''
sign followed by a number,
e.g., \fIpage\-2\fP to specify 2 lines less than a page.
.IP
If the third parameter \fImouse\fP is given, the action is ignored when
mouse reporting is enabled.
.TP 8
.B "scroll-forw(\fIcount\fP [,\fIunits\fP [,\fImouse\fP] ])"
This action is similar to \fBscroll-back\fP except that it scrolls
in the other direction.
.TP 8
.B "secure()"
This action toggles the \fISecure Keyboard\fP mode described in the
section named \fBSECURITY\fP, and is invoked from the \fBsecurekbd\fP
entry in \fImainMenu\fP.
.TP 8
.B "scroll-lock(\fIon/off/toggle\fP)"
This action sets, unsets or toggles internal state which tells
\fI\*n\fP whether Scroll Lock is active,
subject to the \fBallowScrollLock\fP resource.
.TP 8
.B "select-cursor-end(\fIdestname\fP [, ...])"
This action is similar to \fBselect-end\fP except that it should be used
with \fBselect-cursor-start\fP.
.TP 8
.B "select-cursor-extend()"
This action is similar to \fBselect-extend\fP except that it should be used
with \fBselect-cursor-start\fP.
.TP 8
.B "select-cursor-start()"
This action is similar to \fBselect-start\fP except that it begins the
selection at the current text cursor position.
.TP 8
.B "select-end(\fIdestname\fP [, ...])"
This action puts the currently selected text into all of the selections or
cutbuffers specified by \fIdestname\fP.
It also sends a mouse position and updates the internal selection state
to reflect the end of the selection process.
.TP 8
.B "select-extend()"
This action tracks the pointer and extends the selection.
It should only be bound to Motion events.
.TP 8
.B "select-set()"
This action stores text that corresponds to the current selection,
without affecting the selection mode.
.TP 8
.B "select-start()"
This action begins text selection at the current pointer location.
See
the section on \fBPOINTER USAGE\fP for information on making selections.
.TP 8
.B "send-signal(\fIsigname\fP)"
This action sends the signal named by \fIsigname\fP
to the \fI\*n\fP subprocess (the shell or program specified with
the \fI\-e\fP command line option).
It is also invoked by the
.BR suspend ,
.BR continue ,
.BR interrupt ,
.BR hangup ,
.BR terminate ,
and
.BR kill
entries in \fImainMenu\fP.
Allowable signal names are (case is
not significant):
\fItstp\fP (if supported by the operating system), \fIsuspend\fP (same
as \fItstp\fP), \fIcont\fP
(if supported by the operating system), \fIint\fP, \fIhup\fP, \fIterm\fP,
\fIquit\fP,
\fIalrm\fP, \fIalarm\fP (same as \fIalrm\fP) and \fIkill\fP.
.TP 8
.B "set-8-bit-control(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBeightBitControl\fP resource.
It is also invoked from the \fB8-bit-control\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-allow132(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBc132\fP resource.
It is also invoked from the \fBallow132\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-altscreen(\fIon/off/toggle\fP)"
This action sets, unsets or toggles between the alternate and current screens.
.TP 8
.B "set-appcursor(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the handling Application Cursor Key mode
and is also invoked by the \fBappcursor\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-appkeypad(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the handling of Application Keypad mode and is also
invoked by the \fBappkeypad\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-autolinefeed(\fIon/off/toggle\fP)"
This action sets, unsets or toggles automatic insertion of linefeeds.
It is also invoked by the \fBautolinefeed\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-autowrap(\fIon/off/toggle\fP)"
This action sets, unsets or toggles automatic wrapping of long lines.
It is also invoked by the \fBautowrap\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-backarrow(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBbackarrowKey\fP resource.
It is also invoked from the \fBbackarrow key\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-bellIsUrgent(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBbellIsUrgent\fP resource.
It is also invoked by the \fBbellIsUrgent\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-cursorblink(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBcursorBlink\fP resource.
It is also invoked from the \fBcursorblink\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-cursesemul(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBcurses\fP resource.
It is also invoked from the \fBcursesemul\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-font-doublesize(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBfontDoublesize\fP resource.
It is also invoked by the \fBfont-doublesize\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-hp-function-keys(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBhpFunctionKeys\fP resource.
It is also invoked by the \fBhpFunctionKeys\fP entry in \fImainMenu\fP.
.TP 8
.B "set-jumpscroll(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBjumpscroll\fP resource.
It is also invoked by the \fBjumpscroll\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-font-linedrawing(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fI\*n\fR's state regarding whether the current font
has line-drawing characters and whether it should draw them directly.
It is also invoked by the \fBfont-linedrawing\fP entry in \fIfontMenu\fP.
.\" .\" not implemented
.\" .TP 8
.\" .B "set-font-loading(\fIon/off/toggle\fP)"
.\" This action sets, unsets or toggles the TBD resource
.\" which controls the ability to load VT220 soft fonts.
.\" It is also invoked by the \fBfont-loadable\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-font-packed(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fIforcePackedFont\fR's resource
which controls use of the font's minimum or maximum glyph width.
It is also invoked by the \fBfont-packed\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-keep-selection(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBkeepSelection\fP resource.
It is also invoked by the \fBkeepSelection\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-logging(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the state of the logging option.
.TP 8
.B "set-old-function-keys(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the state of legacy function keys.
It is also invoked by the \fBoldFunctionKeys\fP entry in \fImainMenu\fP.
.TP 8
.B "set-marginbell(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBmarginBell\fP resource.
.TP 8
.B "set-num-lock(\fIon/off/toggle\fP)"
This action toggles the state of the \fBnumLock\fP resource.
.TP 8
.B "set-pop-on-bell(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBpopOnBell\fP resource.
It is also invoked by the \fBpoponbell\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-private-colors(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBprivateColorRegisters\fP resource.
.TP 8
.B "set-render-font(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBrenderFont\fP resource.
It is also invoked by the \fBrender-font\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-reverse-video(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBreverseVideo\fP resource.
It is also invoked by the \fBreversevideo\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-reversewrap(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBreverseWrap\fP resource.
It is also invoked by the \fBreversewrap\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-scroll-on-key(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBscrollKey\fP resource.
It is also invoked from the \fBscrollkey\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-scroll-on-tty-output(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBscrollTtyOutput\fP resource.
It is also invoked from the \fBscrollttyoutput\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-scrollbar(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBscrollbar\fP resource.
It is also invoked by the \fBscrollbar\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-sco-function-keys(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBscoFunctionKeys\fP resource.
It is also invoked by the \fBscoFunctionKeys\fP entry in \fImainMenu\fP.
.TP 8
.B "set-select(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBselectToClipboard\fP resource.
It is also invoked by the \fBselectToClipboard\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-sixel-scrolling(\fIon/off/toggle\fP)"
This action toggles between inline (sixel scrolling) and absolute positioning.
It can also be controlled via DEC private mode 80 (DECSDM) or from
the \fBsixelScrolling\fP entry in the \fIbtMenu\fP.
.TP 8
.B "set-sun-function-keys(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBsunFunctionKeys\fP resource.
It is also invoked by the \fBsunFunctionKeys\fP entry in \fImainMenu\fP.
.TP 8
.B "set-sun-keyboard(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBsunKeyboard\fP resource.
It is also invoked by the \fBsunKeyboard\fP entry in \fImainMenu\fP.
.TP 8
.B "set-tek-text(\fIlarge/2/3/small\fP)"
This action sets the font used in the Tektronix window to the value of the
selected resource according to the argument.
The argument can be either a keyword or single-letter alias,
as shown in parentheses:
.RS
.TP 5
large (l)
Use resource \fBfontLarge\fP, same as menu entry \fBtektextlarge\fP.
.TP 5
two (2)
Use resource \fBfont2\fP, same as menu entry \fBtektext2\fP.
.TP 5
three (3)
Use resource \fBfont3\fP, same as menu entry \fBtektext3\fP.
.TP 5
small (s)
Use resource \fBfontSmall\fP, same as menu entry \fBtektextsmall\fP.
.RE
.TP 8
.B "set-terminal-type(\fItype\fP)"
This action directs output to either the \fIvt\fP or \fItek\fP windows,
according to the \fItype\fP string.
It is also invoked by the
\fBtekmode\fP entry in \fIvtMenu\fP and the \fBvtmode\fP entry in
\fItekMenu\fP.
.TP 8
.B "set-titeInhibit(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBtiteInhibit\fP resource,
which controls switching between the alternate and current screens.
.TP 8
.B "set-toolbar(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the toolbar feature.
It is also invoked by the \fBtoolbar\fP entry in \fImainMenu\fP.
.TP 8
.B "set-utf8-mode(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fButf8\fP resource.
It is also invoked by the \fButf8-mode\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-utf8-title(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fButf8Title\fP resource.
It is also invoked by the \fButf8-title\fP entry in \fIfontMenu\fP.
.TP 8
.B "set-visibility(\fIvt/tek\fP,\fIon/off/toggle\fP)"
This action sets, unsets or toggles whether or not the \fIvt\fP or \fItek\fP windows are
visible.
It is also invoked from the \fBtekshow\fP and \fBvthide\fP entries
in \fIvtMenu\fP and the \fBvtshow\fP and \fBtekhide\fP entries in
\fItekMenu\fP.
.TP 8
.B "set-visual-bell(\fIon/off/toggle\fP)"
This action sets, unsets or toggles the \fBvisualBell\fP resource.
It is also invoked by the \fBvisualbell\fP entry in \fIvtMenu\fP.
.TP 8
.B "set-vt-font(\fId/1/2/3/4/5/6/e/s\fP [,\fInormalfont\fP [, \fIboldfont\fP]])"
This action sets the font or fonts currently being used in the VT102 window.
The first argument is a single character that specifies the font to be
used:
.RS 8
.HP
\fId\fP or \fID\fP indicate the default font (the font initially
used when
\fI\*n\fP was started),
.HP
\fI1\fP through \fI6\fP indicate the fonts
specified by the \fBfont1\fP through \fBfont6\fP resources,
.HP
\fIe\fP or \fIE\fP
indicate the normal and bold fonts that have been set through escape codes
(or specified as the second and third action arguments, respectively), and
.HP
\fIs\fP or \fIS\fP indicate the font selection (as made by programs such as
\fIxfontsel(__mansuffix__)\fP) indicated by the second action argument.
.RE
.IP
If \fI\*n\fR is configured to support wide characters, an
additional two optional parameters are recognized for the \fIe\fP argument:
wide font and wide bold font.
.TP 8
.B "smaller-vt-font()"
Set the font to the next smaller one, based on the font dimensions.
See also \fBset-vt-font()\fP.
.TP 8
.B "soft-reset()"
This action resets the scrolling region.
It is also invoked from the \fBsoftreset\fP entry in \fIvtMenu\fP.
The effect is identical to a soft reset (DECSTR) control sequence.
.TP 8
.B "spawn-new-terminal(params)"
Spawn a new \fI\*n\fP process.
This is available on systems which have a modern version of the
process filesystem, e.g., \*(``/proc\*('', which \fI\*n\fP can read.
.IP
Use the \*(``cwd\*('' process entry, e.g., /proc/12345/cwd to obtain the
working directory of the process which is running in the current \fI\*n\fP.
.IP
On systems which have the \*(``exe\*('' process entry, e.g., /proc/12345/exe,
use this to obtain the actual executable.
Otherwise, use the $PATH variable to find \fI\*n\fP.
.IP
If parameters are given in the action,
pass them to the new \fI\*n\fP process.
.TP 8
.B "start-extend()"
This action is similar to \fBselect-start\fP except that the
selection is extended to the current pointer location.
.TP 8
.B "start-cursor-extend()"
This action is similar to \fBselect-extend\fP except that the
selection is extended to the current text cursor position.
.TP 8
.B "string(\fIstring\fP)"
This action inserts the specified text string as if it had been typed.
Quotation is necessary if the string contains whitespace or
non-alphanumeric characters.
If the string argument begins with the
characters \*(``0x\*('', it is interpreted
as a hex character constant.
.TP 8
.B "tek-copy()"
This action copies the escape codes used to generate the current window
contents to a file in the current directory beginning with the name COPY.
It is also invoked from the \fItekcopy\fP entry in \fItekMenu\fP.
.TP 8
.B "tek-page()"
This action clears the Tektronix window.
It is also invoked by the \fBtekpage\fP entry in \fItekMenu\fP.
.TP 8
.B "tek-reset()"
This action resets the Tektronix window.
It is also invoked by the \fItekreset\fP entry in \fItekMenu\fP.
.TP 8
.B "vi-button()"
Handles a button event (other than press and release)
by echoing a control sequence computed from the event's line number
in the screen relative to the current line:
.sp
.in +8
ESC ^P
.in -8
or
.in +8
ESC ^N
.in -8
.sp
according to whether the event is before, or after the current line,
respectively.
The ^N (or ^P) is repeated once for each line that the event differs
from the current line.
The control sequence is omitted altogether if the button event is on the
current line.
.TP 8
.B "visual-bell()"
This action flashes the window quickly.
.
.PP
The Tektronix window also has the following action:
.TP 8
.B "gin-press(\fIl/L/m/M/r/R\fP)"
This action sends the indicated graphics input code.
.
.SS DEFAULT KEY BINDINGS
.PP
The default bindings in the VT102 window use the SELECT token,
which is set by the \fBselectToClipboard\fP resource:
.NS
Shift Prior:scroll-back(1,halfpage) \\n\\\&
Shift Next:scroll-forw(1,halfpage) \\n\\\&
Shift Select:select-cursor-start() \\\&
select-cursor-end(SELECT, CUT_BUFFER0) \\n\\\&
Shift Insert:insert-selection(SELECT, CUT_BUFFER0) \\n\\\&
Alt Return:fullscreen() \\n\\\&
Scroll_Lock:scroll-lock() \\n\\\&
Shift~Ctrl KP_Add:larger-vt-font() \\n\\\&
Shift Ctrl KP_Add:smaller-vt-font() \\n\\\&
Shift KP_Subtract:smaller-vt-font() \\n\\\&
~Meta :insert-seven-bit() \\n\\\&
Meta :insert-eight-bit() \\n\\\&
!Ctrl :popup-menu(mainMenu) \\n\\\&
!Lock Ctrl :popup-menu(mainMenu) \\n\\\&
!Lock Ctrl @Num_Lock :popup-menu(mainMenu) \\n\\\&
! @Num_Lock Ctrl :popup-menu(mainMenu) \\n\\\&
~Meta :select-start() \\n\\\&
~Meta :select-extend() \\n\\\&
!Ctrl :popup-menu(vtMenu) \\n\\\&
!Lock Ctrl :popup-menu(vtMenu) \\n\\\&
!Lock Ctrl @Num_Lock :popup-menu(vtMenu) \\n\\\&
! @Num_Lock Ctrl :popup-menu(vtMenu) \\n\\\&
~Ctrl ~Meta :ignore() \\n\\\&
Meta :clear-saved-lines() \\n\\\&
~Ctrl ~Meta :insert-selection(SELECT, CUT_BUFFER0) \\n\\\&
!Ctrl :popup-menu(fontMenu) \\n\\\&
!Lock Ctrl :popup-menu(fontMenu) \\n\\\&
!Lock Ctrl @Num_Lock :popup-menu(fontMenu) \\n\\\&
! @Num_Lock Ctrl :popup-menu(fontMenu) \\n\\\&
~Ctrl ~Meta :start-extend() \\n\\\&
~Meta :select-extend() \\n\\\&
Ctrl :scroll-back(1,halfpage,m) \\n\\\&
Lock Ctrl :scroll-back(1,halfpage,m) \\n\\\&
Lock @Num_Lock Ctrl :scroll-back(1,halfpage,m) \\n\\\&
@Num_Lock Ctrl :scroll-back(1,halfpage,m) \\n\\\&
:scroll-back(5,line,m) \\n\\\&
Ctrl :scroll-forw(1,halfpage,m) \\n\\\&
Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\\&
Lock @Num_Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\\&
@Num_Lock Ctrl :scroll-forw(1,halfpage,m) \\n\\\&
:scroll-forw(5,line,m) \\n\\\&
:select-end(SELECT, CUT_BUFFER0) \\n\\\&
:ignore()
.NE
.PP
The default bindings for the scrollbar widget
are separate from the VT100 widget:
.NS
: StartScroll(Forward) \\n\\\&
: StartScroll(Forward) \\n\\\&
: StartScroll(Continuous) MoveThumb() NotifyThumb() \\n\\\&
: StartScroll(Backward) \\n\\\&
: StartScroll(Backward) \\n\\\&
: MoveThumb() NotifyThumb() \\n\\\&
: NotifyScroll(Proportional) EndScroll()
.NE
.PP
The default bindings in the Tektronix window are:
.NS
~Meta: insert-seven-bit() \\n\\\&
Meta: insert-eight-bit() \\n\\\&
!Ctrl : popup-menu(mainMenu) \\n\\\&
!Lock Ctrl : popup-menu(mainMenu) \\n\\\&
!Lock Ctrl @Num_Lock : popup-menu(mainMenu) \\n\\\&
!Ctrl @Num_Lock : popup-menu(mainMenu) \\n\\\&
!Ctrl : popup-menu(tekMenu) \\n\\\&
!Lock Ctrl : popup-menu(tekMenu) \\n\\\&
!Lock Ctrl @Num_Lock : popup-menu(tekMenu) \\n\\\&
!Ctrl @Num_Lock : popup-menu(tekMenu) \\n\\\&
Shift ~Meta: gin-press(L) \\n\\\&
~Meta: gin-press(l) \\n\\\&
Shift ~Meta: gin-press(M) \\n\\\&
~Meta: gin-press(m) \\n\\\&
Shift ~Meta: gin-press(R) \\n\\\&
~Meta: gin-press(r)
.NE
.PP
Here is an example which uses shifted select/paste to copy to the clipboard,
and unshifted select/paste for the primary selection.
In each case, a (different) cut buffer is
also a target or source of the select/paste operation.
It is important to remember however,
that cut buffers store data in ISO-8859-1 encoding,
while selections can store data in a variety of formats and encodings.
While \fI\*n\fP owns the selection, it highlights it.
When it loses the selection, it removes the corresponding highlight.
But you can still paste from the corresponding cut buffer.
.NS
*VT100*translations: #override \\n\\\&
~Shift~Ctrl: insert-selection(PRIMARY, CUT_BUFFER0) \\n\\\&
Shift~Ctrl: insert-selection(CLIPBOARD, CUT_BUFFER1) \\n\\\&
~Shift: select-end(PRIMARY, CUT_BUFFER0) \\n\\\&
Shift: select-end(CLIPBOARD, CUT_BUFFER1)
.NE
.PP
Below is a sample of how the \fBkeymap()\fP action is used to add special
keys for entering commonly-typed works:
.NS
*VT100.Translations: #override F13: keymap(dbx)
*VT100.dbxKeymap.translations: \\\&
F14: keymap(None) \\n\\\&
F17: string("next") string(0x0d) \\n\\\&
F18: string("step") string(0x0d) \\n\\\&
F19: string("continue") string(0x0d) \\n\\\&
F20: string("print ") insert-selection(PRIMARY, CUT_BUFFER0)
.NE
.PP
Some people prefer using the left pointer button
for dragging the scrollbar thumb.
That can be setup by altering the translations resource, e.g.,
.NS
*VT100.scrollbar.translations: #override \\n\\\&
: StartScroll(Forward) \\n\\\&
: StartScroll(Continuous) MoveThumb() NotifyThumb() \\n\\\&
: StartScroll(Backward) \\n\\\&
: MoveThumb() NotifyThumb() \\n\\\&
: NotifyScroll(Proportional) EndScroll()
.NE
.SH "CONTROL SEQUENCES AND KEYBOARD"
The \fIXterm Control Sequences\fP document lists the control sequences which
an application can send \fI\*n\fP to make it perform various operations.
Most of these operations are standardized, from either the DEC or Tektronix
terminals, or from more widely used standards such as ISO-6429.
.
.
.SH ENVIRONMENT
.I Xterm
sets several environment variables:
.TP 5
DISPLAY
is the display name,
pointing to the X server (see \fBDISPLAY NAMES\fP in X(__miscmansuffix__)).
.TP 5
TERM
is set according to the termcap (or terminfo) entry which it is using as
a reference.
.TP 5
WINDOWID
is set to the X window id number of the \fI\*n\fP window.
.TP 5
XTERM_FILTER
is set if a locale-filter is used.
The value is the pathname of the filter.
.TP 5
XTERM_LOCALE
shows the locale which was used by \fI\*n\fP on startup.
Some shell initialization scripts may set a different locale.
.TP 5
XTERM_SHELL
is set to the pathname of the program which is invoked.
Usually that is a shell program, e.g., \fI/bin/sh\fP.
Since it is not necessarily a shell program however,
it is distinct from \*(``SHELL\*(''.
.TP 5
XTERM_VERSION
is set to the string displayed by the \fB\-version\fP option.
That is normally an identifier for the X Window libraries used to
build \fI\*n\fP, followed by
\fI\*n\fP's patch number in parenthesis.
The patch number is also part of the response to a Secondary Device Attributes
(DA) control sequence (see \fIXterm Control Sequences\fP).
.
.PP
Depending on your system configuration, \fI\*n\fP may also set the
following:
.TP 5
COLUMNS
the width of the \fI\*n\fP in characters (cf: \*(``stty columns\*('').
.TP 5
HOME
when \fI\*n\fP is configured to update utmp.
.TP 5
LINES
the height of the \fI\*n\fP in characters (cf: \*(``stty rows\*('').
.TP 5
LOGNAME
when \fI\*n\fP is configured to update utmp.
.TP 5
SHELL
when \fI\*n\fP is configured to update utmp.
It is also set if you provide the shell name as the optional parameter.
.TP 5
TERMCAP
the contents of the termcap entry corresponding to $TERM,
with lines and columns values substituted
for the actual size window you have created.
.TP 5
TERMINFO
may be defined to a nonstandard location in the configure script.
.\"
.
.
.SH FILES
The actual pathnames given may differ on your system.
.TP 5
\fI/etc/utmp\fP
the system logfile, which records user logins.
.TP 5
\fI/etc/wtmp\fP
the system logfile, which records user logins and logouts.
.TP 5
.I __apploaddir__/__default_class__
the \fI\*n\fP default application resources.
.TP 5
.I __apploaddir__/__default_class__\-color
the \fI\*n\fP color application resources.
If your display supports color, use this
.in +10
*customization: \-color
.in -10
in your .Xdefaults file to
automatically use this resource file rather than
.IR __apploaddir__/__default_class__ .
If you do not do this,
\fI\*n\fP uses its compiled-in default resource settings for colors.
.TP 5
.I __pixmapsdir__
the directory in which \fI\*n\fP's pixmap icon files are installed.
.
.
.SH ERROR MESSAGES
Most of the fatal error messages from \fI\*n\fP use the following format:
.RS
\*n: Error \fIXXX\fP, errno \fIYYY\fP: \fIZZZ\fP
.RE
The \fIXXX\fP codes (which are used by \fI\*n\fP as its exit-code)
are listed below, with a brief explanation.
.TP 5
1
is used for miscellaneous errors, usually accompanied by a specific message,
.TP
11
ERROR_FIONBIO
.br
main: ioctl() failed on FIONBIO
.TP
12
ERROR_F_GETFL
.br
main: ioctl() failed on F_GETFL
.TP
13
ERROR_F_SETFL
.br
main: ioctl() failed on F_SETFL
.TP
14
ERROR_OPDEVTTY
.br
spawn: open() failed on /dev/tty
.TP
15
ERROR_TIOCGETP
.br
spawn: ioctl() failed on TIOCGETP
.TP
17
ERROR_PTSNAME
.br
spawn: ptsname() failed
.TP
18
ERROR_OPPTSNAME
.br
spawn: open() failed on ptsname
.TP
19
ERROR_PTEM
.br
spawn: ioctl() failed on I_PUSH/"ptem"
.TP
20
ERROR_CONSEM
.br
spawn: ioctl() failed on I_PUSH/"consem"
.TP
21
ERROR_LDTERM
.br
spawn: ioctl() failed on I_PUSH/"ldterm"
.TP
22
ERROR_TTCOMPAT
.br
spawn: ioctl() failed on I_PUSH/"ttcompat"
.TP
23
ERROR_TIOCSETP
.br
spawn: ioctl() failed on TIOCSETP
.TP
24
ERROR_TIOCSETC
.br
spawn: ioctl() failed on TIOCSETC
.TP
25
ERROR_TIOCSETD
.br
spawn: ioctl() failed on TIOCSETD
.TP
26
ERROR_TIOCSLTC
.br
spawn: ioctl() failed on TIOCSLTC
.TP
27
ERROR_TIOCLSET
.br
spawn: ioctl() failed on TIOCLSET
.TP
28
ERROR_INIGROUPS
.br
spawn: initgroups() failed
.TP
29
ERROR_FORK
.br
spawn: fork() failed
.TP
30
ERROR_EXEC
.br
spawn: exec() failed
.TP
32
ERROR_PTYS
.br
get_pty: not enough ptys
.TP
34
ERROR_PTY_EXEC
.br
waiting for initial map
.TP
35
ERROR_SETUID
.br
spawn: setuid() failed
.TP
36
ERROR_INIT
.br
spawn: can't initialize window
.TP
46
ERROR_TIOCKSET
.br
spawn: ioctl() failed on TIOCKSET
.TP
47
ERROR_TIOCKSETC
.br
spawn: ioctl() failed on TIOCKSETC
.TP
49
ERROR_LUMALLOC
.br
luit: command-line malloc failed
.TP
50
ERROR_SELECT
.br
in_put: select() failed
.TP
54
ERROR_VINIT
.br
VTInit: can't initialize window
.TP
57
ERROR_KMMALLOC1
.br
HandleKeymapChange: malloc failed
.TP
60
ERROR_TSELECT
.br
Tinput: select() failed
.TP
64
ERROR_TINIT
.br
TekInit: can't initialize window
.TP
71
ERROR_BMALLOC2
.br
SaltTextAway: malloc() failed
.TP
80
ERROR_LOGEXEC
.br
StartLog: exec() failed
.TP
83
ERROR_XERROR
.br
xerror: XError event
.TP
84
ERROR_XIOERROR
.br
xioerror: X I/O error
.TP
85
ERROR_ICEERROR
.br
ICE I/O error
.TP
90
ERROR_SCALLOC
.br
Alloc: calloc() failed on base
.TP
91
ERROR_SCALLOC2
.br
Alloc: calloc() failed on rows
.TP
102
ERROR_SAVE_PTR
.br
ScrnPointers: malloc/realloc() failed
.
.
.SH BUGS
.
.PP
Large pastes do not work on some systems.
This is not a bug in
\fI\*n\fP; it is a bug in the pseudo terminal driver of those
systems.
\fI\*n\fP feeds large pastes to the pty only as fast as the pty
will accept data, but some pty drivers do not return enough information
to know if the write has succeeded.
.
.PP
When connected to an input method, it is possible for \*n to hang
if the XIM server is suspended or killed.
.
.PP
Many of the options are not resettable after
.I \*n
starts.
.
.PP
This program still needs to be rewritten.
It should be split into very
modular sections, with the various emulators being completely separate
widgets that do not know about each other.
Ideally, you'd like to be able to
pick and choose emulator widgets and stick them into a single control widget.
.
.PP
There needs to be a dialog box to allow entry of the Tek COPY file name.
.
.
.SH "SEE ALSO"
.na
resize(__mansuffix__),
luit(__mansuffix__),
u\*n(__mansuffix__),
X(__miscmansuffix__),
pty(4),
tty(4)
.ad
.PP
\fIXterm Control Sequences\fP
(this is the file ctlseqs.ms).
.sp
http://invisible-island.net/xterm/xterm.html
.br
http://invisible-island.net/xterm/ctlseqs/ctlseqs.html
.
.
.SH AUTHORS
Far too many people, including:
.sp
Loretta Guarino Reid (DEC-UEG-WSL),
Joel McCormack (DEC-UEG-WSL), Terry Weissman (DEC-UEG-WSL),
Edward Moy (Berkeley), Ralph R. Swick (MIT-Athena),
Mark Vandevoorde (MIT-Athena), Bob McNamara (DEC-MAD),
Jim Gettys (MIT-Athena), Bob Scheifler (MIT X Consortium), Doug Mink (SAO),
Steve Pitschke (Stellar), Ron Newman (MIT-Athena), Jim Fulton (MIT X
Consortium), Dave Serisky (HP), Jonathan Kamens (MIT-Athena),
Jason Bacon,
Stephen P. Wall,
David Wexelblat, and
Thomas Dickey (invisible-island.net).
xterm-297/fontutils.h 0000644 0001751 0000144 00000012133 12213450262 013450 0 ustar tom users /* $XTermId: fontutils.h,v 1.87 2013/09/09 22:50:26 tom Exp $ */
/*
* Copyright 1998-2011,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
#ifndef included_fontutils_h
#define included_fontutils_h 1
#include
/* *INDENT-OFF* */
extern Bool xtermLoadDefaultFonts (XtermWidget /* xw */);
extern Bool xtermOpenFont (XtermWidget /* xw */, const char */* name */, XTermFonts * /* result */, fontWarningTypes /* warn */, Bool /* force */);
extern XTermFonts * xtermCloseFont (XtermWidget /* xw */, XTermFonts * /* fnt */);
extern const VTFontNames * xtermFontName (const char */* normal */);
extern int lookupRelativeFontSize (XtermWidget /* xw */, int /* old */, int /* relative */);
extern int xtermGetFont(const char * /* param */);
extern int xtermLoadFont (XtermWidget /* xw */, const VTFontNames */* fonts */, Bool /* doresize */, int /* fontnum */);
extern void HandleSetFont PROTO_XT_ACTIONS_ARGS;
extern void SetVTFont (XtermWidget /* xw */, int /* i */, Bool /* doresize */, const VTFontNames */* fonts */);
extern void xtermCloseFonts (XtermWidget /* xw */, XTermFonts * /* fnts[fMAX] */);
extern void xtermComputeFontInfo (XtermWidget /* xw */, VTwin */* win */, XFontStruct */* font */, int /* sbwidth */);
extern void xtermCopyFontInfo (XTermFonts * /* target */, XTermFonts * /* source */);
extern void xtermFreeFontInfo (XTermFonts * /* target */);
extern void xtermSaveFontInfo (TScreen * /* screen */, XFontStruct */* font */);
extern void xtermSetCursorBox (TScreen * /* screen */);
extern void xtermUpdateFontInfo (XtermWidget /* xw */, Bool /* doresize */);
#if OPT_DEC_CHRSET
extern char *xtermSpecialFont (TScreen */* screen */, unsigned /* atts */, unsigned /* chrset */);
#endif
#if OPT_BOX_CHARS
#define FontIsIncomplete(font) \
((font)->fs != 0 \
&& (font)->fs->per_char != 0 \
&& !(font)->fs->all_chars_exist)
#define ForceBoxChars(screen,ch) \
(xtermIsDecGraphic(ch) \
&& (screen)->force_box_chars)
/*
* Keep track of (some) characters to make the check for missing
* characters faster. If the character is known to be missing,
* the cache value is '2'. If we have checked the character, the
* cached value is '1'.
*/
#if OPT_WIDE_CHARS
#define CheckedKnownMissing(font, ch) \
(((ch) < KNOWN_MISSING) && ((font)->known_missing[(Char)(ch)] > 0))
#else
#define CheckedKnownMissing(font, ch) \
((font)->known_missing[(Char)(ch)] > 0)
#endif
#define IsXtermMissingChar(screen, ch, font) \
(CheckedKnownMissing(font, ch) \
? ((font)->known_missing[(Char)(ch)] > 1) \
: ((FontIsIncomplete(font) && xtermMissingChar(ch, font)) \
|| ForceBoxChars(screen, ch)))
extern Bool xtermMissingChar (unsigned /* ch */, XTermFonts */* font */);
extern void xtermDrawBoxChar (XtermWidget /* xw */, unsigned /* ch */, unsigned /* flags */, GC /* gc */, int /* x */, int /* y */, int /* cols */);
#else
#define IsXtermMissingChar(screen, ch, font) False
#endif
#if OPT_LOAD_VTFONTS
extern void HandleLoadVTFonts PROTO_XT_ACTIONS_ARGS;
#endif
#if OPT_LOAD_VTFONTS || OPT_WIDE_CHARS
extern Bool xtermLoadWideFonts (XtermWidget /* w */, Bool /* nullOk */);
extern void xtermSaveVTFonts(XtermWidget /* xw */);
#endif
#define xtermIsDecGraphic(ch) ((ch) > 0 && (ch) < 32)
#if OPT_RENDERFONT
extern Bool xtermXftMissing (XtermWidget /* xw */, XftFont * /* font */, unsigned /* wc */);
extern void xtermCloseXft(TScreen * /* screen */, XTermXftFonts * /* pub */);
#endif
#if OPT_SHIFT_FONTS
extern String getFaceName(XtermWidget /* xw */, Bool /* wideName */);
extern void HandleLargerFont PROTO_XT_ACTIONS_ARGS;
extern void HandleSmallerFont PROTO_XT_ACTIONS_ARGS;
extern void setFaceName(XtermWidget /* xw */, const char * /*value */);
#endif
#if OPT_WIDE_CHARS
extern unsigned ucs2dec (unsigned);
extern unsigned dec2ucs (unsigned);
#endif
/* *INDENT-ON* */
#endif /* included_fontutils_h */
xterm-297/xtermcfg.hin 0000644 0001751 0000144 00000023447 12161645166 013614 0 ustar tom users /* $XTermId: xtermcfg.hin,v 1.200 2013/06/23 19:20:22 tom Exp $ */
/*
* Copyright 1997-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
#ifndef included_xtermcfg_h
#define included_xtermcfg_h 1
/* This is a template for */
#undef ALLOWLOGFILEEXEC /* CF_ARG_ENABLE(enable-logfile-exec) */
#undef ALLOWLOGGING /* CF_ARG_ENABLE(enable-logging) */
#undef CC_HAS_PROTOS /* CF_ANSI_CC */
#undef CSRG_BASED /* CF_TYPE_FD_MASK */
#undef DECL_ERRNO /* CF_ERRNO */
#undef DEFDELETE_DEL /* AC_ARG_ENABLE(delete-is-del) */
#undef DEF_ALT_SENDS_ESC /* CF_ARG_ENABLE(alt-sends-esc) */
#undef DEF_BACKARO_BS /* CF_ARG_DISABLE(backarrow-key) */
#undef DEF_BACKARO_ERASE /* CF_ARG_ENABLE(backarrow-is-erase) */
#undef DEF_META_SENDS_ESC /* CF_ARG_ENABLE(meta-sends-esc) */
#undef DFT_COLORMODE /* AC_ARG_WITH(default-color-mode) */
#undef DFT_DECID /* AC_ARG_WITH(default-terminal-id) */
#undef DFT_TERMTYPE /* AC_ARG_WITH(default-term-type) */
#undef DISABLE_SETGID /* CF_ARG_DISABLE(setgid) */
#undef DISABLE_SETUID /* CF_ARG_DISABLE(setuid) */
#undef HAVE_GETHOSTNAME /* AC_CHECK_FUNCS(gethostname) */
#undef HAVE_GETLOGIN /* AC_CHECK_FUNCS(getlogin) */
#undef HAVE_GRANTPT /* CF_FUNC_GRANTPT */
#undef HAVE_GRANTPT_PTY_ISATTY /* CF_FUNC_GRANTPT */
#undef HAVE_LANGINFO_CODESET /* AM_LANGINFO_CODESET */
#undef HAVE_LASTLOG_H /* CF_LASTLOG */
#undef HAVE_LIBXPM /* CF_WITH_XPM */
#undef HAVE_LIB_NEXTAW /* CF_X_ATHENA(--with-neXtaw) */
#undef HAVE_LIB_PCRE /* CF_WITH_PCRE */
#undef HAVE_LIB_XAW /* CF_X_ATHENA */
#undef HAVE_LIB_XAW3D /* CF_X_ATHENA(--with-Xaw3d) */
#undef HAVE_LIB_XAWPLUS /* CF_X_ATHENA(--with-XawPlus) */
#undef HAVE_NCURSES_CURSES_H /* AC_CHECK_HEADERS(ncurses/curses.h) */
#undef HAVE_NCURSES_TERM_H /* AC_CHECK_HEADERS(ncurses/term.h) */
#undef HAVE_PATHS_H /* CF_LASTLOG */
#undef HAVE_PCREPOSIX_H /* CF_WITH_PCRE */
#undef HAVE_POSIX_OPENPT /* CF_FUNC_GRANTPT */
#undef HAVE_POSIX_SAVED_IDS /* CF_POSIX_SAVED_IDS */
#undef HAVE_PTSNAME /* CF_FUNC_GRANTPT */
#undef HAVE_PUTENV /* AC_CHECK_FUNCS(putenv) */
#undef HAVE_SCHED_YIELD /* AC_CHECK_FUNCS(sched_yield) */
#undef HAVE_SETPGID /* AC_CHECK_FUNCS(setpgid) */
#undef HAVE_STDLIB_H /* AC_CHECK_HEADERS(stdlib.h) */
#undef HAVE_STRFTIME /* AC_CHECK_FUNCS(strftime) */
#undef HAVE_SYS_TIME_H /* AC_HEADER_TIME */
#undef HAVE_SYS_TTYDEFAULTS_H /* AC_CHECK_HEADERS(sys/ttydefaults.h) */
#undef HAVE_SYS_WAIT_H /* AC_HEADER_SYS_WAIT */
#undef HAVE_TCGETATTR /* AC_CHECK_FUNCS(tcgetattr) */
#undef HAVE_TERMCAP_H /* AC_CHECK_HEADERS(termcap.h) */
#undef HAVE_TERMIOS_H /* AC_CHECK_HEADERS(termios.h) */
#undef HAVE_TERMIO_C_ISPEED /* CF_TERMIO_C_ISPEED */
#undef HAVE_TERM_H /* AC_CHECK_HEADERS(term.h) */
#undef HAVE_TIGETSTR /* AC_CHECK_FUNCS(tigetstr) */
#undef HAVE_UNISTD_H /* AC_CHECK_HEADERS(unistd.h) */
#undef HAVE_UNSETENV /* AC_CHECK_FUNCS(unsetenv) */
#undef HAVE_USE_EXTENDED_NAMES /* AC_CHECK_FUNCS(use_extended_names) */
#undef HAVE_UTMP /* CF_UTMP */
#undef HAVE_UTMP_UT_HOST /* CF_UTMP_UT_HOST */
#undef HAVE_UTMP_UT_SESSION /* CF_UTMP_UT_SESSION */
#undef HAVE_UTMP_UT_SYSLEN /* CF_UTMP_UT_SYSLEN */
#undef HAVE_UTMP_UT_XSTATUS /* CF_UTMP_UT_XSTATUS */
#undef HAVE_UTMP_UT_XTIME /* CF_UTMP_UT_XTIME */
#undef HAVE_WAITPID /* AC_CHECK_FUNCS(waitpid) */
#undef HAVE_WCHAR_H /* AC_CHECK_HEADERS(wchar.h) */
#undef HAVE_WCSWIDTH /* AC_CHECK_FUNCS(wcswidth) */
#undef HAVE_WCWIDTH /* AC_CHECK_FUNCS(wcwidth) */
#undef HAVE_X11_DECKEYSYM_H /* AC_CHECK_HEADERS(X11/DECkeysym.h) */
#undef HAVE_X11_EXTENSIONS_XKB_H /* AC_CHECK_HEADERS(X11/extensions/XKB.h) */
#undef HAVE_X11_SUNKEYSYM_H /* AC_CHECK_HEADERS(X11/Sunkeysym.h) */
#undef HAVE_X11_XF86KEYSYM_H /* AC_CHECK_HEADERS(X11/XF86keysym.h) */
#undef HAVE_X11_XKBLIB_H /* AC_CHECK_HEADERS(X11/XKBlib.h) */
#undef HAVE_X11_XPOLL_H /* AC_CHECK_HEADERS(X11/Xpoll.h) */
#undef HAVE_XFTDRAWSETCLIP /* CF_X_FREETYPE */
#undef HAVE_XFTDRAWSETCLIPRECTANGLES /* CF_X_FREETYPE */
#undef HAVE_XKBKEYCODETOKEYSYM /* AC_CHECK_FUNCS(XkbKeycodeToKeysym) */
#undef HAVE_XKBQUERYEXTENSION /* AC_CHECK_FUNCS(XkbQueryExtension) */
#undef HAVE_XKB_BELL_EXT /* CF_XKB_BELL_EXT */
#undef LUIT_PATH /* CF_ARG_ENABLE(luit) */
#undef NO_ACTIVE_ICON /* CF_ARG_DISABLE(active-icon) */
#undef NO_LEAKS /* CF_ARG_DISABLE(leaks) */
#undef OPT_256_COLORS /* CF_ARG_ENABLE(256-color) */
#undef OPT_88_COLORS /* CF_ARG_ENABLE(88-color) */
#undef OPT_AIX_COLORS /* CF_ARG_DISABLE(16-color) */
#undef OPT_BLINK_CURS /* CF_ARG_DISABLE(blink-cursor) */
#undef OPT_BLINK_TEXT /* CF_ARG_DISABLE(blink-text) */
#undef OPT_BOX_CHARS /* CF_ARG_DISABLE(boxchars) */
#undef OPT_BROKEN_OSC /* CF_ARG_ENABLE(broken-osc) */
#undef OPT_BROKEN_ST /* CF_ARG_DISABLE(broken-st) */
#undef OPT_C1_PRINT /* CF_ARG_DISABLE(c1-print) */
#undef OPT_COLOR_CLASS /* CF_ARG_DISABLE(color-class) */
#undef OPT_DABBREV /* CF_ARG_ENABLE(dabbrev) */
#undef OPT_DEC_CHRSET /* CF_ARG_DISABLE(doublechars) */
#undef OPT_DEC_LOCATOR /* CF_ARG_ENABLE(dec-locator) */
#undef OPT_DOUBLE_BUFFER /* CF_ARG_ENABLE(double-buffer) */
#undef OPT_DEC_RECTOPS /* CF_ARG_ENABLE(rectangles) */
#undef OPT_EXEC_XTERM /* CF_ARG_ENABLE(exec-xterm) */
#undef OPT_FIFO_LINES /* CF_ARG_ENABLE(fifo-lines) */
#undef OPT_HIGHLIGHT_COLOR /* CF_ARG_DISABLE(highlighting) */
#undef OPT_HP_FUNC_KEYS /* CF_ARG_ENABLE(hp-fkeys) */
#undef OPT_I18N_SUPPORT /* CF_ARG_DISABLE(i18n) */
#undef OPT_INITIAL_ERASE /* CF_ARG_DISABLE(initial-erase) */
#undef OPT_INPUT_METHOD /* CF_ARG_DISABLE(input-method) */
#undef OPT_ISO_COLORS /* CF_ARG_DISABLE(ansi-color) */
#undef OPT_LOAD_VTFONTS /* CF_ARG_ENABLE(load-vt-fonts) */
#undef OPT_LUIT_PROG /* CF_ARG_ENABLE(luit) */
#undef OPT_MAXIMIZE /* CF_ARG_DISABLE(maximize) */
#undef OPT_MINI_LUIT /* CF_ARG_ENABLE(mini-luit) */
#undef OPT_NUM_LOCK /* CF_ARG_DISABLE(num-lock) */
#undef OPT_PASTE64 /* CF_ARG_ENABLE(past64) */
#undef OPT_PC_COLORS /* CF_ARG_DISABLE(pc-color) */
#undef OPT_PTY_HANDSHAKE /* CF_ARG_ENABLE(pty-handshake) */
#undef OPT_READLINE /* CF_ARG_ENABLE(readline-mouse) */
#undef OPT_SAME_NAME /* CF_ARG_DISABLE(samename) */
#undef OPT_SCO_FUNC_KEYS /* CF_ARG_ENABLE(sco-fkeys) */
#undef OPT_SELECTION_OPS /* CF_ARG_DISABLE(selection-ops) */
#undef OPT_SELECT_REGEX /* CF_ARG_DISABLE(regex) */
#undef OPT_SESSION_MGT /* CF_ARG_DISABLE(session-mgt) */
#undef OPT_SIXEL_GRAPHICS /* CF_ARG_ENABLE(sixel-graphics) */
#undef OPT_SUN_FUNC_KEYS /* CF_ARG_ENABLE(sun-fkeys) */
#undef OPT_TCAP_FKEYS /* CF_ARG_ENABLE(tcap-fkeys) */
#undef OPT_TCAP_QUERY /* CF_ARG_ENABLE(tcap-query) */
#undef OPT_TEK4014 /* CF_ARG_DISABLE(tek4014) */
#undef OPT_TOOLBAR /* CF_ARG_ENABLE(toolbar) */
#undef OPT_VT52_MODE /* CF_ARG_DISABLE(vt52) */
#undef OPT_WIDER_ICHAR /* CF_ARG_ENABLE(16bit-chars) */
#undef OPT_WIDE_CHARS /* CF_ARG_OPTION(wide-chars) */
#undef OPT_XMC_GLITCH /* CF_ARG_ENABLE(xmc-glitch) */
#undef OPT_ZICONBEEP /* CF_ARG_DISABLE(ziconbeep) */
#undef OWN_TERMINFO_DIR /* AC_ARG_WITH(own-terminfo) */
#undef PROCFS_ROOT /* CF_ARG_ENABLE(exec-xterm) */
#undef SCROLLBAR_RIGHT /* CF_ARG_ENABLE(rightbar) */
#undef SIG_ATOMIC_T /* CF_SIG_ATOMIC_T */
#undef SVR4 /* CF_SVR4, imake */
#undef SYSV /* CF_SYSV, imake */
#undef TIME_WITH_SYS_TIME /* AC_HEADER_TIME */
#undef TTY_GROUP_NAME /* CF_TTY_GROUP */
#undef USE_LASTLOG /* CF_LASTLOG */
#undef USE_POSIX_WAIT /* CF_POSIX_WAIT */
#undef USE_STRUCT_LASTLOG /* CF_STRUCT_LASTLOG */
#undef USE_SYSV_UTMP /* CF_UTMP */
#undef USE_SYS_SELECT_H /* CF_TYPE_FD_SET */
#undef USE_TERMCAP /* CF_FUNC_TGETENT */
#undef USE_TERMINFO /* CF_FUNC_TGETENT */
#undef USE_TTY_GROUP /* CF_TTY_GROUP */
#undef USE_UTEMPTER /* CF_UTEMPTER */
#undef USE_UTMP_SETGID /* AC_ARG_WITH(utmp-setgid) */
#undef UTMPX_FOR_UTMP /* CF_UTMP */
#undef XRENDERFONT /* CF_X_FREETYPE */
#undef cc_t /* CF_TYPE_CC_T */
#undef gid_t /* AC_TYPE_UID_T */
#undef mode_t /* AC_TYPE_MODE_T */
#undef off_t /* AC_TYPE_OFF_T */
#undef pid_t /* AC_TYPE_PID_T */
#undef time_t /* AC_CHECK_TYPE(time_t, long) */
#undef uid_t /* AC_TYPE_UID_T */
#undef ut_name /* CF_UTMP */
#undef ut_xstatus /* CF_UTMP_UT_XSTATUS */
#undef ut_xtime /* CF_UTMP_UT_XTIME */
/*
* Ifdef'd to make it simple to override.
*/
#ifndef OPT_TRACE
#undef OPT_TRACE /* CF_ARG_ENABLE(trace) */
#undef OPT_TRACE_FLAGS /* ...no option */
#endif
/*
* g++ support for __attribute__() is haphazard.
*/
#ifndef __cplusplus
#undef GCC_PRINTF
#undef GCC_PRINTFLIKE
#undef GCC_NORETURN
#undef GCC_UNUSED
#endif
#ifndef HAVE_X11_XPOLL_H
#define NO_XPOLL_H /* X11R6.1 & up use Xpoll.h for select() definitions */
#endif
/* vile:cmode
*/
#endif /* included_xtermcfg_h */
xterm-297/Imakefile 0000644 0001751 0000144 00000021673 12161673605 013104 0 ustar tom users XCOMM $XTermId: Imakefile,v 1.109 2013/06/23 22:32:37 tom Exp $
XCOMM
XCOMM Attention xterm porters
XCOMM
XCOMM
XCOMM Xterm assumes that bcopy can handle overlapping arguments. If your
XCOMM bcopy (or memcpy) cannot, write a routine called bcopy and link it in
XCOMM or add -Dbcopy=mybcopy to the DEFINES list below.
XCOMM
/* Uncomment SCROLLBAR_RIGHT if you want the scroll bar to be on the right */
SCROLLBAR_RIGHT = -DSCROLLBAR_RIGHT
/* Define UTF8support to compile-in support for UTF-8 */
#define UTF8support
/*
* setgid mode works for systems that do not require setuid to open pty.
*
* This feature could also be applied to FreeBSD, but requires the installer
* to define a "utmp" group as well as chgrp the utmp file to match.
*
* Note: InstallXtermSetUID is always defined; InstallXtermSetGID is defined
* in newer imake configurations.
*/
#if !defined(InstallXtermSetGID) && !InstallXtermSetUID
#if defined(OpenBSDArchitecture) || \
(defined(LinuxArchitecture) && \
(LinuxCLibMajorVersion == 6))
#define InstallXtermSetGID YES
#endif
#endif
/*
* Override the set uid/gid flags to use the utempter library.
*/
#if defined(UseUtempter)
#undef InstallXtermSetUID /* imake sets this */
#undef InstallXtermSetGID /* we set this */
#define InstallXtermSetUID NO
#define InstallXtermSetGID NO
UTMPLIB = -lutempter
#endif
/*
* Fixes to allow compile with X11R5, etc.
*/
#ifndef InstGidFlags
#define InstGidFlags -m 2755 -g utmp
#endif
#ifndef InstUidFlags
#define InstUidFlags -m 4711
#endif
#ifndef XkbClientDefines
#define XkbClientDefines /**/
#endif
#ifndef InstallXtermSetUID
#define InstallXtermSetUID NO
#endif
#ifndef InstallXtermSetGID
#define InstallXtermSetGID NO
#endif
#ifndef XkbClientDepLibs
#define XkbClientDepLibs /**/
#endif
#ifndef XkbClientLibs
#define XkbClientLibs /**/
#endif
/* This must come before setting DEFINES */
#if InstallXtermSetGID
CSGIDFLAGS = -DUSE_UTMP_SETGID
INSTSETIDFLAGS = InstGidFlags
#elif InstallXtermSetUID
INSTSETIDFLAGS = InstUidFlags
#else
INSTSETIDFLAGS = NullParameter
#endif
/*
* Compensate for broken imake configuration.
*/
#ifdef LinuxGnuSourceDefines
# ifdef UseInstalled
IMAKEDEFINES = -D_GNU_SOURCE
# endif
#endif
#ifndef SpecialCObjectRule
#define SpecialCObjectRule(module,ignore,defines) \
module.o: ; $(CC) -c defines $(CFLAGS) module.c
#endif
#ifndef ProgramTargetName
#define ProgramTargetName(program) program
#endif
/*
* add -DWTMP and -DLASTLOG if you want them; make sure that bcopy can
* handle overlapping copies before using it.
*/
#if SetTtyGroup /* turn on in config/machine.cf */
TTYGROUPDEF = -DUSE_TTY_GROUP
#endif
#ifdef UsePUCCPtyd /* turn on in config/site.def */
PUCCPTYDDEF = -DPUCC_PTYD /* does not need to be setuid */
PTYLIB = -lpucc
#endif
#if defined(NetBSDArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(FreeBSDArchitecture) || \
(defined(LinuxArchitecture) && \
(LinuxCLibMajorVersion == 6) && (LinuxCLibMinorVersion < 1))
PTYLIB = -lutil
#endif
#ifdef DarwinArchitecture
/* dyld can deadlock if a signal comes in when it is looking up a symbol */
LOCAL_LDFLAGS = -Wl,-bind_at_load
#endif
OSMAJORVERSION = OSMajorVersion
OSMINORVERSION = OSMinorVersion
#if defined(NTOArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(SGIArchitecture) || \
defined(SunArchitecture)
TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR
#elif defined(LinuxArchitecture)
# if LinuxUsesNcurses
TERMCAPDEFINES=-DUSE_TERMINFO -DHAVE_TIGETSTR
# endif
#endif
#if !defined(OS2Architecture) && !defined(__GNU__)
#if defined(UseUtempter)
UTMPDEF = -DUSE_UTEMPTER
#else
UTMPDEF = -DUTMP
#endif
#endif
#ifdef UTF8support
UTF8_OPTION = -DOPT_WIDE_CHARS -DOPT_LUIT_PROG
UTF8SRC = charclass.c precompose.c wcwidth.c xutf8.c
UTF8OBJ = charclass.o precompose.o wcwidth.o xutf8.o
#endif
#if BuildXftLibrary
#define XRenderSupport
#endif
#ifdef XRenderSupport
XRFDEF = -DXRENDERFONT -DXFREE86_FT2
XRFLIBS = XftClientLibs
XRFDEPLIBS = XftClientDepLibs
XRFINCLUDES = $(XFTINCLUDES)
#endif
#if !HasPutenv
PUTENVDEF = -DNOPUTENV
#endif
#ifdef SixelXTerm
SIXELDEF = -DOPT_SIXEL_GRAPHICS=1
#endif
#ifdef TraceXTerm
TRACEDEF = -DOPT_TRACE=1
#endif
MAIN_DEFINES = $(UTMPDEF) $(TTYGROUPDEF) $(PUCCPTYDDEF) $(CSGIDFLAGS) \
-DOSMAJORVERSION=$(OSMAJORVERSION) \
-DOSMINORVERSION=$(OSMINORVERSION)
MISC_DEFINES = /* -DALLOWLOGGING -DALLOWLOGFILEEXEC */
XKB_DEFINES = XkbClientDefines
PATH_DEFINES = -DPROJECTROOT=$(PROJECTROOT)
DEFINES = $(XKB_DEFINES) $(TERMCAPDEFINES) $(FEATURE_DEFINES) $(SCROLLBAR_RIGHT) $(UTF8_OPTION) $(XRFDEF) $(PATH_DEFINES) $(PUTENVDEF) $(IMAKEDEFINES) $(SIXELDEF) $(TRACEDEF)
INCLUDES = -I. $(XRFINCLUDES)
MAINSRC = main.c
MAINOBJ = main.o
#ifdef SixelXTerm
SIXELSRC = graphics.c
SIXELOBJ = graphics.o
#endif
#ifdef TraceXTerm
TRACESRC = trace.c
TRACEOBJ = trace.o
#endif
SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
data.c doublechr.c fontutils.c input.c \
linedata.c menu.c misc.c print.c ptydata.c scrollback.c \
screen.c scrollbar.c tabs.c util.c version.c xstrings.c \
xtermcap.c TekPrsTbl.c Tekproc.c VTPrsTbl.c \
$(MAINSRC) $(EXTRASRC) $(UTF8SRC) $(SIXELSRC) $(TRACESRC)
OBJS1 = button.o cachedGCs.o charproc.o charsets.o cursor.o \
data.o doublechr.o fontutils.o input.o \
linedata.o menu.o misc.o print.o ptydata.o scrollback.o \
screen.o scrollbar.o tabs.o util.o version.o xstrings.o \
xtermcap.o TekPrsTbl.o Tekproc.o VTPrsTbl.o \
$(MAINOBJ) $(EXTRAOBJ) $(UTF8OBJ) $(SIXELOBJ) $(TRACEOBJ)
SRCS2 = resize.c version.c xstrings.c
OBJS2 = resize.o version.o xstrings.o
SRCS = $(SRCS1) $(SRCS2)
OBJS = $(OBJS1) $(OBJS2)
PROGRAMS = ProgramTargetName(resize) ProgramTargetName(xterm)
DEPLIBS1 = XkbClientDepLibs XawClientDepLibs $(XRFDEPLIBS)
DEPLIBS2 =
#ifndef TermcapLibrary
#if SystemV && !defined(MacIIArchitecture)
#if defined(CrayArchitecture) || \
(defined(HPArchitecture) && (OSMajorVersion < 10)) || \
defined(RsArchitecture) || \
defined(SCOArchitecture) || \
defined(USLArchitecture)
#define TermcapLibrary -lcurses /* special cases of System V */
#else
#define TermcapLibrary -ltermlib /* usually in here */
#endif
#else
#define TermcapLibrary -ltermcap /* bsd puts it here */
#endif
#endif
TERMCAPLIB = TermcapLibrary
AllTarget($(PROGRAMS))
SpecialCObjectRule(main,$(_NOOP_),$(MAIN_DEFINES))
SpecialCObjectRule(menu,$(_NOOP_),$(MISC_DEFINES))
SpecialCObjectRule(misc,$(_NOOP_),$(MISC_DEFINES))
SpecialCObjectRule(charproc,$(_NOOP_),$(MISC_DEFINES))
SpecialCObjectRule(data,$(_NOOP_),$(MISC_DEFINES))
#if InstallXtermSetUID
SetUIDProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(PTYLIB))
#else
NormalProgramTarget(xterm,$(OBJS1),$(DEPLIBS1),$(XRFLIBS) XkbClientLibs XawClientLibs,$(TERMCAPLIB) $(UTMPLIB) $(PTYLIB))
#endif
#if defined(OpenBSDArchitecture) || defined(MirBSDArchitecture)
/* On OpenBSD xterm is now setgid utmp */
INSTUIDFLAGS= -m 2555 -g utmp
#endif
#if InstallXtermSetUID && defined(SunArchitecture) && HasSharedLibraries && (OSMajorVersion < 5)
#if AlternateUsrLibDir
#if ((OSMajorVersion == 4) && (OSMinorVersion >= 1))
LDOVERRIDE = -L$(DESTDIR)$(USRLIBDIR)
#else
#if HasGcc
LDOVERRIDE = -static -L$(DESTDIR)$(USRLIBDIR)
#else
LDOVERRIDE = -Bstatic -L$(DESTDIR)$(USRLIBDIR)
LDRESUME = -Bdynamic
#endif
#endif
#endif
install::
MakeDir($(DESTDIR)$(BINDIR))
RemoveFile(ProgramTargetName(xterm.inst))
LinkRule(ProgramTargetName(xterm.inst),$(CDEBUGFLAGS) $(CCOPTIONS)
$(EXTRA_LDOPTIONS) $(LOCAL_LDFLAGS),$(OBJS1),$(LDOVERRIDE)
$(XRFLIBS) XawClientLibs $(LDRESUME) $(LDLIBS) $(TERMCAPLIB)
$(PTYLIB))
$(INSTALL) -c $(INSTPGMFLAGS) $(INSTSETIDFLAGS) ProgramTargetName(xterm.inst) $(DESTDIR)$(BINDIR)/ProgramTargetName(xterm)
RemoveFile(ProgramTargetName(xterm.inst))
#else
InstallProgramWithFlags(xterm,$(BINDIR),$(INSTSETIDFLAGS))
#endif
InstallNamedProg(uxterm,uxterm,$(BINDIR))
/*
* Link with the termcap library if USE_TERMCAP is defined in resize.c
*/
#if defined(NTOArchitecture) || \
defined(LinuxArchitecture) || \
defined(OpenBSDArchitecture) || \
defined(SGIArchitecture) || \
defined(SunArchitecture)
NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,NullParameter)
#else
NormalProgramTarget(resize,$(OBJS2),$(DEPLIBS2),NullParameter,$(TERMCAPLIB))
#endif
InstallProgramWithFlags(resize,$(BINDIR),NullParameter)
/*
* termcap is a special name that does not install correctly with
* InstallNamedNonExec()
*/
install::
MakeDir($(DESTDIR)$(LIBDIR)/etc)
$(INSTALL) $(INSTALLFLAGS) $(INSTDATFLAGS) termcap \
$(DESTDIR)$(LIBDIR)/etc/xterm.termcap
InstallNamedNonExec(terminfo,xterm.terminfo,$(LIBDIR)/etc)
InstallAppDefaults(XTerm)
InstallAppDefaults(UXTerm)
InstallAppDefaultsLong(XTerm-col,XTerm-color)
InstallManPage(xterm,$(MANDIR))
InstallManPage(resize,$(MANDIR))
DependTarget()
xterm-297/UXTerm.ad 0000644 0001751 0000144 00000007031 11343605023 012743 0 ustar tom users ! $XTermId: UXTerm.ad,v 1.13 2010/03/04 01:17:07 tom Exp $
! -----------------------------------------------------------------------------
! this file is part of xterm
!
! Copyright 2000-2006,2010 by Thomas E. Dickey
!
! All Rights Reserved
!
! Permission is hereby granted, free of charge, to any person obtaining a
! copy of this software and associated documentation files (the
! "Software"), to deal in the Software without restriction, including
! without limitation the rights to use, copy, modify, merge, publish,
! distribute, sublicense, and/or sell copies of the Software, and to
! permit persons to whom the Software is furnished to do so, subject to
! the following conditions:
!
! The above copyright notice and this permission notice shall be included
! in all copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
! IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
!
! Except as contained in this notice, the name(s) of the above copyright
! holders shall not be used in advertising or otherwise to promote the
! sale, use or other dealings in this Software without prior written
! authorization.
! -----------------------------------------------------------------------------
! Use
! xterm -class UXTerm
! to set resources for UTF-8 mode with corresponding fonts.
! See the uxterm script for an example.
#include "XTerm"
*fontMenu.Label: Unicode Fonts
*VT100.utf8: 1
! This includes "XTerm-color" which includes "XTerm", which defines fonts.
! Why set them here?
!
! Here is a simple description. A technically precise one would be very long.
! When xterm starts up, it uses the
!
! *VT100.font
!
! resource, and if it is told to switch to wide-character (UTF-8) mode, it
! checks if the given font is "wide", and if not looks for the
!
! *VT100.utf8Fonts.font
!
! to obtain a wide font. A "wide" font has more than 256 glyphs. Typical
! wide fonts have 10,000 glyphs. If the original "*VT100.font" is not wide,
! and xterm can load the *VT100.utf8Fonts.font, it will use that.
!
! Making the wide fonts associated with *VT100.font in this file allows uxterm
! to skip that step. It will use the fonts that the XTerm file gives for the
! *VT100.uft8Fonts.font pattern.
*VT100.font2: -misc-fixed-medium-r-normal--8-80-75-75-c-50-iso10646-1
*VT100.font: -misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
*VT100.font3: -misc-fixed-medium-r-normal--14-130-75-75-c-70-iso10646-1
*VT100.font4: -misc-fixed-medium-r-normal--13-120-75-75-c-80-iso10646-1
*VT100.font5: -misc-fixed-medium-r-normal--18-120-100-100-c-90-iso10646-1
*VT100.font6: -misc-fixed-medium-r-normal--20-200-75-75-c-100-iso10646-1
! Here is an alternate set of fonts with better support for bold:
!*VT100.font2: -efont-biwidth-medium-r-normal--10-100-75-75-p-50-iso10646-1
!*VT100.font: -efont-biwidth-medium-r-normal--10-100-75-75-p-50-iso10646-1
!*VT100.font3: -efont-biwidth-medium-r-normal--12-120-75-75-p-60-iso10646-1
!*VT100.font4: -efont-biwidth-medium-r-normal--14-140-75-75-p-70-iso10646-1
!*VT100.font5: -efont-biwidth-medium-r-normal--16-160-75-75-p-80-iso10646-1
!*VT100.font6: -efont-biwidth-medium-r-normal--24-240-75-75-p-120-iso10646-1
xterm-297/trace.h 0000644 0001751 0000144 00000014736 12212740125 012531 0 ustar tom users /* $XTermId: trace.h,v 1.70 2013/09/08 00:09:57 tom Exp $ */
/*
* Copyright 1997-2011,2012 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
/*
* Common/useful definitions for XTERM application
*/
#ifndef included_trace_h
#define included_trace_h
/* *INDENT-OFF* */
#include
#if OPT_TRACE
extern void Trace ( const char *, ... ) GCC_PRINTFLIKE(1,2);
#undef TRACE
#define TRACE(p) Trace p
extern void TraceClose (void);
#undef TRACE_CLOSE
#define TRACE_CLOSE TraceClose
#if OPT_TRACE > 1
#define TRACE2(p) Trace p
#endif
extern char * visibleChars (const Char * /* buf */, unsigned /* len */);
extern char * visibleIChars (IChar * /* buf */, unsigned /* len */);
extern char * visibleUChar (unsigned);
extern const char * visibleDblChrset(unsigned /* chrset */);
extern const char * visibleEventType (int);
extern const char * visibleNotifyDetail(int /* code */);
extern const char * visibleNotifyMode (int /* code */);
extern const char * visibleScsCode(unsigned /* chrset */);
extern const char * visibleSelectionTarget(Display * /* d */, Atom /* a */);
extern const char * visibleXError (int /* code */);
extern void TraceArgv(const char * /* tag */, char ** /* argv */);
#undef TRACE_ARGV
#define TRACE_ARGV(tag,argv) TraceArgv(tag,argv)
extern const char *trace_who;
#undef TRACE_CHILD
#define TRACE_CHILD int tracing_child = (trace_who = "child") != 0; (void) tracing_child;
extern void TraceFocus(Widget, XEvent *);
#undef TRACE_FOCUS
#define TRACE_FOCUS(w,e) TraceFocus((Widget)w, (XEvent *)e)
extern void TraceSizeHints(XSizeHints *);
#undef TRACE_HINTS
#define TRACE_HINTS(hints) TraceSizeHints(hints)
extern void TraceIds(const char * /* fname */, int /* lnum */);
#undef TRACE_IDS
#define TRACE_IDS TraceIds(__FILE__, __LINE__)
extern void TraceTime(const char * /* fname */, int /* lnum */);
#undef TRACE_TIME
#define TRACE_TIME TraceTime(__FILE__, __LINE__)
extern void TraceOptions(OptionHelp * /* options */, XrmOptionDescRec * /* resources */, Cardinal /* count */);
#undef TRACE_OPTS
#define TRACE_OPTS(opts,ress,lens) TraceOptions(opts,ress,lens)
extern void TraceTranslations(const char *, Widget);
#undef TRACE_TRANS
#define TRACE_TRANS(name,w) TraceTranslations(name,w)
extern void TraceWindowAttributes(XWindowAttributes *);
#undef TRACE_WIN_ATTRS
#define TRACE_WIN_ATTRS(a) TraceWindowAttributes(a)
extern void TraceWMSizeHints(XtermWidget);
#undef TRACE_WM_HINTS
#define TRACE_WM_HINTS(w) TraceWMSizeHints(w)
extern void TraceXtermResources(void);
#undef TRACE_XRES
#define TRACE_XRES() TraceXtermResources()
extern XtGeometryResult TraceResizeRequest(const char * /* fn */, int /* ln */, Widget /* w */, unsigned /* reqwide */, unsigned /* reqhigh */, Dimension * /* gotwide */, Dimension * /* gothigh */);
#undef REQ_RESIZE
#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \
TraceResizeRequest(__FILE__, __LINE__, w, \
(reqwide), (reqhigh), \
(gotwide), (gothigh))
extern const char * ModifierName(unsigned /* modifier */);
#define FMT_MODIFIER_NAMES "%s%s%s%s%s%s%s%s"
#define ARG_MODIFIER_NAMES(state) \
ModifierName(state & ShiftMask), \
ModifierName(state & LockMask), \
ModifierName(state & ControlMask), \
ModifierName(state & Mod1Mask), \
ModifierName(state & Mod2Mask), \
ModifierName(state & Mod3Mask), \
ModifierName(state & Mod4Mask), \
ModifierName(state & Mod5Mask)
#else
#define REQ_RESIZE(w, reqwide, reqhigh, gotwide, gothigh) \
XtMakeResizeRequest((Widget) (w), \
(Dimension) (reqwide), (Dimension) (reqhigh), \
(gotwide), (gothigh))
#endif
extern void TraceScreen(XtermWidget /* xw */, int /* whichBuf */);
/*
* The whole wnew->screen struct is zeroed in VTInitialize. Use these macros
* where applicable for copying the pieces from the request widget into the
* new widget. We do not have to use them for wnew->misc, but the associated
* traces are very useful for debugging.
*/
#if OPT_TRACE
#define init_Bres(name) \
TRACE(("init " #name " = %s\n", \
BtoS(wnew->name = request->name)))
#define init_Dres(name) \
TRACE(("init " #name " = %f\n", \
wnew->name = request->name))
#define init_Dres2(name,i) \
TRACE(("init " #name "[%d] = %f\n", i, \
wnew->name[i] = request->name[i]))
#define init_Ires(name) \
TRACE(("init " #name " = %d\n", \
wnew->name = request->name))
#define init_Sres(name) \
TRACE(("init " #name " = \"%s\"\n", \
(wnew->name = x_strtrim(request->name)) != NULL \
? wnew->name : ""))
#define init_Sres2(name,i) \
TRACE(("init " #name "[%d] = \"%s\"\n", i, \
(wnew->name(i) = x_strtrim(request->name(i))) != NULL \
? wnew->name(i) : ""))
#define init_Tres(offset) \
TRACE(("init screen.Tcolors[" #offset "] = %#lx\n", \
fill_Tres(wnew, request, offset)))
#else
#define init_Bres(name) wnew->name = request->name
#define init_Dres(name) wnew->name = request->name
#define init_Dres2(name,i) wnew->name[i] = request->name[i]
#define init_Ires(name) wnew->name = request->name
#define init_Sres(name) wnew->name = x_strtrim(request->name)
#define init_Sres2(name,i) wnew->name(i) = x_strtrim(request->name(i))
#define init_Tres(offset) fill_Tres(wnew, request, offset)
#endif
/* *INDENT-ON* */
#endif /* included_trace_h */
xterm-297/xterm_io.h 0000644 0001751 0000144 00000014326 12072313115 013253 0 ustar tom users /* $XTermId: xterm_io.h,v 1.56 2013/01/06 15:20:45 tom Exp $ */
/*
* Copyright 2000-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
#ifndef included_xterm_io_h
#define included_xterm_io_h
#include
/*
* System-specific definitions (keep these chunks one-per-system!).
*
* FIXME: some, such as those defining USE_TERMIOS should be moved to xterm.h
* as they are integrated with the configure script.
*/
#ifdef CSRG_BASED
#define USE_TERMIOS
#endif
#ifdef __CYGWIN__
#define ATT
#define SVR4
#define SYSV
#define USE_SYSV_TERMIO
#endif
#if defined(__DragonFly__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__INTERIX) || defined(__APPLE__) || defined(__UNIXWARE__) || defined(__hpux)
#ifndef USE_POSIX_TERMIOS
#define USE_POSIX_TERMIOS
#endif
#endif
#if defined(AIXV4)
#define USE_POSIX_TERMIOS
#ifndef SYSV
#define SYSV
#endif
#endif
#ifdef linux
#define USE_TERMIOS
#endif
#ifdef __SCO__
#define USE_TERMIOS
#ifndef _SVID3
#define _SVID3
#endif
#endif
#ifdef Lynx
#define USE_SYSV_TERMIO
#endif
#ifdef macII
#undef SYSV /* pretend to be bsd (sgtty.h) */
#endif /* macII */
#if defined(__GLIBC__) && !defined(linux)
#define USE_POSIX_TERMIOS /* GNU/Hurd, GNU/KFreeBSD and GNU/KNetBSD */
#endif
#ifdef __MVS__
#define SVR4
#define USE_POSIX_TERMIOS
#endif
#ifdef __QNX__
#define USE_POSIX_TERMIOS
#endif
#if defined(__osf__)
#define USE_POSIX_TERMIOS
#undef SYSV
#endif
/*
* Indirect system dependencies
*/
#if defined(SVR4) && !defined(__sgi)
#define USE_TERMIOS
#endif
#ifdef SYSV
#define USE_SYSV_TERMIO
#endif
#if defined(USE_POSIX_TERMIOS) && !defined(USE_TERMIOS)
#define USE_TERMIOS
#endif
/*
* Low-level ioctl, where it is needed or non-conflicting with termio/etc.
*/
#ifdef __QNX__
#include
#else
#include
#endif
/*
* Terminal I/O includes (termio, termios, sgtty headers).
*/
#if defined(USE_POSIX_TERMIOS) && !defined(__hpux)
#include
#elif defined(USE_TERMIOS)
#include
/* this hacked termios support only works on SYSV */
#define USE_ANY_SYSV_TERMIO
#define termio termios
#ifndef __CYGWIN__
#undef TCGETA
#define TCGETA TCGETS
#undef TCSETA
#define TCSETA TCSETS
#undef TCSETAW
#define TCSETAW TCSETSW
#endif
#elif defined(USE_SYSV_TERMIO)
# define USE_ANY_SYSV_TERMIO
# ifdef Lynx
# include
# else
# include
# endif
#elif defined(SYSV) || defined(ISC)
# include
#elif !defined(VMS)
# include
#endif /* USE_POSIX_TERMIOS */
/*
* Stream includes, which declare struct winsize or ttysize.
*/
#ifdef SYSV
#ifdef USE_USG_PTYS
#include /* get typedef used in ptem.h */
#ifdef HAVE_SYS_PTEM_H
#include /* get struct winsize */
#endif
#endif /* USE_USG_PTYS */
#endif /* SYSV */
/*
* Special cases (structures and definitions that have to be adjusted).
*/
#if defined(__CYGWIN__) && !defined(TIOCSPGRP)
#include
#define TIOCSPGRP (_IOW('t', 118, pid_t))
#endif
#ifdef __hpux
#include /* defines TIOCSLTC */
#endif
#ifdef ISC
#define TIOCGPGRP TCGETPGRP
#define TIOCSPGRP TCSETPGRP
#endif
#ifdef Lynx
#include
#elif !(defined(SYSV) || defined(linux) || defined(VMS) || (defined(__QNX__)&&!defined(__QNXNTO__)))
#include
#endif
#ifdef macII
#undef FIOCLEX
#undef FIONCLEX
#endif /* macII */
#ifdef __QNX__
#undef TIOCSLTC /* conflicts with */
#undef TIOCLSET
#endif
#if defined(__sgi) && (OSMAJORVERSION >= 5)
#undef TIOCLSET /* defined, but not useable */
#endif
#if defined(__GNU__) || defined(__MVS__) || defined(__osf__)
#undef TIOCLSET
#undef TIOCSLTC
#endif
#if defined (__sgi) || (defined(__linux__) && defined(__sparc__)) || defined(__UNIXWARE__)
#undef TIOCLSET /* XXX why is this undef-ed again? */
#endif
#if defined(sun) || defined(__UNIXWARE__)
#include
#endif
#if defined(TIOCSLTC) && ! (defined(linux) || defined(__MVS__) || defined(Lynx) || defined(SVR4))
#define HAS_LTCHARS
#endif
#if !defined(TTYSIZE_STRUCT)
#if defined(TIOCSWINSZ)
#define USE_STRUCT_WINSIZE 1
#define TTYSIZE_STRUCT struct winsize
#define GET_TTYSIZE(fd, data) ioctl(fd, TIOCGWINSZ, (char *) &data)
#define SET_TTYSIZE(fd, data) ioctl(fd, TIOCSWINSZ, (char *) &data)
#define TTYSIZE_COLS(data) data.ws_col
#define TTYSIZE_ROWS(data) data.ws_row
#endif /* TIOCSWINSZ */
#endif /* TTYSIZE_STRUCT */
#ifndef USE_STRUCT_WINSIZE
#error "There is a configuration error with struct winsize ifdef"
#endif
#if OPT_TRACE
#define TRACE_TTYSIZE(fd, id) { \
TTYSIZE_STRUCT debug_ttysize; \
if (GET_TTYSIZE(fd, debug_ttysize) == 0) \
TRACE(("%s@%d, TTYSIZE %s %d %d\n", __FILE__, __LINE__, id, TTYSIZE_ROWS(debug_ttysize), TTYSIZE_COLS(debug_ttysize))); \
else \
TRACE(("%s@%d, TTYSIZE failed %s\n", __FILE__, __LINE__, strerror(errno))); \
}
#else
#define TRACE_TTYSIZE(fd, id) /* nothing */
#endif
typedef unsigned short ttySize_t;
#endif /* included_xterm_io_h */
xterm-297/keysym2ucs.c 0000644 0001751 0000144 00000205304 10633633570 013547 0 ustar tom users /* $XTermId: keysym2ucs.c,v 1.15 2007/06/13 00:16:56 tom Exp $
* This module converts keysym values into the corresponding ISO 10646
* (UCS, Unicode) values.
*
* The array keysymtab[] contains pairs of X11 keysym values for graphical
* characters and the corresponding Unicode value. The function
* keysym2ucs() maps a keysym onto a Unicode value using a binary search,
* therefore keysymtab[] must remain SORTED by keysym value.
*
* The keysym -> UTF-8 conversion will hopefully one day be provided
* by Xlib via XmbLookupString() and should ideally not have to be
* done in X applications. But we are not there yet.
*
* We allow to represent any UCS character in the range U-00000000 to
* U-00FFFFFF by a keysym value in the range 0x01000000 to 0x01ffffff.
* This admittedly does not cover the entire 31-bit space of UCS, but
* it does cover all of the characters up to U-10FFFF, which can be
* represented by UTF-16, and more, and it is very unlikely that higher
* UCS codes will ever be assigned by ISO. So to get Unicode character
* U+ABCD you can directly use keysym 0x0100abcd.
*
* NOTE: The comments in the table below contain the actual character
* encoded in UTF-8, so for viewing and editing best use an editor in
* UTF-8 mode.
*
* Author: Markus G. Kuhn , University of Cambridge, April 2001
*
* Special thanks to Richard Verhoeven for preparing
* an initial draft of the mapping table.
*
* This software is in the public domain. Share and enjoy!
*
* AUTOMATICALLY GENERATED FILE, DO NOT EDIT !!! (unicode/convmap.pl)
*/
#ifndef KEYSYM2UCS_INCLUDED
#include "keysym2ucs.h"
#define VISIBLE /* */
#else
#define VISIBLE static
#endif
static struct codepair {
unsigned short keysym;
unsigned short ucs;
} keysymtab[] = {
{ 0x01a1, 0x0104 }, /* Aogonek Ä„ LATIN CAPITAL LETTER A WITH OGONEK */
{ 0x01a2, 0x02d8 }, /* breve ˘ BREVE */
{ 0x01a3, 0x0141 }, /* Lstroke Å LATIN CAPITAL LETTER L WITH STROKE */
{ 0x01a5, 0x013d }, /* Lcaron Ľ LATIN CAPITAL LETTER L WITH CARON */
{ 0x01a6, 0x015a }, /* Sacute Åš LATIN CAPITAL LETTER S WITH ACUTE */
{ 0x01a9, 0x0160 }, /* Scaron Å LATIN CAPITAL LETTER S WITH CARON */
{ 0x01aa, 0x015e }, /* Scedilla Åž LATIN CAPITAL LETTER S WITH CEDILLA */
{ 0x01ab, 0x0164 }, /* Tcaron Ť LATIN CAPITAL LETTER T WITH CARON */
{ 0x01ac, 0x0179 }, /* Zacute Ź LATIN CAPITAL LETTER Z WITH ACUTE */
{ 0x01ae, 0x017d }, /* Zcaron Ž LATIN CAPITAL LETTER Z WITH CARON */
{ 0x01af, 0x017b }, /* Zabovedot Å» LATIN CAPITAL LETTER Z WITH DOT ABOVE */
{ 0x01b1, 0x0105 }, /* aogonek Ä… LATIN SMALL LETTER A WITH OGONEK */
{ 0x01b2, 0x02db }, /* ogonek Ë› OGONEK */
{ 0x01b3, 0x0142 }, /* lstroke Å‚ LATIN SMALL LETTER L WITH STROKE */
{ 0x01b5, 0x013e }, /* lcaron ľ LATIN SMALL LETTER L WITH CARON */
{ 0x01b6, 0x015b }, /* sacute Å› LATIN SMALL LETTER S WITH ACUTE */
{ 0x01b7, 0x02c7 }, /* caron ˇ CARON */
{ 0x01b9, 0x0161 }, /* scaron Å¡ LATIN SMALL LETTER S WITH CARON */
{ 0x01ba, 0x015f }, /* scedilla ÅŸ LATIN SMALL LETTER S WITH CEDILLA */
{ 0x01bb, 0x0165 }, /* tcaron ť LATIN SMALL LETTER T WITH CARON */
{ 0x01bc, 0x017a }, /* zacute ź LATIN SMALL LETTER Z WITH ACUTE */
{ 0x01bd, 0x02dd }, /* doubleacute Ë DOUBLE ACUTE ACCENT */
{ 0x01be, 0x017e }, /* zcaron ž LATIN SMALL LETTER Z WITH CARON */
{ 0x01bf, 0x017c }, /* zabovedot ż LATIN SMALL LETTER Z WITH DOT ABOVE */
{ 0x01c0, 0x0154 }, /* Racute Å” LATIN CAPITAL LETTER R WITH ACUTE */
{ 0x01c3, 0x0102 }, /* Abreve Ä‚ LATIN CAPITAL LETTER A WITH BREVE */
{ 0x01c5, 0x0139 }, /* Lacute Ĺ LATIN CAPITAL LETTER L WITH ACUTE */
{ 0x01c6, 0x0106 }, /* Cacute Ć LATIN CAPITAL LETTER C WITH ACUTE */
{ 0x01c8, 0x010c }, /* Ccaron Č LATIN CAPITAL LETTER C WITH CARON */
{ 0x01ca, 0x0118 }, /* Eogonek Ę LATIN CAPITAL LETTER E WITH OGONEK */
{ 0x01cc, 0x011a }, /* Ecaron Äš LATIN CAPITAL LETTER E WITH CARON */
{ 0x01cf, 0x010e }, /* Dcaron ÄŽ LATIN CAPITAL LETTER D WITH CARON */
{ 0x01d0, 0x0110 }, /* Dstroke Ä LATIN CAPITAL LETTER D WITH STROKE */
{ 0x01d1, 0x0143 }, /* Nacute Ń LATIN CAPITAL LETTER N WITH ACUTE */
{ 0x01d2, 0x0147 }, /* Ncaron Ň LATIN CAPITAL LETTER N WITH CARON */
{ 0x01d5, 0x0150 }, /* Odoubleacute Å LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */
{ 0x01d8, 0x0158 }, /* Rcaron Ř LATIN CAPITAL LETTER R WITH CARON */
{ 0x01d9, 0x016e }, /* Uring Å® LATIN CAPITAL LETTER U WITH RING ABOVE */
{ 0x01db, 0x0170 }, /* Udoubleacute Ű LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */
{ 0x01de, 0x0162 }, /* Tcedilla Ţ LATIN CAPITAL LETTER T WITH CEDILLA */
{ 0x01e0, 0x0155 }, /* racute Å• LATIN SMALL LETTER R WITH ACUTE */
{ 0x01e3, 0x0103 }, /* abreve ă LATIN SMALL LETTER A WITH BREVE */
{ 0x01e5, 0x013a }, /* lacute ĺ LATIN SMALL LETTER L WITH ACUTE */
{ 0x01e6, 0x0107 }, /* cacute ć LATIN SMALL LETTER C WITH ACUTE */
{ 0x01e8, 0x010d }, /* ccaron Ä LATIN SMALL LETTER C WITH CARON */
{ 0x01ea, 0x0119 }, /* eogonek Ä™ LATIN SMALL LETTER E WITH OGONEK */
{ 0x01ec, 0x011b }, /* ecaron Ä› LATIN SMALL LETTER E WITH CARON */
{ 0x01ef, 0x010f }, /* dcaron Ä LATIN SMALL LETTER D WITH CARON */
{ 0x01f0, 0x0111 }, /* dstroke Ä‘ LATIN SMALL LETTER D WITH STROKE */
{ 0x01f1, 0x0144 }, /* nacute Å„ LATIN SMALL LETTER N WITH ACUTE */
{ 0x01f2, 0x0148 }, /* ncaron ň LATIN SMALL LETTER N WITH CARON */
{ 0x01f5, 0x0151 }, /* odoubleacute Å‘ LATIN SMALL LETTER O WITH DOUBLE ACUTE */
{ 0x01f8, 0x0159 }, /* rcaron Å™ LATIN SMALL LETTER R WITH CARON */
{ 0x01f9, 0x016f }, /* uring ů LATIN SMALL LETTER U WITH RING ABOVE */
{ 0x01fb, 0x0171 }, /* udoubleacute ű LATIN SMALL LETTER U WITH DOUBLE ACUTE */
{ 0x01fe, 0x0163 }, /* tcedilla ţ LATIN SMALL LETTER T WITH CEDILLA */
{ 0x01ff, 0x02d9 }, /* abovedot Ë™ DOT ABOVE */
{ 0x02a1, 0x0126 }, /* Hstroke Ħ LATIN CAPITAL LETTER H WITH STROKE */
{ 0x02a6, 0x0124 }, /* Hcircumflex Ĥ LATIN CAPITAL LETTER H WITH CIRCUMFLEX */
{ 0x02a9, 0x0130 }, /* Iabovedot İ LATIN CAPITAL LETTER I WITH DOT ABOVE */
{ 0x02ab, 0x011e }, /* Gbreve Äž LATIN CAPITAL LETTER G WITH BREVE */
{ 0x02ac, 0x0134 }, /* Jcircumflex Ä´ LATIN CAPITAL LETTER J WITH CIRCUMFLEX */
{ 0x02b1, 0x0127 }, /* hstroke ħ LATIN SMALL LETTER H WITH STROKE */
{ 0x02b6, 0x0125 }, /* hcircumflex ĥ LATIN SMALL LETTER H WITH CIRCUMFLEX */
{ 0x02b9, 0x0131 }, /* idotless ı LATIN SMALL LETTER DOTLESS I */
{ 0x02bb, 0x011f }, /* gbreve ÄŸ LATIN SMALL LETTER G WITH BREVE */
{ 0x02bc, 0x0135 }, /* jcircumflex ĵ LATIN SMALL LETTER J WITH CIRCUMFLEX */
{ 0x02c5, 0x010a }, /* Cabovedot ÄŠ LATIN CAPITAL LETTER C WITH DOT ABOVE */
{ 0x02c6, 0x0108 }, /* Ccircumflex Ĉ LATIN CAPITAL LETTER C WITH CIRCUMFLEX */
{ 0x02d5, 0x0120 }, /* Gabovedot Ä LATIN CAPITAL LETTER G WITH DOT ABOVE */
{ 0x02d8, 0x011c }, /* Gcircumflex Ĝ LATIN CAPITAL LETTER G WITH CIRCUMFLEX */
{ 0x02dd, 0x016c }, /* Ubreve Ŭ LATIN CAPITAL LETTER U WITH BREVE */
{ 0x02de, 0x015c }, /* Scircumflex Ŝ LATIN CAPITAL LETTER S WITH CIRCUMFLEX */
{ 0x02e5, 0x010b }, /* cabovedot Ä‹ LATIN SMALL LETTER C WITH DOT ABOVE */
{ 0x02e6, 0x0109 }, /* ccircumflex ĉ LATIN SMALL LETTER C WITH CIRCUMFLEX */
{ 0x02f5, 0x0121 }, /* gabovedot Ä¡ LATIN SMALL LETTER G WITH DOT ABOVE */
{ 0x02f8, 0x011d }, /* gcircumflex Ä LATIN SMALL LETTER G WITH CIRCUMFLEX */
{ 0x02fd, 0x016d }, /* ubreve Å LATIN SMALL LETTER U WITH BREVE */
{ 0x02fe, 0x015d }, /* scircumflex Å LATIN SMALL LETTER S WITH CIRCUMFLEX */
{ 0x03a2, 0x0138 }, /* kra ĸ LATIN SMALL LETTER KRA */
{ 0x03a3, 0x0156 }, /* Rcedilla Å– LATIN CAPITAL LETTER R WITH CEDILLA */
{ 0x03a5, 0x0128 }, /* Itilde Ĩ LATIN CAPITAL LETTER I WITH TILDE */
{ 0x03a6, 0x013b }, /* Lcedilla Ä» LATIN CAPITAL LETTER L WITH CEDILLA */
{ 0x03aa, 0x0112 }, /* Emacron Ä’ LATIN CAPITAL LETTER E WITH MACRON */
{ 0x03ab, 0x0122 }, /* Gcedilla Ģ LATIN CAPITAL LETTER G WITH CEDILLA */
{ 0x03ac, 0x0166 }, /* Tslash Ŧ LATIN CAPITAL LETTER T WITH STROKE */
{ 0x03b3, 0x0157 }, /* rcedilla Å— LATIN SMALL LETTER R WITH CEDILLA */
{ 0x03b5, 0x0129 }, /* itilde Ä© LATIN SMALL LETTER I WITH TILDE */
{ 0x03b6, 0x013c }, /* lcedilla ļ LATIN SMALL LETTER L WITH CEDILLA */
{ 0x03ba, 0x0113 }, /* emacron Ä“ LATIN SMALL LETTER E WITH MACRON */
{ 0x03bb, 0x0123 }, /* gcedilla ģ LATIN SMALL LETTER G WITH CEDILLA */
{ 0x03bc, 0x0167 }, /* tslash ŧ LATIN SMALL LETTER T WITH STROKE */
{ 0x03bd, 0x014a }, /* ENG ÅŠ LATIN CAPITAL LETTER ENG */
{ 0x03bf, 0x014b }, /* eng Å‹ LATIN SMALL LETTER ENG */
{ 0x03c0, 0x0100 }, /* Amacron Ā LATIN CAPITAL LETTER A WITH MACRON */
{ 0x03c7, 0x012e }, /* Iogonek Ä® LATIN CAPITAL LETTER I WITH OGONEK */
{ 0x03cc, 0x0116 }, /* Eabovedot Ä– LATIN CAPITAL LETTER E WITH DOT ABOVE */
{ 0x03cf, 0x012a }, /* Imacron Ī LATIN CAPITAL LETTER I WITH MACRON */
{ 0x03d1, 0x0145 }, /* Ncedilla Å… LATIN CAPITAL LETTER N WITH CEDILLA */
{ 0x03d2, 0x014c }, /* Omacron Ō LATIN CAPITAL LETTER O WITH MACRON */
{ 0x03d3, 0x0136 }, /* Kcedilla Ķ LATIN CAPITAL LETTER K WITH CEDILLA */
{ 0x03d9, 0x0172 }, /* Uogonek Ų LATIN CAPITAL LETTER U WITH OGONEK */
{ 0x03dd, 0x0168 }, /* Utilde Ũ LATIN CAPITAL LETTER U WITH TILDE */
{ 0x03de, 0x016a }, /* Umacron Ū LATIN CAPITAL LETTER U WITH MACRON */
{ 0x03e0, 0x0101 }, /* amacron Ä LATIN SMALL LETTER A WITH MACRON */
{ 0x03e7, 0x012f }, /* iogonek į LATIN SMALL LETTER I WITH OGONEK */
{ 0x03ec, 0x0117 }, /* eabovedot Ä— LATIN SMALL LETTER E WITH DOT ABOVE */
{ 0x03ef, 0x012b }, /* imacron Ä« LATIN SMALL LETTER I WITH MACRON */
{ 0x03f1, 0x0146 }, /* ncedilla ņ LATIN SMALL LETTER N WITH CEDILLA */
{ 0x03f2, 0x014d }, /* omacron Å LATIN SMALL LETTER O WITH MACRON */
{ 0x03f3, 0x0137 }, /* kcedilla Ä· LATIN SMALL LETTER K WITH CEDILLA */
{ 0x03f9, 0x0173 }, /* uogonek ų LATIN SMALL LETTER U WITH OGONEK */
{ 0x03fd, 0x0169 }, /* utilde Å© LATIN SMALL LETTER U WITH TILDE */
{ 0x03fe, 0x016b }, /* umacron Å« LATIN SMALL LETTER U WITH MACRON */
{ 0x047e, 0x203e }, /* overline ‾ OVERLINE */
{ 0x04a1, 0x3002 }, /* kana_fullstop 。 IDEOGRAPHIC FULL STOP */
{ 0x04a2, 0x300c }, /* kana_openingbracket 「 LEFT CORNER BRACKET */
{ 0x04a3, 0x300d }, /* kana_closingbracket 〠RIGHT CORNER BRACKET */
{ 0x04a4, 0x3001 }, /* kana_comma 〠IDEOGRAPHIC COMMA */
{ 0x04a5, 0x30fb }, /* kana_conjunctive ・ KATAKANA MIDDLE DOT */
{ 0x04a6, 0x30f2 }, /* kana_WO ヲ KATAKANA LETTER WO */
{ 0x04a7, 0x30a1 }, /* kana_a ã‚¡ KATAKANA LETTER SMALL A */
{ 0x04a8, 0x30a3 }, /* kana_i ã‚£ KATAKANA LETTER SMALL I */
{ 0x04a9, 0x30a5 }, /* kana_u ã‚¥ KATAKANA LETTER SMALL U */
{ 0x04aa, 0x30a7 }, /* kana_e ã‚§ KATAKANA LETTER SMALL E */
{ 0x04ab, 0x30a9 }, /* kana_o ã‚© KATAKANA LETTER SMALL O */
{ 0x04ac, 0x30e3 }, /* kana_ya ャ KATAKANA LETTER SMALL YA */
{ 0x04ad, 0x30e5 }, /* kana_yu ュ KATAKANA LETTER SMALL YU */
{ 0x04ae, 0x30e7 }, /* kana_yo ョ KATAKANA LETTER SMALL YO */
{ 0x04af, 0x30c3 }, /* kana_tsu ッ KATAKANA LETTER SMALL TU */
{ 0x04b0, 0x30fc }, /* prolongedsound ー KATAKANA-HIRAGANA PROLONGED SOUND MARK */
{ 0x04b1, 0x30a2 }, /* kana_A ã‚¢ KATAKANA LETTER A */
{ 0x04b2, 0x30a4 }, /* kana_I イ KATAKANA LETTER I */
{ 0x04b3, 0x30a6 }, /* kana_U ウ KATAKANA LETTER U */
{ 0x04b4, 0x30a8 }, /* kana_E エ KATAKANA LETTER E */
{ 0x04b5, 0x30aa }, /* kana_O オ KATAKANA LETTER O */
{ 0x04b6, 0x30ab }, /* kana_KA ã‚« KATAKANA LETTER KA */
{ 0x04b7, 0x30ad }, /* kana_KI ã‚ KATAKANA LETTER KI */
{ 0x04b8, 0x30af }, /* kana_KU ク KATAKANA LETTER KU */
{ 0x04b9, 0x30b1 }, /* kana_KE ケ KATAKANA LETTER KE */
{ 0x04ba, 0x30b3 }, /* kana_KO コ KATAKANA LETTER KO */
{ 0x04bb, 0x30b5 }, /* kana_SA サ KATAKANA LETTER SA */
{ 0x04bc, 0x30b7 }, /* kana_SHI ã‚· KATAKANA LETTER SI */
{ 0x04bd, 0x30b9 }, /* kana_SU ス KATAKANA LETTER SU */
{ 0x04be, 0x30bb }, /* kana_SE ã‚» KATAKANA LETTER SE */
{ 0x04bf, 0x30bd }, /* kana_SO ソ KATAKANA LETTER SO */
{ 0x04c0, 0x30bf }, /* kana_TA ã‚¿ KATAKANA LETTER TA */
{ 0x04c1, 0x30c1 }, /* kana_CHI ムKATAKANA LETTER TI */
{ 0x04c2, 0x30c4 }, /* kana_TSU ツ KATAKANA LETTER TU */
{ 0x04c3, 0x30c6 }, /* kana_TE テ KATAKANA LETTER TE */
{ 0x04c4, 0x30c8 }, /* kana_TO ト KATAKANA LETTER TO */
{ 0x04c5, 0x30ca }, /* kana_NA ナ KATAKANA LETTER NA */
{ 0x04c6, 0x30cb }, /* kana_NI ニ KATAKANA LETTER NI */
{ 0x04c7, 0x30cc }, /* kana_NU ヌ KATAKANA LETTER NU */
{ 0x04c8, 0x30cd }, /* kana_NE ムKATAKANA LETTER NE */
{ 0x04c9, 0x30ce }, /* kana_NO ノ KATAKANA LETTER NO */
{ 0x04ca, 0x30cf }, /* kana_HA ムKATAKANA LETTER HA */
{ 0x04cb, 0x30d2 }, /* kana_HI ヒ KATAKANA LETTER HI */
{ 0x04cc, 0x30d5 }, /* kana_FU フ KATAKANA LETTER HU */
{ 0x04cd, 0x30d8 }, /* kana_HE ヘ KATAKANA LETTER HE */
{ 0x04ce, 0x30db }, /* kana_HO ホ KATAKANA LETTER HO */
{ 0x04cf, 0x30de }, /* kana_MA マ KATAKANA LETTER MA */
{ 0x04d0, 0x30df }, /* kana_MI ミ KATAKANA LETTER MI */
{ 0x04d1, 0x30e0 }, /* kana_MU ムKATAKANA LETTER MU */
{ 0x04d2, 0x30e1 }, /* kana_ME メ KATAKANA LETTER ME */
{ 0x04d3, 0x30e2 }, /* kana_MO モ KATAKANA LETTER MO */
{ 0x04d4, 0x30e4 }, /* kana_YA ヤ KATAKANA LETTER YA */
{ 0x04d5, 0x30e6 }, /* kana_YU ユ KATAKANA LETTER YU */
{ 0x04d6, 0x30e8 }, /* kana_YO ヨ KATAKANA LETTER YO */
{ 0x04d7, 0x30e9 }, /* kana_RA ラ KATAKANA LETTER RA */
{ 0x04d8, 0x30ea }, /* kana_RI リ KATAKANA LETTER RI */
{ 0x04d9, 0x30eb }, /* kana_RU ル KATAKANA LETTER RU */
{ 0x04da, 0x30ec }, /* kana_RE レ KATAKANA LETTER RE */
{ 0x04db, 0x30ed }, /* kana_RO ムKATAKANA LETTER RO */
{ 0x04dc, 0x30ef }, /* kana_WA ワ KATAKANA LETTER WA */
{ 0x04dd, 0x30f3 }, /* kana_N ン KATAKANA LETTER N */
{ 0x04de, 0x309b }, /* voicedsound ã‚› KATAKANA-HIRAGANA VOICED SOUND MARK */
{ 0x04df, 0x309c }, /* semivoicedsound ゜ KATAKANA-HIRAGANA SEMI-VOICED SOUND MARK */
{ 0x05ac, 0x060c }, /* Arabic_comma ، ARABIC COMMA */
{ 0x05bb, 0x061b }, /* Arabic_semicolon Ø› ARABIC SEMICOLON */
{ 0x05bf, 0x061f }, /* Arabic_question_mark ØŸ ARABIC QUESTION MARK */
{ 0x05c1, 0x0621 }, /* Arabic_hamza Ø¡ ARABIC LETTER HAMZA */
{ 0x05c2, 0x0622 }, /* Arabic_maddaonalef آ ARABIC LETTER ALEF WITH MADDA ABOVE */
{ 0x05c3, 0x0623 }, /* Arabic_hamzaonalef أ ARABIC LETTER ALEF WITH HAMZA ABOVE */
{ 0x05c4, 0x0624 }, /* Arabic_hamzaonwaw ؤ ARABIC LETTER WAW WITH HAMZA ABOVE */
{ 0x05c5, 0x0625 }, /* Arabic_hamzaunderalef إ ARABIC LETTER ALEF WITH HAMZA BELOW */
{ 0x05c6, 0x0626 }, /* Arabic_hamzaonyeh ئ ARABIC LETTER YEH WITH HAMZA ABOVE */
{ 0x05c7, 0x0627 }, /* Arabic_alef ا ARABIC LETTER ALEF */
{ 0x05c8, 0x0628 }, /* Arabic_beh ب ARABIC LETTER BEH */
{ 0x05c9, 0x0629 }, /* Arabic_tehmarbuta Ø© ARABIC LETTER TEH MARBUTA */
{ 0x05ca, 0x062a }, /* Arabic_teh ت ARABIC LETTER TEH */
{ 0x05cb, 0x062b }, /* Arabic_theh Ø« ARABIC LETTER THEH */
{ 0x05cc, 0x062c }, /* Arabic_jeem ج ARABIC LETTER JEEM */
{ 0x05cd, 0x062d }, /* Arabic_hah Ø ARABIC LETTER HAH */
{ 0x05ce, 0x062e }, /* Arabic_khah Ø® ARABIC LETTER KHAH */
{ 0x05cf, 0x062f }, /* Arabic_dal د ARABIC LETTER DAL */
{ 0x05d0, 0x0630 }, /* Arabic_thal ذ ARABIC LETTER THAL */
{ 0x05d1, 0x0631 }, /* Arabic_ra ر ARABIC LETTER REH */
{ 0x05d2, 0x0632 }, /* Arabic_zain ز ARABIC LETTER ZAIN */
{ 0x05d3, 0x0633 }, /* Arabic_seen س ARABIC LETTER SEEN */
{ 0x05d4, 0x0634 }, /* Arabic_sheen Ø´ ARABIC LETTER SHEEN */
{ 0x05d5, 0x0635 }, /* Arabic_sad ص ARABIC LETTER SAD */
{ 0x05d6, 0x0636 }, /* Arabic_dad ض ARABIC LETTER DAD */
{ 0x05d7, 0x0637 }, /* Arabic_tah Ø· ARABIC LETTER TAH */
{ 0x05d8, 0x0638 }, /* Arabic_zah ظ ARABIC LETTER ZAH */
{ 0x05d9, 0x0639 }, /* Arabic_ain ع ARABIC LETTER AIN */
{ 0x05da, 0x063a }, /* Arabic_ghain غ ARABIC LETTER GHAIN */
{ 0x05e0, 0x0640 }, /* Arabic_tatweel Ù€ ARABIC TATWEEL */
{ 0x05e1, 0x0641 }, /* Arabic_feh Ù ARABIC LETTER FEH */
{ 0x05e2, 0x0642 }, /* Arabic_qaf Ù‚ ARABIC LETTER QAF */
{ 0x05e3, 0x0643 }, /* Arabic_kaf Ùƒ ARABIC LETTER KAF */
{ 0x05e4, 0x0644 }, /* Arabic_lam Ù„ ARABIC LETTER LAM */
{ 0x05e5, 0x0645 }, /* Arabic_meem Ù… ARABIC LETTER MEEM */
{ 0x05e6, 0x0646 }, /* Arabic_noon Ù† ARABIC LETTER NOON */
{ 0x05e7, 0x0647 }, /* Arabic_ha Ù‡ ARABIC LETTER HEH */
{ 0x05e8, 0x0648 }, /* Arabic_waw Ùˆ ARABIC LETTER WAW */
{ 0x05e9, 0x0649 }, /* Arabic_alefmaksura Ù‰ ARABIC LETTER ALEF MAKSURA */
{ 0x05ea, 0x064a }, /* Arabic_yeh ÙŠ ARABIC LETTER YEH */
{ 0x05eb, 0x064b }, /* Arabic_fathatan Ù‹ ARABIC FATHATAN */
{ 0x05ec, 0x064c }, /* Arabic_dammatan ٌ ARABIC DAMMATAN */
{ 0x05ed, 0x064d }, /* Arabic_kasratan Ù ARABIC KASRATAN */
{ 0x05ee, 0x064e }, /* Arabic_fatha ÙŽ ARABIC FATHA */
{ 0x05ef, 0x064f }, /* Arabic_damma Ù ARABIC DAMMA */
{ 0x05f0, 0x0650 }, /* Arabic_kasra Ù ARABIC KASRA */
{ 0x05f1, 0x0651 }, /* Arabic_shadda Ù‘ ARABIC SHADDA */
{ 0x05f2, 0x0652 }, /* Arabic_sukun Ù’ ARABIC SUKUN */
{ 0x06a1, 0x0452 }, /* Serbian_dje Ñ’ CYRILLIC SMALL LETTER DJE */
{ 0x06a2, 0x0453 }, /* Macedonia_gje Ñ“ CYRILLIC SMALL LETTER GJE */
{ 0x06a3, 0x0451 }, /* Cyrillic_io Ñ‘ CYRILLIC SMALL LETTER IO */
{ 0x06a4, 0x0454 }, /* Ukrainian_ie Ñ” CYRILLIC SMALL LETTER UKRAINIAN IE */
{ 0x06a5, 0x0455 }, /* Macedonia_dse Ñ• CYRILLIC SMALL LETTER DZE */
{ 0x06a6, 0x0456 }, /* Ukrainian_i Ñ– CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */
{ 0x06a7, 0x0457 }, /* Ukrainian_yi Ñ— CYRILLIC SMALL LETTER YI */
{ 0x06a8, 0x0458 }, /* Cyrillic_je ј CYRILLIC SMALL LETTER JE */
{ 0x06a9, 0x0459 }, /* Cyrillic_lje Ñ™ CYRILLIC SMALL LETTER LJE */
{ 0x06aa, 0x045a }, /* Cyrillic_nje Ñš CYRILLIC SMALL LETTER NJE */
{ 0x06ab, 0x045b }, /* Serbian_tshe Ñ› CYRILLIC SMALL LETTER TSHE */
{ 0x06ac, 0x045c }, /* Macedonia_kje ќ CYRILLIC SMALL LETTER KJE */
{ 0x06ad, 0x0491 }, /* Ukrainian_ghe_with_upturn Ò‘ CYRILLIC SMALL LETTER GHE WITH UPTURN */
{ 0x06ae, 0x045e }, /* Byelorussian_shortu Ñž CYRILLIC SMALL LETTER SHORT U */
{ 0x06af, 0x045f }, /* Cyrillic_dzhe ÑŸ CYRILLIC SMALL LETTER DZHE */
{ 0x06b0, 0x2116 }, /* numerosign â„– NUMERO SIGN */
{ 0x06b1, 0x0402 }, /* Serbian_DJE Ђ CYRILLIC CAPITAL LETTER DJE */
{ 0x06b2, 0x0403 }, /* Macedonia_GJE Ѓ CYRILLIC CAPITAL LETTER GJE */
{ 0x06b3, 0x0401 }, /* Cyrillic_IO Ð CYRILLIC CAPITAL LETTER IO */
{ 0x06b4, 0x0404 }, /* Ukrainian_IE Є CYRILLIC CAPITAL LETTER UKRAINIAN IE */
{ 0x06b5, 0x0405 }, /* Macedonia_DSE Ð… CYRILLIC CAPITAL LETTER DZE */
{ 0x06b6, 0x0406 }, /* Ukrainian_I І CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */
{ 0x06b7, 0x0407 }, /* Ukrainian_YI Ї CYRILLIC CAPITAL LETTER YI */
{ 0x06b8, 0x0408 }, /* Cyrillic_JE Ј CYRILLIC CAPITAL LETTER JE */
{ 0x06b9, 0x0409 }, /* Cyrillic_LJE Љ CYRILLIC CAPITAL LETTER LJE */
{ 0x06ba, 0x040a }, /* Cyrillic_NJE Њ CYRILLIC CAPITAL LETTER NJE */
{ 0x06bb, 0x040b }, /* Serbian_TSHE Ћ CYRILLIC CAPITAL LETTER TSHE */
{ 0x06bc, 0x040c }, /* Macedonia_KJE Ќ CYRILLIC CAPITAL LETTER KJE */
{ 0x06bd, 0x0490 }, /* Ukrainian_GHE_WITH_UPTURN Ò CYRILLIC CAPITAL LETTER GHE WITH UPTURN */
{ 0x06be, 0x040e }, /* Byelorussian_SHORTU ÐŽ CYRILLIC CAPITAL LETTER SHORT U */
{ 0x06bf, 0x040f }, /* Cyrillic_DZHE Ð CYRILLIC CAPITAL LETTER DZHE */
{ 0x06c0, 0x044e }, /* Cyrillic_yu ÑŽ CYRILLIC SMALL LETTER YU */
{ 0x06c1, 0x0430 }, /* Cyrillic_a а CYRILLIC SMALL LETTER A */
{ 0x06c2, 0x0431 }, /* Cyrillic_be б CYRILLIC SMALL LETTER BE */
{ 0x06c3, 0x0446 }, /* Cyrillic_tse ц CYRILLIC SMALL LETTER TSE */
{ 0x06c4, 0x0434 }, /* Cyrillic_de д CYRILLIC SMALL LETTER DE */
{ 0x06c5, 0x0435 }, /* Cyrillic_ie е CYRILLIC SMALL LETTER IE */
{ 0x06c6, 0x0444 }, /* Cyrillic_ef Ñ„ CYRILLIC SMALL LETTER EF */
{ 0x06c7, 0x0433 }, /* Cyrillic_ghe г CYRILLIC SMALL LETTER GHE */
{ 0x06c8, 0x0445 }, /* Cyrillic_ha Ñ… CYRILLIC SMALL LETTER HA */
{ 0x06c9, 0x0438 }, /* Cyrillic_i и CYRILLIC SMALL LETTER I */
{ 0x06ca, 0x0439 }, /* Cyrillic_shorti й CYRILLIC SMALL LETTER SHORT I */
{ 0x06cb, 0x043a }, /* Cyrillic_ka к CYRILLIC SMALL LETTER KA */
{ 0x06cc, 0x043b }, /* Cyrillic_el л CYRILLIC SMALL LETTER EL */
{ 0x06cd, 0x043c }, /* Cyrillic_em м CYRILLIC SMALL LETTER EM */
{ 0x06ce, 0x043d }, /* Cyrillic_en н CYRILLIC SMALL LETTER EN */
{ 0x06cf, 0x043e }, /* Cyrillic_o о CYRILLIC SMALL LETTER O */
{ 0x06d0, 0x043f }, /* Cyrillic_pe п CYRILLIC SMALL LETTER PE */
{ 0x06d1, 0x044f }, /* Cyrillic_ya Ñ CYRILLIC SMALL LETTER YA */
{ 0x06d2, 0x0440 }, /* Cyrillic_er р CYRILLIC SMALL LETTER ER */
{ 0x06d3, 0x0441 }, /* Cyrillic_es Ñ CYRILLIC SMALL LETTER ES */
{ 0x06d4, 0x0442 }, /* Cyrillic_te Ñ‚ CYRILLIC SMALL LETTER TE */
{ 0x06d5, 0x0443 }, /* Cyrillic_u у CYRILLIC SMALL LETTER U */
{ 0x06d6, 0x0436 }, /* Cyrillic_zhe ж CYRILLIC SMALL LETTER ZHE */
{ 0x06d7, 0x0432 }, /* Cyrillic_ve в CYRILLIC SMALL LETTER VE */
{ 0x06d8, 0x044c }, /* Cyrillic_softsign ь CYRILLIC SMALL LETTER SOFT SIGN */
{ 0x06d9, 0x044b }, /* Cyrillic_yeru Ñ‹ CYRILLIC SMALL LETTER YERU */
{ 0x06da, 0x0437 }, /* Cyrillic_ze з CYRILLIC SMALL LETTER ZE */
{ 0x06db, 0x0448 }, /* Cyrillic_sha ш CYRILLIC SMALL LETTER SHA */
{ 0x06dc, 0x044d }, /* Cyrillic_e Ñ CYRILLIC SMALL LETTER E */
{ 0x06dd, 0x0449 }, /* Cyrillic_shcha щ CYRILLIC SMALL LETTER SHCHA */
{ 0x06de, 0x0447 }, /* Cyrillic_che ч CYRILLIC SMALL LETTER CHE */
{ 0x06df, 0x044a }, /* Cyrillic_hardsign ÑŠ CYRILLIC SMALL LETTER HARD SIGN */
{ 0x06e0, 0x042e }, /* Cyrillic_YU Ю CYRILLIC CAPITAL LETTER YU */
{ 0x06e1, 0x0410 }, /* Cyrillic_A Ð CYRILLIC CAPITAL LETTER A */
{ 0x06e2, 0x0411 }, /* Cyrillic_BE Б CYRILLIC CAPITAL LETTER BE */
{ 0x06e3, 0x0426 }, /* Cyrillic_TSE Ц CYRILLIC CAPITAL LETTER TSE */
{ 0x06e4, 0x0414 }, /* Cyrillic_DE Д CYRILLIC CAPITAL LETTER DE */
{ 0x06e5, 0x0415 }, /* Cyrillic_IE Е CYRILLIC CAPITAL LETTER IE */
{ 0x06e6, 0x0424 }, /* Cyrillic_EF Ф CYRILLIC CAPITAL LETTER EF */
{ 0x06e7, 0x0413 }, /* Cyrillic_GHE Г CYRILLIC CAPITAL LETTER GHE */
{ 0x06e8, 0x0425 }, /* Cyrillic_HA Х CYRILLIC CAPITAL LETTER HA */
{ 0x06e9, 0x0418 }, /* Cyrillic_I И CYRILLIC CAPITAL LETTER I */
{ 0x06ea, 0x0419 }, /* Cyrillic_SHORTI Й CYRILLIC CAPITAL LETTER SHORT I */
{ 0x06eb, 0x041a }, /* Cyrillic_KA К CYRILLIC CAPITAL LETTER KA */
{ 0x06ec, 0x041b }, /* Cyrillic_EL Л CYRILLIC CAPITAL LETTER EL */
{ 0x06ed, 0x041c }, /* Cyrillic_EM М CYRILLIC CAPITAL LETTER EM */
{ 0x06ee, 0x041d }, /* Cyrillic_EN Ð CYRILLIC CAPITAL LETTER EN */
{ 0x06ef, 0x041e }, /* Cyrillic_O О CYRILLIC CAPITAL LETTER O */
{ 0x06f0, 0x041f }, /* Cyrillic_PE П CYRILLIC CAPITAL LETTER PE */
{ 0x06f1, 0x042f }, /* Cyrillic_YA Я CYRILLIC CAPITAL LETTER YA */
{ 0x06f2, 0x0420 }, /* Cyrillic_ER Ð CYRILLIC CAPITAL LETTER ER */
{ 0x06f3, 0x0421 }, /* Cyrillic_ES С CYRILLIC CAPITAL LETTER ES */
{ 0x06f4, 0x0422 }, /* Cyrillic_TE Т CYRILLIC CAPITAL LETTER TE */
{ 0x06f5, 0x0423 }, /* Cyrillic_U У CYRILLIC CAPITAL LETTER U */
{ 0x06f6, 0x0416 }, /* Cyrillic_ZHE Ж CYRILLIC CAPITAL LETTER ZHE */
{ 0x06f7, 0x0412 }, /* Cyrillic_VE Ð’ CYRILLIC CAPITAL LETTER VE */
{ 0x06f8, 0x042c }, /* Cyrillic_SOFTSIGN Ь CYRILLIC CAPITAL LETTER SOFT SIGN */
{ 0x06f9, 0x042b }, /* Cyrillic_YERU Ы CYRILLIC CAPITAL LETTER YERU */
{ 0x06fa, 0x0417 }, /* Cyrillic_ZE З CYRILLIC CAPITAL LETTER ZE */
{ 0x06fb, 0x0428 }, /* Cyrillic_SHA Ш CYRILLIC CAPITAL LETTER SHA */
{ 0x06fc, 0x042d }, /* Cyrillic_E Ð CYRILLIC CAPITAL LETTER E */
{ 0x06fd, 0x0429 }, /* Cyrillic_SHCHA Щ CYRILLIC CAPITAL LETTER SHCHA */
{ 0x06fe, 0x0427 }, /* Cyrillic_CHE Ч CYRILLIC CAPITAL LETTER CHE */
{ 0x06ff, 0x042a }, /* Cyrillic_HARDSIGN Ъ CYRILLIC CAPITAL LETTER HARD SIGN */
{ 0x07a1, 0x0386 }, /* Greek_ALPHAaccent Ά GREEK CAPITAL LETTER ALPHA WITH TONOS */
{ 0x07a2, 0x0388 }, /* Greek_EPSILONaccent Έ GREEK CAPITAL LETTER EPSILON WITH TONOS */
{ 0x07a3, 0x0389 }, /* Greek_ETAaccent Ή GREEK CAPITAL LETTER ETA WITH TONOS */
{ 0x07a4, 0x038a }, /* Greek_IOTAaccent Ί GREEK CAPITAL LETTER IOTA WITH TONOS */
{ 0x07a5, 0x03aa }, /* Greek_IOTAdiaeresis Ϊ GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */
{ 0x07a7, 0x038c }, /* Greek_OMICRONaccent Ό GREEK CAPITAL LETTER OMICRON WITH TONOS */
{ 0x07a8, 0x038e }, /* Greek_UPSILONaccent ÎŽ GREEK CAPITAL LETTER UPSILON WITH TONOS */
{ 0x07a9, 0x03ab }, /* Greek_UPSILONdieresis Ϋ GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */
{ 0x07ab, 0x038f }, /* Greek_OMEGAaccent Î GREEK CAPITAL LETTER OMEGA WITH TONOS */
{ 0x07ae, 0x0385 }, /* Greek_accentdieresis Î… GREEK DIALYTIKA TONOS */
{ 0x07af, 0x2015 }, /* Greek_horizbar ― HORIZONTAL BAR */
{ 0x07b1, 0x03ac }, /* Greek_alphaaccent ά GREEK SMALL LETTER ALPHA WITH TONOS */
{ 0x07b2, 0x03ad }, /* Greek_epsilonaccent Î GREEK SMALL LETTER EPSILON WITH TONOS */
{ 0x07b3, 0x03ae }, /* Greek_etaaccent ή GREEK SMALL LETTER ETA WITH TONOS */
{ 0x07b4, 0x03af }, /* Greek_iotaaccent ί GREEK SMALL LETTER IOTA WITH TONOS */
{ 0x07b5, 0x03ca }, /* Greek_iotadieresis ÏŠ GREEK SMALL LETTER IOTA WITH DIALYTIKA */
{ 0x07b6, 0x0390 }, /* Greek_iotaaccentdieresis Î GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */
{ 0x07b7, 0x03cc }, /* Greek_omicronaccent ό GREEK SMALL LETTER OMICRON WITH TONOS */
{ 0x07b8, 0x03cd }, /* Greek_upsilonaccent Ï GREEK SMALL LETTER UPSILON WITH TONOS */
{ 0x07b9, 0x03cb }, /* Greek_upsilondieresis Ï‹ GREEK SMALL LETTER UPSILON WITH DIALYTIKA */
{ 0x07ba, 0x03b0 }, /* Greek_upsilonaccentdieresis ΰ GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */
{ 0x07bb, 0x03ce }, /* Greek_omegaaccent ÏŽ GREEK SMALL LETTER OMEGA WITH TONOS */
{ 0x07c1, 0x0391 }, /* Greek_ALPHA Α GREEK CAPITAL LETTER ALPHA */
{ 0x07c2, 0x0392 }, /* Greek_BETA Î’ GREEK CAPITAL LETTER BETA */
{ 0x07c3, 0x0393 }, /* Greek_GAMMA Γ GREEK CAPITAL LETTER GAMMA */
{ 0x07c4, 0x0394 }, /* Greek_DELTA Δ GREEK CAPITAL LETTER DELTA */
{ 0x07c5, 0x0395 }, /* Greek_EPSILON Ε GREEK CAPITAL LETTER EPSILON */
{ 0x07c6, 0x0396 }, /* Greek_ZETA Ζ GREEK CAPITAL LETTER ZETA */
{ 0x07c7, 0x0397 }, /* Greek_ETA Η GREEK CAPITAL LETTER ETA */
{ 0x07c8, 0x0398 }, /* Greek_THETA Θ GREEK CAPITAL LETTER THETA */
{ 0x07c9, 0x0399 }, /* Greek_IOTA Ι GREEK CAPITAL LETTER IOTA */
{ 0x07ca, 0x039a }, /* Greek_KAPPA Κ GREEK CAPITAL LETTER KAPPA */
{ 0x07cb, 0x039b }, /* Greek_LAMBDA Λ GREEK CAPITAL LETTER LAMDA */
{ 0x07cc, 0x039c }, /* Greek_MU Μ GREEK CAPITAL LETTER MU */
{ 0x07cd, 0x039d }, /* Greek_NU Î GREEK CAPITAL LETTER NU */
{ 0x07ce, 0x039e }, /* Greek_XI Ξ GREEK CAPITAL LETTER XI */
{ 0x07cf, 0x039f }, /* Greek_OMICRON Ο GREEK CAPITAL LETTER OMICRON */
{ 0x07d0, 0x03a0 }, /* Greek_PI Î GREEK CAPITAL LETTER PI */
{ 0x07d1, 0x03a1 }, /* Greek_RHO Ρ GREEK CAPITAL LETTER RHO */
{ 0x07d2, 0x03a3 }, /* Greek_SIGMA Σ GREEK CAPITAL LETTER SIGMA */
{ 0x07d4, 0x03a4 }, /* Greek_TAU Τ GREEK CAPITAL LETTER TAU */
{ 0x07d5, 0x03a5 }, /* Greek_UPSILON Υ GREEK CAPITAL LETTER UPSILON */
{ 0x07d6, 0x03a6 }, /* Greek_PHI Φ GREEK CAPITAL LETTER PHI */
{ 0x07d7, 0x03a7 }, /* Greek_CHI Χ GREEK CAPITAL LETTER CHI */
{ 0x07d8, 0x03a8 }, /* Greek_PSI Ψ GREEK CAPITAL LETTER PSI */
{ 0x07d9, 0x03a9 }, /* Greek_OMEGA Ω GREEK CAPITAL LETTER OMEGA */
{ 0x07e1, 0x03b1 }, /* Greek_alpha α GREEK SMALL LETTER ALPHA */
{ 0x07e2, 0x03b2 }, /* Greek_beta β GREEK SMALL LETTER BETA */
{ 0x07e3, 0x03b3 }, /* Greek_gamma γ GREEK SMALL LETTER GAMMA */
{ 0x07e4, 0x03b4 }, /* Greek_delta δ GREEK SMALL LETTER DELTA */
{ 0x07e5, 0x03b5 }, /* Greek_epsilon ε GREEK SMALL LETTER EPSILON */
{ 0x07e6, 0x03b6 }, /* Greek_zeta ζ GREEK SMALL LETTER ZETA */
{ 0x07e7, 0x03b7 }, /* Greek_eta η GREEK SMALL LETTER ETA */
{ 0x07e8, 0x03b8 }, /* Greek_theta θ GREEK SMALL LETTER THETA */
{ 0x07e9, 0x03b9 }, /* Greek_iota ι GREEK SMALL LETTER IOTA */
{ 0x07ea, 0x03ba }, /* Greek_kappa κ GREEK SMALL LETTER KAPPA */
{ 0x07eb, 0x03bb }, /* Greek_lambda λ GREEK SMALL LETTER LAMDA */
{ 0x07ec, 0x03bc }, /* Greek_mu μ GREEK SMALL LETTER MU */
{ 0x07ed, 0x03bd }, /* Greek_nu ν GREEK SMALL LETTER NU */
{ 0x07ee, 0x03be }, /* Greek_xi ξ GREEK SMALL LETTER XI */
{ 0x07ef, 0x03bf }, /* Greek_omicron ο GREEK SMALL LETTER OMICRON */
{ 0x07f0, 0x03c0 }, /* Greek_pi π GREEK SMALL LETTER PI */
{ 0x07f1, 0x03c1 }, /* Greek_rho Ï GREEK SMALL LETTER RHO */
{ 0x07f2, 0x03c3 }, /* Greek_sigma σ GREEK SMALL LETTER SIGMA */
{ 0x07f3, 0x03c2 }, /* Greek_finalsmallsigma Ï‚ GREEK SMALL LETTER FINAL SIGMA */
{ 0x07f4, 0x03c4 }, /* Greek_tau Ï„ GREEK SMALL LETTER TAU */
{ 0x07f5, 0x03c5 }, /* Greek_upsilon Ï… GREEK SMALL LETTER UPSILON */
{ 0x07f6, 0x03c6 }, /* Greek_phi φ GREEK SMALL LETTER PHI */
{ 0x07f7, 0x03c7 }, /* Greek_chi χ GREEK SMALL LETTER CHI */
{ 0x07f8, 0x03c8 }, /* Greek_psi ψ GREEK SMALL LETTER PSI */
{ 0x07f9, 0x03c9 }, /* Greek_omega ω GREEK SMALL LETTER OMEGA */
{ 0x08a1, 0x23b7 }, /* leftradical ⎷ RADICAL SYMBOL BOTTOM */
{ 0x08a2, 0x250c }, /* topleftradical ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
{ 0x08a3, 0x2500 }, /* horizconnector ─ BOX DRAWINGS LIGHT HORIZONTAL */
{ 0x08a4, 0x2320 }, /* topintegral ⌠TOP HALF INTEGRAL */
{ 0x08a5, 0x2321 }, /* botintegral ⌡ BOTTOM HALF INTEGRAL */
{ 0x08a6, 0x2502 }, /* vertconnector │ BOX DRAWINGS LIGHT VERTICAL */
{ 0x08a7, 0x23a1 }, /* topleftsqbracket ⎡ LEFT SQUARE BRACKET UPPER CORNER */
{ 0x08a8, 0x23a3 }, /* botleftsqbracket ⎣ LEFT SQUARE BRACKET LOWER CORNER */
{ 0x08a9, 0x23a4 }, /* toprightsqbracket ⎤ RIGHT SQUARE BRACKET UPPER CORNER */
{ 0x08aa, 0x23a6 }, /* botrightsqbracket ⎦ RIGHT SQUARE BRACKET LOWER CORNER */
{ 0x08ab, 0x239b }, /* topleftparens ⎛ LEFT PARENTHESIS UPPER HOOK */
{ 0x08ac, 0x239d }, /* botleftparens ⎠LEFT PARENTHESIS LOWER HOOK */
{ 0x08ad, 0x239e }, /* toprightparens ⎞ RIGHT PARENTHESIS UPPER HOOK */
{ 0x08ae, 0x23a0 }, /* botrightparens ⎠RIGHT PARENTHESIS LOWER HOOK */
{ 0x08af, 0x23a8 }, /* leftmiddlecurlybrace ⎨ LEFT CURLY BRACKET MIDDLE PIECE */
{ 0x08b0, 0x23ac }, /* rightmiddlecurlybrace ⎬ RIGHT CURLY BRACKET MIDDLE PIECE */
/* 0x08b1 topleftsummation ? ??? */
/* 0x08b2 botleftsummation ? ??? */
/* 0x08b3 topvertsummationconnector ? ??? */
/* 0x08b4 botvertsummationconnector ? ??? */
/* 0x08b5 toprightsummation ? ??? */
/* 0x08b6 botrightsummation ? ??? */
/* 0x08b7 rightmiddlesummation ? ??? */
{ 0x08bc, 0x2264 }, /* lessthanequal ≤ LESS-THAN OR EQUAL TO */
{ 0x08bd, 0x2260 }, /* notequal ≠NOT EQUAL TO */
{ 0x08be, 0x2265 }, /* greaterthanequal ≥ GREATER-THAN OR EQUAL TO */
{ 0x08bf, 0x222b }, /* integral ∫ INTEGRAL */
{ 0x08c0, 0x2234 }, /* therefore ∴ THEREFORE */
{ 0x08c1, 0x221d }, /* variation ∠PROPORTIONAL TO */
{ 0x08c2, 0x221e }, /* infinity ∞ INFINITY */
{ 0x08c5, 0x2207 }, /* nabla ∇ NABLA */
{ 0x08c8, 0x223c }, /* approximate ∼ TILDE OPERATOR */
{ 0x08c9, 0x2243 }, /* similarequal ≃ ASYMPTOTICALLY EQUAL TO */
{ 0x08cd, 0x21d4 }, /* ifonlyif ⇔ LEFT RIGHT DOUBLE ARROW */
{ 0x08ce, 0x21d2 }, /* implies ⇒ RIGHTWARDS DOUBLE ARROW */
{ 0x08cf, 0x2261 }, /* identical ≡ IDENTICAL TO */
{ 0x08d6, 0x221a }, /* radical √ SQUARE ROOT */
{ 0x08da, 0x2282 }, /* includedin ⊂ SUBSET OF */
{ 0x08db, 0x2283 }, /* includes ⊃ SUPERSET OF */
{ 0x08dc, 0x2229 }, /* intersection ∩ INTERSECTION */
{ 0x08dd, 0x222a }, /* union ∪ UNION */
{ 0x08de, 0x2227 }, /* logicaland ∧ LOGICAL AND */
{ 0x08df, 0x2228 }, /* logicalor ∨ LOGICAL OR */
{ 0x08ef, 0x2202 }, /* partialderivative ∂ PARTIAL DIFFERENTIAL */
{ 0x08f6, 0x0192 }, /* function Æ’ LATIN SMALL LETTER F WITH HOOK */
{ 0x08fb, 0x2190 }, /* leftarrow ↠LEFTWARDS ARROW */
{ 0x08fc, 0x2191 }, /* uparrow ↑ UPWARDS ARROW */
{ 0x08fd, 0x2192 }, /* rightarrow → RIGHTWARDS ARROW */
{ 0x08fe, 0x2193 }, /* downarrow ↓ DOWNWARDS ARROW */
{ 0x09df, 0x2422 }, /* blank ⢠BLANK SYMBOL */
{ 0x09e0, 0x25c6 }, /* soliddiamond â—† BLACK DIAMOND */
{ 0x09e1, 0x2592 }, /* checkerboard â–’ MEDIUM SHADE */
{ 0x09e2, 0x2409 }, /* ht ≠SYMBOL FOR HORIZONTAL TABULATION */
{ 0x09e3, 0x240c }, /* ff ⌠SYMBOL FOR FORM FEED */
{ 0x09e4, 0x240d }, /* cr â SYMBOL FOR CARRIAGE RETURN */
{ 0x09e5, 0x240a }, /* lf ⊠SYMBOL FOR LINE FEED */
{ 0x09e8, 0x2424 }, /* nl ⤠SYMBOL FOR NEWLINE */
{ 0x09e9, 0x240b }, /* vt â‹ SYMBOL FOR VERTICAL TABULATION */
{ 0x09ea, 0x2518 }, /* lowrightcorner ┘ BOX DRAWINGS LIGHT UP AND LEFT */
{ 0x09eb, 0x2510 }, /* uprightcorner â” BOX DRAWINGS LIGHT DOWN AND LEFT */
{ 0x09ec, 0x250c }, /* upleftcorner ┌ BOX DRAWINGS LIGHT DOWN AND RIGHT */
{ 0x09ed, 0x2514 }, /* lowleftcorner â”” BOX DRAWINGS LIGHT UP AND RIGHT */
{ 0x09ee, 0x253c }, /* crossinglines ┼ BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */
{ 0x09ef, 0x23ba }, /* horizlinescan1 ⎺ HORIZONTAL SCAN LINE-1 */
{ 0x09f0, 0x23bb }, /* horizlinescan3 ⎻ HORIZONTAL SCAN LINE-3 */
{ 0x09f1, 0x2500 }, /* horizlinescan5 ─ BOX DRAWINGS LIGHT HORIZONTAL */
{ 0x09f2, 0x23bc }, /* horizlinescan7 ⎼ HORIZONTAL SCAN LINE-7 */
{ 0x09f3, 0x23bd }, /* horizlinescan9 ⎽ HORIZONTAL SCAN LINE-9 */
{ 0x09f4, 0x251c }, /* leftt ├ BOX DRAWINGS LIGHT VERTICAL AND RIGHT */
{ 0x09f5, 0x2524 }, /* rightt ┤ BOX DRAWINGS LIGHT VERTICAL AND LEFT */
{ 0x09f6, 0x2534 }, /* bott â”´ BOX DRAWINGS LIGHT UP AND HORIZONTAL */
{ 0x09f7, 0x252c }, /* topt ┬ BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */
{ 0x09f8, 0x2502 }, /* vertbar │ BOX DRAWINGS LIGHT VERTICAL */
{ 0x0aa1, 0x2003 }, /* emspace   EM SPACE */
{ 0x0aa2, 0x2002 }, /* enspace   EN SPACE */
{ 0x0aa3, 0x2004 }, /* em3space   THREE-PER-EM SPACE */
{ 0x0aa4, 0x2005 }, /* em4space   FOUR-PER-EM SPACE */
{ 0x0aa5, 0x2007 }, /* digitspace   FIGURE SPACE */
{ 0x0aa6, 0x2008 }, /* punctspace   PUNCTUATION SPACE */
{ 0x0aa7, 0x2009 }, /* thinspace   THIN SPACE */
{ 0x0aa8, 0x200a }, /* hairspace   HAIR SPACE */
{ 0x0aa9, 0x2014 }, /* emdash — EM DASH */
{ 0x0aaa, 0x2013 }, /* endash – EN DASH */
{ 0x0aac, 0x2423 }, /* signifblank ⣠OPEN BOX */
{ 0x0aae, 0x2026 }, /* ellipsis … HORIZONTAL ELLIPSIS */
{ 0x0aaf, 0x2025 }, /* doubbaselinedot ‥ TWO DOT LEADER */
{ 0x0ab0, 0x2153 }, /* onethird â…“ VULGAR FRACTION ONE THIRD */
{ 0x0ab1, 0x2154 }, /* twothirds â…” VULGAR FRACTION TWO THIRDS */
{ 0x0ab2, 0x2155 }, /* onefifth â…• VULGAR FRACTION ONE FIFTH */
{ 0x0ab3, 0x2156 }, /* twofifths â…– VULGAR FRACTION TWO FIFTHS */
{ 0x0ab4, 0x2157 }, /* threefifths â…— VULGAR FRACTION THREE FIFTHS */
{ 0x0ab5, 0x2158 }, /* fourfifths â…˜ VULGAR FRACTION FOUR FIFTHS */
{ 0x0ab6, 0x2159 }, /* onesixth â…™ VULGAR FRACTION ONE SIXTH */
{ 0x0ab7, 0x215a }, /* fivesixths â…š VULGAR FRACTION FIVE SIXTHS */
{ 0x0ab8, 0x2105 }, /* careof â„… CARE OF */
{ 0x0abb, 0x2012 }, /* figdash ‒ FIGURE DASH */
{ 0x0abc, 0x2329 }, /* leftanglebracket 〈 LEFT-POINTING ANGLE BRACKET */
{ 0x0abd, 0x002e }, /* decimalpoint . FULL STOP */
{ 0x0abe, 0x232a }, /* rightanglebracket 〉 RIGHT-POINTING ANGLE BRACKET */
/* 0x0abf marker ? ??? */
{ 0x0ac3, 0x215b }, /* oneeighth â…› VULGAR FRACTION ONE EIGHTH */
{ 0x0ac4, 0x215c }, /* threeeighths ⅜ VULGAR FRACTION THREE EIGHTHS */
{ 0x0ac5, 0x215d }, /* fiveeighths â… VULGAR FRACTION FIVE EIGHTHS */
{ 0x0ac6, 0x215e }, /* seveneighths â…ž VULGAR FRACTION SEVEN EIGHTHS */
{ 0x0ac9, 0x2122 }, /* trademark â„¢ TRADE MARK SIGN */
{ 0x0aca, 0x2613 }, /* signaturemark ☓ SALTIRE */
/* 0x0acb trademarkincircle ? ??? */
{ 0x0acc, 0x25c1 }, /* leftopentriangle â— WHITE LEFT-POINTING TRIANGLE */
{ 0x0acd, 0x25b7 }, /* rightopentriangle â–· WHITE RIGHT-POINTING TRIANGLE */
{ 0x0ace, 0x25cb }, /* emopencircle â—‹ WHITE CIRCLE */
{ 0x0acf, 0x25af }, /* emopenrectangle â–¯ WHITE VERTICAL RECTANGLE */
{ 0x0ad0, 0x2018 }, /* leftsinglequotemark ‘ LEFT SINGLE QUOTATION MARK */
{ 0x0ad1, 0x2019 }, /* rightsinglequotemark ’ RIGHT SINGLE QUOTATION MARK */
{ 0x0ad2, 0x201c }, /* leftdoublequotemark “ LEFT DOUBLE QUOTATION MARK */
{ 0x0ad3, 0x201d }, /* rightdoublequotemark †RIGHT DOUBLE QUOTATION MARK */
{ 0x0ad4, 0x211e }, /* prescription ℞ PRESCRIPTION TAKE */
{ 0x0ad6, 0x2032 }, /* minutes ′ PRIME */
{ 0x0ad7, 0x2033 }, /* seconds ″ DOUBLE PRIME */
{ 0x0ad9, 0x271d }, /* latincross ✠LATIN CROSS */
/* 0x0ada hexagram ? ??? */
{ 0x0adb, 0x25ac }, /* filledrectbullet â–¬ BLACK RECTANGLE */
{ 0x0adc, 0x25c0 }, /* filledlefttribullet â—€ BLACK LEFT-POINTING TRIANGLE */
{ 0x0add, 0x25b6 }, /* filledrighttribullet â–¶ BLACK RIGHT-POINTING TRIANGLE */
{ 0x0ade, 0x25cf }, /* emfilledcircle â— BLACK CIRCLE */
{ 0x0adf, 0x25ae }, /* emfilledrect â–® BLACK VERTICAL RECTANGLE */
{ 0x0ae0, 0x25e6 }, /* enopencircbullet â—¦ WHITE BULLET */
{ 0x0ae1, 0x25ab }, /* enopensquarebullet â–« WHITE SMALL SQUARE */
{ 0x0ae2, 0x25ad }, /* openrectbullet â– WHITE RECTANGLE */
{ 0x0ae3, 0x25b3 }, /* opentribulletup â–³ WHITE UP-POINTING TRIANGLE */
{ 0x0ae4, 0x25bd }, /* opentribulletdown â–½ WHITE DOWN-POINTING TRIANGLE */
{ 0x0ae5, 0x2606 }, /* openstar ☆ WHITE STAR */
{ 0x0ae6, 0x2022 }, /* enfilledcircbullet • BULLET */
{ 0x0ae7, 0x25aa }, /* enfilledsqbullet â–ª BLACK SMALL SQUARE */
{ 0x0ae8, 0x25b2 }, /* filledtribulletup â–² BLACK UP-POINTING TRIANGLE */
{ 0x0ae9, 0x25bc }, /* filledtribulletdown â–¼ BLACK DOWN-POINTING TRIANGLE */
{ 0x0aea, 0x261c }, /* leftpointer ☜ WHITE LEFT POINTING INDEX */
{ 0x0aeb, 0x261e }, /* rightpointer ☞ WHITE RIGHT POINTING INDEX */
{ 0x0aec, 0x2663 }, /* club ♣ BLACK CLUB SUIT */
{ 0x0aed, 0x2666 }, /* diamond ♦ BLACK DIAMOND SUIT */
{ 0x0aee, 0x2665 }, /* heart ♥ BLACK HEART SUIT */
{ 0x0af0, 0x2720 }, /* maltesecross ✠MALTESE CROSS */
{ 0x0af1, 0x2020 }, /* dagger †DAGGER */
{ 0x0af2, 0x2021 }, /* doubledagger ‡ DOUBLE DAGGER */
{ 0x0af3, 0x2713 }, /* checkmark ✓ CHECK MARK */
{ 0x0af4, 0x2717 }, /* ballotcross ✗ BALLOT X */
{ 0x0af5, 0x266f }, /* musicalsharp ♯ MUSIC SHARP SIGN */
{ 0x0af6, 0x266d }, /* musicalflat â™ MUSIC FLAT SIGN */
{ 0x0af7, 0x2642 }, /* malesymbol ♂ MALE SIGN */
{ 0x0af8, 0x2640 }, /* femalesymbol ♀ FEMALE SIGN */
{ 0x0af9, 0x260e }, /* telephone ☎ BLACK TELEPHONE */
{ 0x0afa, 0x2315 }, /* telephonerecorder ⌕ TELEPHONE RECORDER */
{ 0x0afb, 0x2117 }, /* phonographcopyright â„— SOUND RECORDING COPYRIGHT */
{ 0x0afc, 0x2038 }, /* caret ‸ CARET */
{ 0x0afd, 0x201a }, /* singlelowquotemark ‚ SINGLE LOW-9 QUOTATION MARK */
{ 0x0afe, 0x201e }, /* doublelowquotemark „ DOUBLE LOW-9 QUOTATION MARK */
/* 0x0aff cursor ? ??? */
{ 0x0ba3, 0x003c }, /* leftcaret < LESS-THAN SIGN */
{ 0x0ba6, 0x003e }, /* rightcaret > GREATER-THAN SIGN */
{ 0x0ba8, 0x2228 }, /* downcaret ∨ LOGICAL OR */
{ 0x0ba9, 0x2227 }, /* upcaret ∧ LOGICAL AND */
{ 0x0bc0, 0x00af }, /* overbar ¯ MACRON */
{ 0x0bc2, 0x22a5 }, /* downtack ⊥ UP TACK */
{ 0x0bc3, 0x2229 }, /* upshoe ∩ INTERSECTION */
{ 0x0bc4, 0x230a }, /* downstile ⌊ LEFT FLOOR */
{ 0x0bc6, 0x005f }, /* underbar _ LOW LINE */
{ 0x0bca, 0x2218 }, /* jot ∘ RING OPERATOR */
{ 0x0bcc, 0x2395 }, /* quad ⎕ APL FUNCTIONAL SYMBOL QUAD */
{ 0x0bce, 0x22a4 }, /* uptack ⊤ DOWN TACK */
{ 0x0bcf, 0x25cb }, /* circle â—‹ WHITE CIRCLE */
{ 0x0bd3, 0x2308 }, /* upstile ⌈ LEFT CEILING */
{ 0x0bd6, 0x222a }, /* downshoe ∪ UNION */
{ 0x0bd8, 0x2283 }, /* rightshoe ⊃ SUPERSET OF */
{ 0x0bda, 0x2282 }, /* leftshoe ⊂ SUBSET OF */
{ 0x0bdc, 0x22a2 }, /* lefttack ⊢ RIGHT TACK */
{ 0x0bfc, 0x22a3 }, /* righttack ⊣ LEFT TACK */
{ 0x0cdf, 0x2017 }, /* hebrew_doublelowline ‗ DOUBLE LOW LINE */
{ 0x0ce0, 0x05d0 }, /* hebrew_aleph × HEBREW LETTER ALEF */
{ 0x0ce1, 0x05d1 }, /* hebrew_bet ב HEBREW LETTER BET */
{ 0x0ce2, 0x05d2 }, /* hebrew_gimel ×’ HEBREW LETTER GIMEL */
{ 0x0ce3, 0x05d3 }, /* hebrew_dalet ד HEBREW LETTER DALET */
{ 0x0ce4, 0x05d4 }, /* hebrew_he ×” HEBREW LETTER HE */
{ 0x0ce5, 0x05d5 }, /* hebrew_waw ו HEBREW LETTER VAV */
{ 0x0ce6, 0x05d6 }, /* hebrew_zain ×– HEBREW LETTER ZAYIN */
{ 0x0ce7, 0x05d7 }, /* hebrew_chet ×— HEBREW LETTER HET */
{ 0x0ce8, 0x05d8 }, /* hebrew_tet ט HEBREW LETTER TET */
{ 0x0ce9, 0x05d9 }, /* hebrew_yod ×™ HEBREW LETTER YOD */
{ 0x0cea, 0x05da }, /* hebrew_finalkaph ך HEBREW LETTER FINAL KAF */
{ 0x0ceb, 0x05db }, /* hebrew_kaph ×› HEBREW LETTER KAF */
{ 0x0cec, 0x05dc }, /* hebrew_lamed ל HEBREW LETTER LAMED */
{ 0x0ced, 0x05dd }, /* hebrew_finalmem × HEBREW LETTER FINAL MEM */
{ 0x0cee, 0x05de }, /* hebrew_mem מ HEBREW LETTER MEM */
{ 0x0cef, 0x05df }, /* hebrew_finalnun ן HEBREW LETTER FINAL NUN */
{ 0x0cf0, 0x05e0 }, /* hebrew_nun × HEBREW LETTER NUN */
{ 0x0cf1, 0x05e1 }, /* hebrew_samech ס HEBREW LETTER SAMEKH */
{ 0x0cf2, 0x05e2 }, /* hebrew_ayin ×¢ HEBREW LETTER AYIN */
{ 0x0cf3, 0x05e3 }, /* hebrew_finalpe ×£ HEBREW LETTER FINAL PE */
{ 0x0cf4, 0x05e4 }, /* hebrew_pe פ HEBREW LETTER PE */
{ 0x0cf5, 0x05e5 }, /* hebrew_finalzade ×¥ HEBREW LETTER FINAL TSADI */
{ 0x0cf6, 0x05e6 }, /* hebrew_zade צ HEBREW LETTER TSADI */
{ 0x0cf7, 0x05e7 }, /* hebrew_qoph ×§ HEBREW LETTER QOF */
{ 0x0cf8, 0x05e8 }, /* hebrew_resh ר HEBREW LETTER RESH */
{ 0x0cf9, 0x05e9 }, /* hebrew_shin ש HEBREW LETTER SHIN */
{ 0x0cfa, 0x05ea }, /* hebrew_taw ת HEBREW LETTER TAV */
{ 0x0da1, 0x0e01 }, /* Thai_kokai ภTHAI CHARACTER KO KAI */
{ 0x0da2, 0x0e02 }, /* Thai_khokhai ข THAI CHARACTER KHO KHAI */
{ 0x0da3, 0x0e03 }, /* Thai_khokhuat ฃ THAI CHARACTER KHO KHUAT */
{ 0x0da4, 0x0e04 }, /* Thai_khokhwai ค THAI CHARACTER KHO KHWAI */
{ 0x0da5, 0x0e05 }, /* Thai_khokhon ฅ THAI CHARACTER KHO KHON */
{ 0x0da6, 0x0e06 }, /* Thai_khorakhang ฆ THAI CHARACTER KHO RAKHANG */
{ 0x0da7, 0x0e07 }, /* Thai_ngongu ง THAI CHARACTER NGO NGU */
{ 0x0da8, 0x0e08 }, /* Thai_chochan จ THAI CHARACTER CHO CHAN */
{ 0x0da9, 0x0e09 }, /* Thai_choching ฉ THAI CHARACTER CHO CHING */
{ 0x0daa, 0x0e0a }, /* Thai_chochang ช THAI CHARACTER CHO CHANG */
{ 0x0dab, 0x0e0b }, /* Thai_soso ซ THAI CHARACTER SO SO */
{ 0x0dac, 0x0e0c }, /* Thai_chochoe ฌ THAI CHARACTER CHO CHOE */
{ 0x0dad, 0x0e0d }, /* Thai_yoying ภTHAI CHARACTER YO YING */
{ 0x0dae, 0x0e0e }, /* Thai_dochada ฎ THAI CHARACTER DO CHADA */
{ 0x0daf, 0x0e0f }, /* Thai_topatak ภTHAI CHARACTER TO PATAK */
{ 0x0db0, 0x0e10 }, /* Thai_thothan ภTHAI CHARACTER THO THAN */
{ 0x0db1, 0x0e11 }, /* Thai_thonangmontho ฑ THAI CHARACTER THO NANGMONTHO */
{ 0x0db2, 0x0e12 }, /* Thai_thophuthao ฒ THAI CHARACTER THO PHUTHAO */
{ 0x0db3, 0x0e13 }, /* Thai_nonen ณ THAI CHARACTER NO NEN */
{ 0x0db4, 0x0e14 }, /* Thai_dodek ด THAI CHARACTER DO DEK */
{ 0x0db5, 0x0e15 }, /* Thai_totao ต THAI CHARACTER TO TAO */
{ 0x0db6, 0x0e16 }, /* Thai_thothung ถ THAI CHARACTER THO THUNG */
{ 0x0db7, 0x0e17 }, /* Thai_thothahan ท THAI CHARACTER THO THAHAN */
{ 0x0db8, 0x0e18 }, /* Thai_thothong ธ THAI CHARACTER THO THONG */
{ 0x0db9, 0x0e19 }, /* Thai_nonu น THAI CHARACTER NO NU */
{ 0x0dba, 0x0e1a }, /* Thai_bobaimai บ THAI CHARACTER BO BAIMAI */
{ 0x0dbb, 0x0e1b }, /* Thai_popla ป THAI CHARACTER PO PLA */
{ 0x0dbc, 0x0e1c }, /* Thai_phophung ผ THAI CHARACTER PHO PHUNG */
{ 0x0dbd, 0x0e1d }, /* Thai_fofa ภTHAI CHARACTER FO FA */
{ 0x0dbe, 0x0e1e }, /* Thai_phophan พ THAI CHARACTER PHO PHAN */
{ 0x0dbf, 0x0e1f }, /* Thai_fofan ฟ THAI CHARACTER FO FAN */
{ 0x0dc0, 0x0e20 }, /* Thai_phosamphao ภTHAI CHARACTER PHO SAMPHAO */
{ 0x0dc1, 0x0e21 }, /* Thai_moma ม THAI CHARACTER MO MA */
{ 0x0dc2, 0x0e22 }, /* Thai_yoyak ย THAI CHARACTER YO YAK */
{ 0x0dc3, 0x0e23 }, /* Thai_rorua ร THAI CHARACTER RO RUA */
{ 0x0dc4, 0x0e24 }, /* Thai_ru ฤ THAI CHARACTER RU */
{ 0x0dc5, 0x0e25 }, /* Thai_loling ล THAI CHARACTER LO LING */
{ 0x0dc6, 0x0e26 }, /* Thai_lu ฦ THAI CHARACTER LU */
{ 0x0dc7, 0x0e27 }, /* Thai_wowaen ว THAI CHARACTER WO WAEN */
{ 0x0dc8, 0x0e28 }, /* Thai_sosala ศ THAI CHARACTER SO SALA */
{ 0x0dc9, 0x0e29 }, /* Thai_sorusi ษ THAI CHARACTER SO RUSI */
{ 0x0dca, 0x0e2a }, /* Thai_sosua ส THAI CHARACTER SO SUA */
{ 0x0dcb, 0x0e2b }, /* Thai_hohip ห THAI CHARACTER HO HIP */
{ 0x0dcc, 0x0e2c }, /* Thai_lochula ฬ THAI CHARACTER LO CHULA */
{ 0x0dcd, 0x0e2d }, /* Thai_oang ภTHAI CHARACTER O ANG */
{ 0x0dce, 0x0e2e }, /* Thai_honokhuk ฮ THAI CHARACTER HO NOKHUK */
{ 0x0dcf, 0x0e2f }, /* Thai_paiyannoi ฯ THAI CHARACTER PAIYANNOI */
{ 0x0dd0, 0x0e30 }, /* Thai_saraa ะ THAI CHARACTER SARA A */
{ 0x0dd1, 0x0e31 }, /* Thai_maihanakat ั THAI CHARACTER MAI HAN-AKAT */
{ 0x0dd2, 0x0e32 }, /* Thai_saraaa า THAI CHARACTER SARA AA */
{ 0x0dd3, 0x0e33 }, /* Thai_saraam ำ THAI CHARACTER SARA AM */
{ 0x0dd4, 0x0e34 }, /* Thai_sarai ิ THAI CHARACTER SARA I */
{ 0x0dd5, 0x0e35 }, /* Thai_saraii ี THAI CHARACTER SARA II */
{ 0x0dd6, 0x0e36 }, /* Thai_saraue ึ THAI CHARACTER SARA UE */
{ 0x0dd7, 0x0e37 }, /* Thai_sarauee ื THAI CHARACTER SARA UEE */
{ 0x0dd8, 0x0e38 }, /* Thai_sarau ุ THAI CHARACTER SARA U */
{ 0x0dd9, 0x0e39 }, /* Thai_sarauu ู THAI CHARACTER SARA UU */
{ 0x0dda, 0x0e3a }, /* Thai_phinthu ฺ THAI CHARACTER PHINTHU */
{ 0x0dde, 0x0e3e }, /* Thai_maihanakat_maitho ฾ ??? */
{ 0x0ddf, 0x0e3f }, /* Thai_baht ฿ THAI CURRENCY SYMBOL BAHT */
{ 0x0de0, 0x0e40 }, /* Thai_sarae เ THAI CHARACTER SARA E */
{ 0x0de1, 0x0e41 }, /* Thai_saraae ๠THAI CHARACTER SARA AE */
{ 0x0de2, 0x0e42 }, /* Thai_sarao โ THAI CHARACTER SARA O */
{ 0x0de3, 0x0e43 }, /* Thai_saraaimaimuan ใ THAI CHARACTER SARA AI MAIMUAN */
{ 0x0de4, 0x0e44 }, /* Thai_saraaimaimalai ไ THAI CHARACTER SARA AI MAIMALAI */
{ 0x0de5, 0x0e45 }, /* Thai_lakkhangyao ๅ THAI CHARACTER LAKKHANGYAO */
{ 0x0de6, 0x0e46 }, /* Thai_maiyamok ๆ THAI CHARACTER MAIYAMOK */
{ 0x0de7, 0x0e47 }, /* Thai_maitaikhu ็ THAI CHARACTER MAITAIKHU */
{ 0x0de8, 0x0e48 }, /* Thai_maiek ่ THAI CHARACTER MAI EK */
{ 0x0de9, 0x0e49 }, /* Thai_maitho ้ THAI CHARACTER MAI THO */
{ 0x0dea, 0x0e4a }, /* Thai_maitri ๊ THAI CHARACTER MAI TRI */
{ 0x0deb, 0x0e4b }, /* Thai_maichattawa ๋ THAI CHARACTER MAI CHATTAWA */
{ 0x0dec, 0x0e4c }, /* Thai_thanthakhat ์ THAI CHARACTER THANTHAKHAT */
{ 0x0ded, 0x0e4d }, /* Thai_nikhahit ๠THAI CHARACTER NIKHAHIT */
{ 0x0df0, 0x0e50 }, /* Thai_leksun ๠THAI DIGIT ZERO */
{ 0x0df1, 0x0e51 }, /* Thai_leknung ๑ THAI DIGIT ONE */
{ 0x0df2, 0x0e52 }, /* Thai_leksong ๒ THAI DIGIT TWO */
{ 0x0df3, 0x0e53 }, /* Thai_leksam ๓ THAI DIGIT THREE */
{ 0x0df4, 0x0e54 }, /* Thai_leksi ๔ THAI DIGIT FOUR */
{ 0x0df5, 0x0e55 }, /* Thai_lekha ๕ THAI DIGIT FIVE */
{ 0x0df6, 0x0e56 }, /* Thai_lekhok ๖ THAI DIGIT SIX */
{ 0x0df7, 0x0e57 }, /* Thai_lekchet ๗ THAI DIGIT SEVEN */
{ 0x0df8, 0x0e58 }, /* Thai_lekpaet ๘ THAI DIGIT EIGHT */
{ 0x0df9, 0x0e59 }, /* Thai_lekkao ๙ THAI DIGIT NINE */
{ 0x0ea1, 0x3131 }, /* Hangul_Kiyeog ㄱ HANGUL LETTER KIYEOK */
{ 0x0ea2, 0x3132 }, /* Hangul_SsangKiyeog ㄲ HANGUL LETTER SSANGKIYEOK */
{ 0x0ea3, 0x3133 }, /* Hangul_KiyeogSios ㄳ HANGUL LETTER KIYEOK-SIOS */
{ 0x0ea4, 0x3134 }, /* Hangul_Nieun ã„´ HANGUL LETTER NIEUN */
{ 0x0ea5, 0x3135 }, /* Hangul_NieunJieuj ㄵ HANGUL LETTER NIEUN-CIEUC */
{ 0x0ea6, 0x3136 }, /* Hangul_NieunHieuh ã„¶ HANGUL LETTER NIEUN-HIEUH */
{ 0x0ea7, 0x3137 }, /* Hangul_Dikeud ã„· HANGUL LETTER TIKEUT */
{ 0x0ea8, 0x3138 }, /* Hangul_SsangDikeud ㄸ HANGUL LETTER SSANGTIKEUT */
{ 0x0ea9, 0x3139 }, /* Hangul_Rieul ㄹ HANGUL LETTER RIEUL */
{ 0x0eaa, 0x313a }, /* Hangul_RieulKiyeog ㄺ HANGUL LETTER RIEUL-KIYEOK */
{ 0x0eab, 0x313b }, /* Hangul_RieulMieum ã„» HANGUL LETTER RIEUL-MIEUM */
{ 0x0eac, 0x313c }, /* Hangul_RieulPieub ㄼ HANGUL LETTER RIEUL-PIEUP */
{ 0x0ead, 0x313d }, /* Hangul_RieulSios ㄽ HANGUL LETTER RIEUL-SIOS */
{ 0x0eae, 0x313e }, /* Hangul_RieulTieut ㄾ HANGUL LETTER RIEUL-THIEUTH */
{ 0x0eaf, 0x313f }, /* Hangul_RieulPhieuf ã„¿ HANGUL LETTER RIEUL-PHIEUPH */
{ 0x0eb0, 0x3140 }, /* Hangul_RieulHieuh ã…€ HANGUL LETTER RIEUL-HIEUH */
{ 0x0eb1, 0x3141 }, /* Hangul_Mieum ã… HANGUL LETTER MIEUM */
{ 0x0eb2, 0x3142 }, /* Hangul_Pieub ã…‚ HANGUL LETTER PIEUP */
{ 0x0eb3, 0x3143 }, /* Hangul_SsangPieub ã…ƒ HANGUL LETTER SSANGPIEUP */
{ 0x0eb4, 0x3144 }, /* Hangul_PieubSios ã…„ HANGUL LETTER PIEUP-SIOS */
{ 0x0eb5, 0x3145 }, /* Hangul_Sios ã…… HANGUL LETTER SIOS */
{ 0x0eb6, 0x3146 }, /* Hangul_SsangSios ã…† HANGUL LETTER SSANGSIOS */
{ 0x0eb7, 0x3147 }, /* Hangul_Ieung ã…‡ HANGUL LETTER IEUNG */
{ 0x0eb8, 0x3148 }, /* Hangul_Jieuj ã…ˆ HANGUL LETTER CIEUC */
{ 0x0eb9, 0x3149 }, /* Hangul_SsangJieuj ã…‰ HANGUL LETTER SSANGCIEUC */
{ 0x0eba, 0x314a }, /* Hangul_Cieuc ã…Š HANGUL LETTER CHIEUCH */
{ 0x0ebb, 0x314b }, /* Hangul_Khieuq ã…‹ HANGUL LETTER KHIEUKH */
{ 0x0ebc, 0x314c }, /* Hangul_Tieut ㅌ HANGUL LETTER THIEUTH */
{ 0x0ebd, 0x314d }, /* Hangul_Phieuf ã… HANGUL LETTER PHIEUPH */
{ 0x0ebe, 0x314e }, /* Hangul_Hieuh ã…Ž HANGUL LETTER HIEUH */
{ 0x0ebf, 0x314f }, /* Hangul_A ã… HANGUL LETTER A */
{ 0x0ec0, 0x3150 }, /* Hangul_AE ã… HANGUL LETTER AE */
{ 0x0ec1, 0x3151 }, /* Hangul_YA ã…‘ HANGUL LETTER YA */
{ 0x0ec2, 0x3152 }, /* Hangul_YAE ã…’ HANGUL LETTER YAE */
{ 0x0ec3, 0x3153 }, /* Hangul_EO ã…“ HANGUL LETTER EO */
{ 0x0ec4, 0x3154 }, /* Hangul_E ã…” HANGUL LETTER E */
{ 0x0ec5, 0x3155 }, /* Hangul_YEO ã…• HANGUL LETTER YEO */
{ 0x0ec6, 0x3156 }, /* Hangul_YE ã…– HANGUL LETTER YE */
{ 0x0ec7, 0x3157 }, /* Hangul_O ã…— HANGUL LETTER O */
{ 0x0ec8, 0x3158 }, /* Hangul_WA ã…˜ HANGUL LETTER WA */
{ 0x0ec9, 0x3159 }, /* Hangul_WAE ã…™ HANGUL LETTER WAE */
{ 0x0eca, 0x315a }, /* Hangul_OE ã…š HANGUL LETTER OE */
{ 0x0ecb, 0x315b }, /* Hangul_YO ã…› HANGUL LETTER YO */
{ 0x0ecc, 0x315c }, /* Hangul_U ㅜ HANGUL LETTER U */
{ 0x0ecd, 0x315d }, /* Hangul_WEO ã… HANGUL LETTER WEO */
{ 0x0ece, 0x315e }, /* Hangul_WE ã…ž HANGUL LETTER WE */
{ 0x0ecf, 0x315f }, /* Hangul_WI ã…Ÿ HANGUL LETTER WI */
{ 0x0ed0, 0x3160 }, /* Hangul_YU ã… HANGUL LETTER YU */
{ 0x0ed1, 0x3161 }, /* Hangul_EU ã…¡ HANGUL LETTER EU */
{ 0x0ed2, 0x3162 }, /* Hangul_YI ã…¢ HANGUL LETTER YI */
{ 0x0ed3, 0x3163 }, /* Hangul_I ã…£ HANGUL LETTER I */
{ 0x0ed4, 0x11a8 }, /* Hangul_J_Kiyeog ᆨ HANGUL JONGSEONG KIYEOK */
{ 0x0ed5, 0x11a9 }, /* Hangul_J_SsangKiyeog ᆩ HANGUL JONGSEONG SSANGKIYEOK */
{ 0x0ed6, 0x11aa }, /* Hangul_J_KiyeogSios ᆪ HANGUL JONGSEONG KIYEOK-SIOS */
{ 0x0ed7, 0x11ab }, /* Hangul_J_Nieun ᆫ HANGUL JONGSEONG NIEUN */
{ 0x0ed8, 0x11ac }, /* Hangul_J_NieunJieuj ᆬ HANGUL JONGSEONG NIEUN-CIEUC */
{ 0x0ed9, 0x11ad }, /* Hangul_J_NieunHieuh ᆠHANGUL JONGSEONG NIEUN-HIEUH */
{ 0x0eda, 0x11ae }, /* Hangul_J_Dikeud ᆮ HANGUL JONGSEONG TIKEUT */
{ 0x0edb, 0x11af }, /* Hangul_J_Rieul ᆯ HANGUL JONGSEONG RIEUL */
{ 0x0edc, 0x11b0 }, /* Hangul_J_RieulKiyeog ᆰ HANGUL JONGSEONG RIEUL-KIYEOK */
{ 0x0edd, 0x11b1 }, /* Hangul_J_RieulMieum ᆱ HANGUL JONGSEONG RIEUL-MIEUM */
{ 0x0ede, 0x11b2 }, /* Hangul_J_RieulPieub ᆲ HANGUL JONGSEONG RIEUL-PIEUP */
{ 0x0edf, 0x11b3 }, /* Hangul_J_RieulSios ᆳ HANGUL JONGSEONG RIEUL-SIOS */
{ 0x0ee0, 0x11b4 }, /* Hangul_J_RieulTieut ᆴ HANGUL JONGSEONG RIEUL-THIEUTH */
{ 0x0ee1, 0x11b5 }, /* Hangul_J_RieulPhieuf ᆵ HANGUL JONGSEONG RIEUL-PHIEUPH */
{ 0x0ee2, 0x11b6 }, /* Hangul_J_RieulHieuh ᆶ HANGUL JONGSEONG RIEUL-HIEUH */
{ 0x0ee3, 0x11b7 }, /* Hangul_J_Mieum ᆷ HANGUL JONGSEONG MIEUM */
{ 0x0ee4, 0x11b8 }, /* Hangul_J_Pieub ᆸ HANGUL JONGSEONG PIEUP */
{ 0x0ee5, 0x11b9 }, /* Hangul_J_PieubSios ᆹ HANGUL JONGSEONG PIEUP-SIOS */
{ 0x0ee6, 0x11ba }, /* Hangul_J_Sios ᆺ HANGUL JONGSEONG SIOS */
{ 0x0ee7, 0x11bb }, /* Hangul_J_SsangSios ᆻ HANGUL JONGSEONG SSANGSIOS */
{ 0x0ee8, 0x11bc }, /* Hangul_J_Ieung ᆼ HANGUL JONGSEONG IEUNG */
{ 0x0ee9, 0x11bd }, /* Hangul_J_Jieuj ᆽ HANGUL JONGSEONG CIEUC */
{ 0x0eea, 0x11be }, /* Hangul_J_Cieuc ᆾ HANGUL JONGSEONG CHIEUCH */
{ 0x0eeb, 0x11bf }, /* Hangul_J_Khieuq ᆿ HANGUL JONGSEONG KHIEUKH */
{ 0x0eec, 0x11c0 }, /* Hangul_J_Tieut ᇀ HANGUL JONGSEONG THIEUTH */
{ 0x0eed, 0x11c1 }, /* Hangul_J_Phieuf ᇠHANGUL JONGSEONG PHIEUPH */
{ 0x0eee, 0x11c2 }, /* Hangul_J_Hieuh ᇂ HANGUL JONGSEONG HIEUH */
{ 0x0eef, 0x316d }, /* Hangul_RieulYeorinHieuh ã… HANGUL LETTER RIEUL-YEORINHIEUH */
{ 0x0ef0, 0x3171 }, /* Hangul_SunkyeongeumMieum ã…± HANGUL LETTER KAPYEOUNMIEUM */
{ 0x0ef1, 0x3178 }, /* Hangul_SunkyeongeumPieub ã…¸ HANGUL LETTER KAPYEOUNPIEUP */
{ 0x0ef2, 0x317f }, /* Hangul_PanSios ã…¿ HANGUL LETTER PANSIOS */
{ 0x0ef3, 0x3181 }, /* Hangul_KkogjiDalrinIeung ㆠHANGUL LETTER YESIEUNG */
{ 0x0ef4, 0x3184 }, /* Hangul_SunkyeongeumPhieuf ㆄ HANGUL LETTER KAPYEOUNPHIEUPH */
{ 0x0ef5, 0x3186 }, /* Hangul_YeorinHieuh ㆆ HANGUL LETTER YEORINHIEUH */
{ 0x0ef6, 0x318d }, /* Hangul_AraeA ㆠHANGUL LETTER ARAEA */
{ 0x0ef7, 0x318e }, /* Hangul_AraeAE ㆎ HANGUL LETTER ARAEAE */
{ 0x0ef8, 0x11eb }, /* Hangul_J_PanSios ᇫ HANGUL JONGSEONG PANSIOS */
{ 0x0ef9, 0x11f0 }, /* Hangul_J_KkogjiDalrinIeung ᇰ HANGUL JONGSEONG YESIEUNG */
{ 0x0efa, 0x11f9 }, /* Hangul_J_YeorinHieuh ᇹ HANGUL JONGSEONG YEORINHIEUH */
{ 0x0eff, 0x20a9 }, /* Korean_Won â‚© WON SIGN */
{ 0x13a4, 0x20ac }, /* Euro € EURO SIGN */
{ 0x13bc, 0x0152 }, /* OE Å’ LATIN CAPITAL LIGATURE OE */
{ 0x13bd, 0x0153 }, /* oe Å“ LATIN SMALL LIGATURE OE */
{ 0x13be, 0x0178 }, /* Ydiaeresis Ÿ LATIN CAPITAL LETTER Y WITH DIAERESIS */
{ 0x20a0, 0x20a0 }, /* EcuSign â‚ EURO-CURRENCY SIGN */
{ 0x20a1, 0x20a1 }, /* ColonSign â‚¡ COLON SIGN */
{ 0x20a2, 0x20a2 }, /* CruzeiroSign â‚¢ CRUZEIRO SIGN */
{ 0x20a3, 0x20a3 }, /* FFrancSign â‚£ FRENCH FRANC SIGN */
{ 0x20a4, 0x20a4 }, /* LiraSign ₤ LIRA SIGN */
{ 0x20a5, 0x20a5 }, /* MillSign â‚¥ MILL SIGN */
{ 0x20a6, 0x20a6 }, /* NairaSign ₦ NAIRA SIGN */
{ 0x20a7, 0x20a7 }, /* PesetaSign â‚§ PESETA SIGN */
{ 0x20a8, 0x20a8 }, /* RupeeSign ₨ RUPEE SIGN */
{ 0x20a9, 0x20a9 }, /* WonSign â‚© WON SIGN */
{ 0x20aa, 0x20aa }, /* NewSheqelSign ₪ NEW SHEQEL SIGN */
{ 0x20ab, 0x20ab }, /* DongSign â‚« DONG SIGN */
{ 0x20ac, 0x20ac }, /* EuroSign € EURO SIGN */
};
VISIBLE
long keysym2ucs(KeySym keysym)
{
int min = 0;
int max = sizeof(keysymtab) / sizeof(struct codepair) - 1;
int mid;
/* first check for Latin-1 characters (1:1 mapping) */
if ((keysym >= 0x0020 && keysym <= 0x007e) ||
(keysym >= 0x00a0 && keysym <= 0x00ff))
return keysym;
/* also check for directly encoded 24-bit UCS characters */
if ((keysym & 0xff000000) == 0x01000000)
return keysym & 0x00ffffff;
/* binary search in table */
while (max >= min) {
mid = (min + max) / 2;
if (keysymtab[mid].keysym < keysym)
min = mid + 1;
else if (keysymtab[mid].keysym > keysym)
max = mid - 1;
else {
/* found it */
return keysymtab[mid].ucs;
}
}
/* no matching Unicode value found */
return -1;
}
xterm-297/data.c 0000644 0001751 0000144 00000007200 11526034033 012324 0 ustar tom users /* $XTermId: data.c,v 1.92 2011/02/13 19:59:23 tom Exp $ */
/*
* Copyright 2002-2009,2011 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
*
* All Rights Reserved
*
* Permission to use, copy, modify, and distribute this software and its
* documentation for any purpose and without fee is hereby granted,
* provided that the above copyright notice appear in all copies and that
* both that copyright notice and this permission notice appear in
* supporting documentation, and that the name of Digital Equipment
* Corporation not be used in advertising or publicity pertaining to
* distribution of the software without specific, written prior permission.
*
*
* DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
* ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
* DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
* ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
* WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
* ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
* SOFTWARE.
*/
#include
Widget toplevel; /* top-most widget in xterm */
#if OPT_TEK4014
Char *Tpushb;
Char *Tpushback;
TekLink *tekRefreshList;
TekWidget tekWidget;
Widget tekshellwidget;
int T_lastx = -1;
int T_lasty = -1;
int Ttoggled = 0;
jmp_buf Tekend;
#endif
char *ProgramName;
Arg ourTopLevelShellArgs[] =
{
{XtNallowShellResize, (XtArgVal) True},
{XtNinput, (XtArgVal) True},
};
Cardinal number_ourTopLevelShellArgs = 2;
Atom wm_delete_window; /* for ICCCM delete window */
XTERM_RESOURCE resource;
PtyData *VTbuffer;
jmp_buf VTend;
#ifdef DEBUG
int debug = 0; /* true causes error messages to be displayed */
#endif /* DEBUG */
XtAppContext app_con;
XtermWidget term; /* master data structure for client */
int hold_screen;
SIG_ATOMIC_T need_cleanup = False;
int am_slave = -1; /* set to file-descriptor if we're a slave process */
int max_plus1;
PtySelect Select_mask;
PtySelect X_mask;
PtySelect pty_mask;
char *ptydev;
char *ttydev;
#if HANDLE_STRUCT_NOTIFY
int mapstate = -1;
#endif /* HANDLE_STRUCT_NOTIFY */
#if OPT_SESSION_MGT
int ice_fd = -1;
#endif
#ifdef USE_IGNORE_RC
int ignore_unused;
#endif
xterm-297/uxterm.man 0000644 0001751 0000144 00000006215 12070430227 013275 0 ustar tom users .\" $XTermId: uxterm.man,v 1.6 2013/01/01 00:40:55 tom Exp $
.\"
.\" Copyright 2001, 2004 Branden Robinson
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a
.\" copy of this software and associated documentation files (the "Software"),
.\" to deal in the Software without restriction, including without limitation
.\" the rights to use, copy, modify, merge, publish, distribute, sublicense,
.\" and/or sell copies of the Software, and to permit persons to whom the
.\" Software is furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
.\" SOFTWARE IN THE PUBLIC INTEREST, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR
.\" OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
.\" ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
.\" DEALINGS IN THE SOFTWARE.
.\"
.ds N Uxterm
.ds n uxterm
.\" Escape single quotes in literal strings from groff's Unicode transform.
.ie \n(.g .ds AQ \(aq
.el .ds AQ '
.ie \n(.g .ds `` \(lq
.el .ds `` ``
.ie \n(.g .ds '' \(rq
.el .ds '' ''
.\"
.TH UXTERM 1 "__app_date__" "__app_version__" "X Window System"
.SH NAME
uxterm \- X terminal emulator for Unicode (UTF-8) environments
.SH SYNOPSIS
.B \*n
[
.I xterm-options
]
.SH DESCRIPTION
.B \*n
is a wrapper around the
.BR xterm(1)
program that invokes the latter program with the \*(``U__default_class__\*('' X resource
class set.
All arguments to
.B \*n
are passed to
.B xterm
without processing; the
.B \-class
and
.B \-u8
options should not be specified because they are used by the wrapper.
See the
.B xterm
manual page for more information on
.IR xterm-options .
.PP
The environment's locale settings (see \*(``ENVIRONMENT\*('' below) are
used to discern the locale's character set.
If no current locale can be determined, the locale \*(``en_US\*('' (the
English language as used in the territory of the United States) is assumed.
The
.BR locale(1)
utility is used to determine whether the system supports the selected
locale.
If it does not,
.B \*n
will exit with an error and report the output of
.BR locale .
.PP
.B Note: \*n
may produce unexpected results if the current locale is set to one in which
the UTF-8 character encoding is not supported, or if fonts using the ISO
10646-1 character set are not available.
In the Debian system, the \*(``xfonts\-base\*('' package provides the fonts
that
.B \*n
uses by default.
To change the fonts
.B \*n
uses, edit the
.I __apploaddir__/U__default_class__
file.
.PP
A similar wrapper,
.BR koi8rxterm(1),
is available for KOI8-R environments.
.SH ENVIRONMENT
.TP
.B LC_ALL\fR, \fBLC_CTYPE\fR, \fBLANG
The values of these variables are checked, in order, to determine the
character set used by the current locale.
.SH AUTHOR
Thomas Dickey
.SH "SEE ALSO"
.BR locale(1),
.BR locale(7),
.BR koi8rxterm(1),
.BR xterm(1)
xterm-297/vttests/ 0000755 0001751 0000144 00000000000 12041230766 012770 5 ustar tom users xterm-297/vttests/dynamic.sh 0000755 0001751 0000144 00000005227 11671154202 014757 0 ustar tom users #!/bin/sh
# $XTermId: dynamic.sh,v 1.17 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Demonstrate the use of dynamic colors by setting the background successively
# to different values.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
LIST="00 30 80 d0 ff"
exec /dev/tty
read original
stty $old
original=${original}${SUF}
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
while true
do
for R in $LIST
do
for G in $LIST
do
for B in $LIST
do
$CMD $OPT "${ESC}]11;rgb:$R/$G/$B${SUF}" >/dev/tty
sleep 1
done
done
done
done
xterm-297/vttests/256colors.pl 0000755 0001751 0000144 00000003757 10507312317 015100 0 ustar tom users #!/usr/bin/perl
# $XTermId: 256colors.pl,v 1.4 2006/09/29 21:49:03 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999,2006 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
#
# This uses 33 print-lines on an 80-column display. Printing the numbers in
# hexadecimal would make it compact enough for 24x80, but less readable.
for ($bg = 0; $bg < 256; $bg++) {
# print "\x1b[9;1H\x1b[2J";
for ($fg = 0; $fg < 256; $fg++) {
print "\x1b[48;5;${bg}m\x1b[38;5;${fg}m";
printf "%03.3d/%03.3d ", $fg, $bg;
}
print "\n";
sleep 1;
}
xterm-297/vttests/query-color.pl 0000755 0001751 0000144 00000010305 12041230766 015610 0 ustar tom users #!/usr/bin/perl -w
# $XTermId: query-color.pl,v 1.3 2012/10/22 11:45:58 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Test the color-query features of xterm using OSC 4.
# TODO: extend to the OSC 5 colors
# TODO: show result in #rrggbb format.
use strict;
use Getopt::Std;
use IO::Handle;
our ( $opt_s );
&getopts('s') || die(
"Usage: $0 [options] [color1[-color2]]\n
Options:\n
-s use ^G rather than ST
"
);
our $ST = $opt_s ? "\007" : "\x1b\\";
sub no_reply($) {
open TTY, "+;
close TTY;
system "stty $old";
if ( defined $reply ) {
die("^C received\n") if ( "$reply" eq "\003" );
}
return $reply;
}
sub visible($) {
my $reply = $_[0];
my $n;
my $result = "";
for ( $n = 0 ; $n < length($reply) ; ) {
my $c = substr( $reply, $n, 1 );
if ( $c =~ /[[:print:]]/ ) {
$result .= $c;
}
else {
my $k = ord substr( $reply, $n, 1 );
if ( ord $k == 0x1b ) {
$result .= "\\E";
}
elsif ( $k == 0x7f ) {
$result .= "^?";
}
elsif ( $k == 32 ) {
$result .= "\\s";
}
elsif ( $k < 32 ) {
$result .= sprintf( "^%c", $k + 64 );
}
elsif ( $k > 128 ) {
$result .= sprintf( "\\%03o", $k );
}
else {
$result .= chr($k);
}
}
$n += 1;
}
return $result;
}
sub query_color($) {
my $param = $_[0];
my $reply;
my $n;
my $st = $opt_s ? qr/\007/ : qr/\x1b\\/;
my $op = 4;
my $osc = qr/\x1b]$op/;
my $match = qr/${osc}.*${st}/;
$reply = get_reply( "\x1b]$op;" . $param . ";?" . $ST );
printf "query{%s}%*s", &visible($param), 3 - length($param), " ";
if ( defined $reply ) {
printf "%2d ", length($reply);
if ( $reply =~ /${match}/ ) {
$reply =~ s/^${osc}//;
$reply =~ s/^;//;
$reply =~ s/${st}$//;
}
else {
printf "? ";
}
printf "{%s}", visible($reply);
}
printf "\n";
}
sub query_colors($$) {
my $lo = $_[0];
my $hi = $_[1];
my $n;
for ( $n = $lo ; $n <= $hi ; ++$n ) {
query_color($n);
}
}
if ( $#ARGV >= 0 ) {
while ( $#ARGV >= 0 ) {
if ( $ARGV[0] =~ /-/ ) {
my @args = split /-/, $ARGV[0];
&query_colors ( $args[0], $args[1] );
} else {
&query_colors ( $ARGV[0], $ARGV[0] );
}
shift @ARGV;
}
} else {
&query_colors(0,7);
}
xterm-297/vttests/fonts.sh 0000755 0001751 0000144 00000005221 11671154202 014456 0 ustar tom users #!/bin/sh
# $XTermId: fonts.sh,v 1.11 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Demonstrate the use of dynamic colors by setting the background successively
# to different values.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
exec /dev/tty
read original
stty $old
original="${original}${SUF}"
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
F=1
D=1
T=6
while true
do
$CMD $OPT "${ESC}]50;#$F${SUF}" >/dev/tty
#sleep 1
if test .$D = .1 ; then
test $F = $T && D=-1
else
test $F = 1 && D=1
fi
F=`expr $F + $D`
done
xterm-297/vttests/tcapquery.pl 0000755 0001751 0000144 00000020070 11320334122 015332 0 ustar tom users #!/usr/bin/perl -w
# $XTermId: tcapquery.pl,v 1.18 2010/01/04 09:43:46 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2004-2008,2010 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Test the tcap-query option of xterm.
use strict;
use Getopt::Std;
use IO::Handle;
our ($opt_a, $opt_b, $opt_c, $opt_e, $opt_f, $opt_i, $opt_k, $opt_m, $opt_t, $opt_x, $opt_X);
&getopts('abcefikmt:x:X') || die("Usage: $0 [options]\n
Options:\n
-a (same as -c -e -f -k -m)
-b use both terminfo and termcap (default is termcap)
-c cursor-keys
-e editing keypad-keys
-f function-keys
-i use terminfo rather than termcap names
-k numeric keypad-keys
-m miscellaneous (none of -c, -e, -f, -k)
-t NAME use given NAME for \$TERM, set that in xterm's tcap keyboard
-x KEY extended cursor/editing key (terminfo only)
-X test all extended cursor- and/or editing-keys (terminfo)
");
if ( not ( defined($opt_c)
or defined($opt_e)
or defined($opt_f)
or defined($opt_k)
or defined($opt_m)
or defined($opt_x) ) ) {
$opt_a=1;
}
sub no_reply($) {
open TTY, "+;
close TTY;
system "stty $old";
if ( defined $reply ) {
die("^C received\n") if ( "$reply" eq "\003" );
}
return $reply;
}
sub hexified($) {
my $value = $_[0];
my $result = "";
my $n;
for ( $n = 0; $n < length($value); ++$n) {
$result .= sprintf("%02X", ord substr($value,$n,1));
}
return $result;
}
sub modify_tcap($) {
my $name = $_[0];
my $param = hexified($name);
no_reply("\x1bP+p" . $param . "\x1b\\");
}
sub query_tcap($$) {
my $tcap = $_[0];
my $tinfo = $_[1];
my $param1 = hexified($tcap);
my $param2 = hexified($tinfo);
my $reply;
# uncomment one of the following lines
if ( defined($opt_b) ) {
$reply=get_reply("\x1bP+q" . $param1 . ";" . $param2 . "\x1b\\");
} elsif ( defined($opt_i) ) {
$reply=get_reply("\x1bP+q" . $param2 . "\x1b\\");
} else {
$reply=get_reply("\x1bP+q" . $param1 . "\x1b\\");
}
return unless defined $reply;
if ( $reply =~ /\x1bP1\+r[[:xdigit:]]+=[[:xdigit:]]*.*/ ) {
my $value = $reply;
my $n;
$value =~ s/^\x1bP1\+r//;
$value =~ s/\x1b\\//;
my $result = "";
for ( $n = 0; $n < length($value); ) {
my $c = substr($value,$n,1);
# handle semicolon and equals
if ( $c =~ /[[:punct:]]/ ) {
$n += 1;
$result .= $c;
} else {
# handle hex-data
my $k = hex substr($value,$n,2);
if ( $k == 0x1b ) {
$result .= "\\E";
} elsif ( $k == 0x7f ) {
$result .= "^?";
} elsif ( $k == 32 ) {
$result .= "\\s";
} elsif ( $k < 32 ) {
$result .= sprintf("^%c", $k + 64);
} elsif ( $k > 128 ) {
$result .= sprintf("\\%03o", $k);
} else {
$result .= chr($k);
}
$n += 2;
}
}
printf "%s\n", $result;
}
}
# extended-keys are a feature of ncurses 5.0 and later
sub query_extended($) {
my $name = $_[0];
my $n;
$name = "k" . $name if ( $name !~ /^k/ );
for ( $n = 2; $n <= 7; ++$n) {
my $test = $name;
$test = $test . $n if ( $n > 2 );
query_tcap( $name, $test );
}
}
query_tcap( "TN", "name");
if ( defined($opt_t) ) {
printf "Setting TERM=%s\n", $opt_t;
modify_tcap($opt_t);
}
# See xtermcapKeycode()
if ( defined($opt_a) || defined($opt_c) ) {
query_tcap( "ku", "kcuu1");
query_tcap( "kd", "kcud1");
query_tcap( "kr", "kcuf1");
query_tcap( "kl", "kcub1");
query_tcap( "kF", "kind");
query_tcap( "kR", "kri");
query_tcap( "%i", "kRIT");
query_tcap( "#4", "kLFT");
}
if ( defined($opt_a) || defined($opt_e) ) {
query_tcap( "kD", "kdch1");
query_tcap( "kI", "kich1");
query_tcap( "kh", "khome");
query_tcap( "\@7", "kend");
query_tcap( "#2", "kHOM");
query_tcap( "*7", "kEND");
query_tcap( "*6", "kslt");
query_tcap( "#6", "kSLT");
query_tcap( "\@0", "kfnd");
query_tcap( "*0", "kFND");
query_tcap( "kN", "knp");
query_tcap( "kP", "kpp");
query_tcap( "%c", "kNXT");
query_tcap( "%e", "kPRV");
}
if ( defined($opt_a) || defined($opt_f) ) {
query_tcap( "k1", "kf1");
query_tcap( "k2", "kf2");
query_tcap( "k3", "kf3");
query_tcap( "k4", "kf4");
query_tcap( "k5", "kf5");
query_tcap( "k6", "kf6");
query_tcap( "k7", "kf7");
query_tcap( "k8", "kf8");
query_tcap( "k9", "kf9");
query_tcap( "k;", "kf10");
query_tcap( "F1", "kf11");
query_tcap( "F2", "kf12");
query_tcap( "F3", "kf13");
query_tcap( "F4", "kf14");
query_tcap( "F5", "kf15");
query_tcap( "F6", "kf16");
query_tcap( "F7", "kf17");
query_tcap( "F8", "kf18");
query_tcap( "F9", "kf19");
query_tcap( "FA", "kf20");
query_tcap( "FB", "kf21");
query_tcap( "FC", "kf22");
query_tcap( "FD", "kf23");
query_tcap( "FE", "kf24");
query_tcap( "FF", "kf25");
query_tcap( "FG", "kf26");
query_tcap( "FH", "kf27");
query_tcap( "FI", "kf28");
query_tcap( "FJ", "kf29");
query_tcap( "FK", "kf30");
query_tcap( "FL", "kf31");
query_tcap( "FM", "kf32");
query_tcap( "FN", "kf33");
query_tcap( "FO", "kf34");
query_tcap( "FP", "kf35");
query_tcap( "FQ", "kf36");
query_tcap( "FR", "kf37");
query_tcap( "FS", "kf38");
query_tcap( "FT", "kf39");
query_tcap( "FU", "kf40");
query_tcap( "FV", "kf41");
query_tcap( "FW", "kf42");
query_tcap( "FX", "kf43");
query_tcap( "FY", "kf44");
query_tcap( "FZ", "kf45");
query_tcap( "Fa", "kf46");
query_tcap( "Fb", "kf47");
query_tcap( "Fc", "kf48");
query_tcap( "Fd", "kf49");
query_tcap( "Fe", "kf50");
query_tcap( "Ff", "kf51");
query_tcap( "Fg", "kf52");
query_tcap( "Fh", "kf53");
query_tcap( "Fi", "kf54");
query_tcap( "Fj", "kf55");
query_tcap( "Fk", "kf56");
query_tcap( "Fl", "kf57");
query_tcap( "Fm", "kf58");
query_tcap( "Fn", "kf59");
query_tcap( "Fo", "kf60");
query_tcap( "Fp", "kf61");
query_tcap( "Fq", "kf62");
query_tcap( "Fr", "kf63");
}
if ( defined($opt_a) || defined($opt_k) ) {
query_tcap( "K1", "ka1");
query_tcap( "K3", "ka3");
query_tcap( "K4", "kc1");
query_tcap( "K5", "kc3");
}
if ( defined($opt_a) || defined($opt_m) ) {
query_tcap( "kB", "kcbt");
query_tcap( "kC", "kclr");
query_tcap( "&8", "kund");
query_tcap( "kb", "kbs");
query_tcap( "%1", "khlp");
query_tcap( "#1", "kHLP");
query_tcap( "Co", "colors");
}
if ( defined ($opt_x) ) {
query_extended($opt_x);
}
if ( defined ($opt_X) ) {
if ( defined($opt_c) ) {
query_extended("DN");
query_extended("UP");
query_extended("LFT");
query_extended("RIT");
}
if ( defined($opt_e) ) {
query_extended("DC");
query_extended("END");
query_extended("HOM");
query_extended("IC");
query_extended("NXT");
query_extended("PRV");
}
}
xterm-297/vttests/title.sh 0000755 0001751 0000144 00000005442 11671154202 014453 0 ustar tom users #!/bin/sh
# $XTermId: title.sh,v 1.18 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Obtain the current title of the window, set up a simple clock which runs
# until this script is interrupted, then restore the title.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
exec /dev/tty
read original
stty $old
# We actually get this terminated by an backslash, but the backslash
# is lost. We may lose doublequote characters when restoring the title,
# depending on the shell.
original=`echo "$original" |sed -e 's/^...//' -e 's/.$//'`
original=${ESC}]2\;"${original}"${SUF}
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
while true
do
sleep 1
$CMD $OPT "${ESC}]2;`date`" >/dev/tty
done
xterm-297/vttests/256colors2.pl 0000755 0001751 0000144 00000011641 12026453040 015146 0 ustar tom users #!/usr/bin/perl
# $XTermId: 256colors2.pl,v 1.15 2012/09/19 23:32:48 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2009,2012 by Thomas E. Dickey
# Copyright 2002 by Steve Wall
# Copyright 1999 by Todd Larason
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
#
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
use strict;
use Getopt::Std;
use Encode 'encode_utf8';
our ($opt_8, $opt_c, $opt_d, $opt_h, $opt_q, $opt_r, $opt_u);
&getopts('8cdhqru') || die("Usage: $0 [options]");
die("Usage: $0 [options]\n
Options:
-8 use 8-bit controls
-c use colons for separating parameter values in SGR 38/48
-d use rgb values rather than palette index
-h display this message
-q quieter output by merging all palette initialization
-r display the reverse of the usual palette
-u use UTF-8 when emitting 8-bit controls
") if ( $opt_h);
our $cube = 6;
our (@steps);
our ($red, $green, $blue);
our ($gray, $level, $color);
our ($csi, $osc, $sep, $st);
our @rgb;
sub map_cube($) {
my $value = $_[0];
$value = (5 - $value) if defined($opt_r);
return $value;
}
sub map_gray($) {
my $value = $_[0];
$value = (23 - $value) if defined($opt_r);
return $value;
}
sub define_color($$$$) {
my $index = $_[0];
my $r = $_[1];
my $g = $_[2];
my $b = $_[3];
printf("%s4", $osc) unless ($opt_q);
printf(";%d;rgb:%2.2x/%2.2x/%2.2x", $index, $r, $g, $b);
printf("%s", $st) unless ($opt_q);
$rgb[$index] = sprintf "%d%s%d%s%d", $r, $sep, $g, $sep, $b;
}
sub select_color($) {
my $index = $_[0];
if ( $opt_d and defined($rgb[$index]) ) {
printf "%s48;2%s%sm ", $csi, $sep, $rgb[$index];
} else {
printf "%s48;5%s%sm ", $csi, $sep, $index;
}
}
if ( $opt_8 ) {
$csi = "\x9b";
$osc = "\x9d";
$st = "\x9c";
} else {
$csi = "\x1b[";
$osc = "\x1b]";
$st = "\x1b\\";
}
if ( $opt_c ) {
$sep = ":";
} else {
$sep = ";";
}
if ( $opt_8 and $opt_u ) {
my $lc_ctype=`locale 2>/dev/null | fgrep LC_CTYPE | sed -e 's/^.*=//'`;
if ( $lc_ctype =~ /utf.?8/i ) {
binmode(STDOUT, ":utf8");
}
}
@steps=(0,95,135,175,215,255);
# colors 16-231 are a 6x6x6 color cube
printf("%s4", $osc) if ($opt_q);
for ($red = 0; $red < $cube; $red++) {
for ($green = 0; $green < $cube; $green++) {
for ($blue = 0; $blue < $cube; $blue++) {
&define_color(
16 + (map_cube($red) * $cube * $cube) + (map_cube($green) * $cube) + map_cube($blue),
int (@steps[$red]),
int (@steps[$green]),
int (@steps[$blue]));
}
}
}
# colors 232-255 are a grayscale ramp, intentionally leaving out
# black and white
for ($gray = 0; $gray < 24; $gray++) {
$level = (map_gray($gray) * 10) + 8;
&define_color(232 + $gray, $level, $level, $level);
}
printf("%s", $st) if ($opt_q);
# display the colors
# first the system ones:
print "System colors:\n";
for ($color = 0; $color < 8; $color++) {
&select_color($color);
}
printf "%s0m\n", $csi;
for ($color = 8; $color < 16; $color++) {
&select_color($color);
}
printf "%s0m\n\n", $csi;
# now the color cube
print "Color cube, ${cube}x${cube}x${cube}:\n";
for ($green = 0; $green < $cube; $green++) {
for ($red = 0; $red < $cube; $red++) {
for ($blue = 0; $blue < $cube; $blue++) {
$color = 16 + ($red * $cube * $cube) + ($green * $cube) + $blue;
&select_color($color);
}
printf "%s0m ", $csi;
}
print "\n";
}
# now the grayscale ramp
print "Grayscale ramp:\n";
for ($color = 232; $color < 256; $color++) {
&select_color($color);
}
printf "%s0m\n", $csi;
xterm-297/vttests/doublechars.sh 0000755 0001751 0000144 00000006545 11671154202 015632 0 ustar tom users #!/bin/sh
# $XTermId: doublechars.sh,v 1.17 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Illustrate the use of double-size characters by drawing successive lines in
# the commonly used video attributes.
#
# Use the -w option to force the output to wrap. It will look ugly, because
# the double-high lines will be split.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
SAVE=yes
WRAP=no
if test $# != 0 ; then
while test $# != 0
do
case $1 in
-n) SAVE=no ;;
-w) WRAP=yes ;;
esac
shift
done
fi
if test $SAVE = yes ; then
exec /dev/tty
IFS=';' read junk high wide
stty $old
wide=`echo $wide|sed -e 's/t.*//'`
original=${ESC}[8\;${high}\;${wide}t${SUF}
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
fi
if test $WRAP = yes ; then
# turn on wrapping and force the screen to 80 columns
$CMD $OPT "${ESC}[?7h" >/dev/tty
$CMD $OPT "${ESC}[?40l" >/dev/tty
else
# force the screen to 132 columns
$CMD $OPT "${ESC}[?40h" >/dev/tty
$CMD $OPT "${ESC}[?3h" >/dev/tty
fi
for SGR in 0 1 4 5 7
do
$CMD $OPT "${ESC}[0;${SGR}m" >/dev/tty
for DBL in 5 3 4 6 5
do
$CMD $OPT "${ESC}#${DBL}" >/dev/tty
echo "The quick brown fox jumps over the lazy dog" >/dev/tty
done
echo
done
$CMD $OPT "${ESC}[0m" >/dev/tty
xterm-297/vttests/dynamic2.sh 0000755 0001751 0000144 00000006437 11671154202 015045 0 ustar tom users #!/bin/sh
# $XTermId: dynamic2.sh,v 1.3 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2006,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Demonstrate the use of dynamic colors by setting each dynamic color
# successively to different values.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
LIST="00 30 80 d0 ff"
FULL="10 11 12 13 14 15 16 17 18"
echo "reading current color settings"
exec /dev/tty
read reply
eval original$N='${reply}${SUF}'
original=${original}${reply}${SUF}
done
stty $old
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
while true
do
for N in $FULL
do
case $N in
10) echo "coloring text foreground";;
11) echo "coloring text background";;
12) echo "coloring text cursor";;
13) echo "coloring mouse foreground";;
14) echo "coloring mouse background";;
15) echo "coloring tektronix foreground";;
16) echo "coloring tektronix background";;
17) echo "coloring highlight background";;
18) echo "coloring tektronix cursor";;
esac
for R in $LIST
do
for G in $LIST
do
for B in $LIST
do
$CMD $OPT "${ESC}]$N;rgb:$R/$G/$B${SUF}" >/dev/tty
sleep 1
done
done
done
eval 'restore=$'original$N
$CMD $OPT "$restore" >/dev/tty
sleep 1
done
done
xterm-297/vttests/88colors2.pl 0000755 0001751 0000144 00000011737 12026452754 015112 0 ustar tom users #!/usr/bin/perl
# $XTermId: 88colors2.pl,v 1.11 2012/09/19 23:31:56 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2009,2012 by Thomas E. Dickey
# Copyright 1999 by Steve Wall
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
#
# Adapted from 256colors2.pl
# use the resources for colors 0-15 - usually more-or-less a
# reproduction of the standard ANSI colors, but possibly more
# pleasing shades
use strict;
use Getopt::Std;
use Encode 'encode_utf8';
our ($opt_8, $opt_c, $opt_d, $opt_h, $opt_q, $opt_r, $opt_u);
&getopts('8cdhqru') || die("Usage: $0 [options]");
die("Usage: $0 [options]\n
Options:
-8 use 8-bit controls
-c use colons for separating parameter values in SGR 38/48
-d use rgb values rather than palette index
-h display this message
-q quieter output by merging all palette initialization
-r display the reverse of the usual palette
-u use UTF-8 when emitting 8-bit controls
") if ( $opt_h);
our $cube = 4;
our (@steps);
our ($red, $green, $blue);
our ($gray, $level, $color);
our ($csi, $osc, $sep, $st);
our @rgb;
sub map_cube($) {
my $value = $_[0];
$value = (3 - $value) if defined($opt_r);
return $value;
}
sub map_gray($) {
my $value = $_[0];
$value = (7 - $value) if defined($opt_r);
return $value;
}
sub define_color($$$$) {
my $index = $_[0];
my $r = $_[1];
my $g = $_[2];
my $b = $_[3];
printf("%s4", $osc) unless ($opt_q);
printf(";%d;rgb:%2.2x/%2.2x/%2.2x", $index, $r, $g, $b);
printf("%s", $st) unless ($opt_q);
$rgb[$index] = sprintf "%d%s%d%s%d", $r, $sep, $g, $sep, $b;
}
sub select_color($) {
my $index = $_[0];
if ( $opt_d and defined($rgb[$index]) ) {
printf "%s48;2%s%sm ", $csi, $sep, $rgb[$index];
} else {
printf "%s48;5%s%sm ", $csi, $sep, $index;
}
}
if ( $opt_8 ) {
$csi = "\x9b";
$osc = "\x9d";
$st = "\x9c";
} else {
$csi = "\x1b[";
$osc = "\x1b]";
$st = "\x1b\\";
}
if ( $opt_c ) {
$sep = ":";
} else {
$sep = ";";
}
if ( $opt_8 and $opt_u ) {
my $lc_ctype=`locale 2>/dev/null | fgrep LC_CTYPE | sed -e 's/^.*=//'`;
if ( $lc_ctype =~ /utf.?8/i ) {
binmode(STDOUT, ":utf8");
}
}
# colors 16-79 are a 4x4x4 color cube
@steps=(0,139,205,255);
printf("%s4", $osc) if ($opt_q);
for ($red = 0; $red < $cube; $red++) {
for ($green = 0; $green < $cube; $green++) {
for ($blue = 0; $blue < $cube; $blue++) {
&define_color(
16 + (map_cube($red) * $cube * $cube) + (map_cube($green) * $cube) + map_cube($blue),
int (@steps[$red]),
int (@steps[$green]),
int (@steps[$blue]));
}
}
}
# colors 80-87 are a grayscale ramp, intentionally leaving out
# black and white
for ($gray = 0; $gray < 8; $gray++) {
$level = (map_gray($gray) * 23.18181818) + 46.36363636;
if( $gray > 0 ) { $level += 23.18181818; }
&define_color(80 + $gray, int($level), int($level), int($level));
}
printf("%s", $st) if ($opt_q);
# display the colors
# first the system ones:
print "System colors:\n";
for ($color = 0; $color < 8; $color++) {
&select_color($color);
}
printf "%s0m\n", $csi;
for ($color = 8; $color < 16; $color++) {
&select_color($color);
}
printf "%s0m\n\n", $csi;
# now the color cube
print "Color cube, ${cube}x${cube}x${cube}:\n";
for ($green = 0; $green < $cube; $green++) {
for ($red = 0; $red < $cube; $red++) {
for ($blue = 0; $blue < $cube; $blue++) {
$color = 16 + ($red * $cube * $cube) + ($green * $cube) + $blue;
&select_color($color);
}
printf "%s0m ", $csi;
}
print "\n";
}
# now the grayscale ramp
print "Grayscale ramp:\n";
for ($color = 80; $color < 88; $color++) {
&select_color($color);
}
printf "%s0m\n", $csi;
xterm-297/vttests/8colors.sh 0000755 0001751 0000144 00000006056 11671154202 014725 0 ustar tom users #!/bin/sh
# $XTermId: 8colors.sh,v 1.14 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Show a simple 8-color test pattern
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "[0m"; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "[0m"; exit' 0 1 2 5 15
fi
echo "[0m"
while true
do
for AT in 0 1 4 7
do
case $AT in
0) attr="normal ";;
1) attr="bold ";;
4) attr="under ";;
7) attr="reverse ";;
esac
for FG in 0 1 2 3 4 5 6 7
do
case $FG in
0) fcolor="black ";;
1) fcolor="red ";;
2) fcolor="green ";;
3) fcolor="yellow ";;
4) fcolor="blue ";;
5) fcolor="magenta ";;
6) fcolor="cyan ";;
7) fcolor="white ";;
esac
$CMD $OPT "[0;${AT}m$attr"
$CMD $OPT "[3${FG}m$fcolor"
for BG in 1 2 3 4 5 6 7
do
case $BG in
0) bcolor="black ";;
1) bcolor="red ";;
2) bcolor="green ";;
3) bcolor="yellow ";;
4) bcolor="blue ";;
5) bcolor="magenta ";;
6) bcolor="cyan ";;
7) bcolor="white ";;
esac
$CMD $OPT "[4${BG}m$bcolor"
done
echo "[0m"
done
sleep 1
done
done
xterm-297/vttests/paste64.pl 0000755 0001751 0000144 00000010174 10405145242 014615 0 ustar tom users #!/usr/bin/perl -w
# $XTermId: paste64.pl,v 1.10 2006/03/13 01:28:02 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2006 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Test the paste64 option of xterm.
use strict;
use Term::ReadKey;
use IO::Handle;
use MIME::Base64;
our $target = "";
sub to_hex($) {
my $value = $_[0];
my $result = "";
my $n;
for ( $n = 0; $n < length($value); ++$n) {
$result .= sprintf("%02X", ord substr($value,$n,1));
}
return $result;
}
sub show_string($) {
my $value = $_[0];
my $n;
my $result = "";
for ( $n = 0; $n < length($value); $n += 1) {
my $c = ord substr($value,$n,1);
if ( $c == ord '\\' ) {
$result .= "\\\\";
} elsif ( $c == 0x1b ) {
$result .= "\\E";
} elsif ( $c == 0x7f ) {
$result .= "^?";
} elsif ( $c == 32 ) {
$result .= "\\s";
} elsif ( $c < 32 ) {
$result .= sprintf("^%c", $c + 64);
} elsif ( $c > 128 ) {
$result .= sprintf("\\%03o", $c);
} else {
$result .= chr($c);
}
}
printf "%s\r\n", $result;
}
sub get_reply($) {
my $command = $_[0];
my $reply = "";
printf "send: ";
show_string($command);
print STDOUT $command;
autoflush STDOUT 1;
while (1) {
my $test=ReadKey 1;
last if not defined $test;
#printf "%d:%s\r\n", length($reply), to_hex($test);
$reply .= $test;
}
return $reply;
}
sub get_paste() {
my $reply = get_reply("\x1b]52;" . $target . ";?\x1b\\");
printf "read: ";
show_string($reply);
my $data = $reply;
$data =~ s/^\x1b]52;[[:alnum:]]*;//;
$data =~ s/\x1b\\$//;
printf "chop: ";
show_string($data);
$data = decode_base64($data);
printf "data: ";
show_string($data);
}
sub put_paste() {
ReadMode 1;
printf "data: ";
my $data = ReadLine 0;
chomp $data;
ReadMode 5;
$data = encode_base64($data);
chomp $data;
printf "data: ";
show_string($data);
my $send = "\x1b]52;" . $target . ";" . $data . "\x1b\\";
printf "send: ";
show_string($send);
}
sub set_target() {
ReadMode 1;
printf "target: ";
$target = ReadLine 0;
$target =~ s/[^[:alnum:]]//g;
ReadMode 5;
printf "result: %s\r\n", $target;
}
ReadMode 5, 'STDIN'; # allow single-character inputs
while (1) {
my $cmd;
printf "\r\nCommand (? for help):";
$cmd = ReadKey 0;
if ( $cmd eq "?" ) {
printf "\r\np=put selection, g=get selection, q=quit, r=reset target, s=set target\r\n";
} elsif ($cmd eq "p") {
printf " ...put selection\r\n";
put_paste();
} elsif ($cmd eq "g") {
printf " ...get selection\r\n";
get_paste();
} elsif ($cmd eq "q") {
printf " ...quit\r\n";
last;
} elsif ($cmd eq "r") {
printf " ...reset\r\n";
$target = "";
} elsif ($cmd eq "s") {
printf " ...set target\r\n";
set_target();
}
}
ReadMode 0, 'STDIN'; # Reset tty mode before exiting
xterm-297/vttests/resize.sh 0000755 0001751 0000144 00000006203 11671154202 014627 0 ustar tom users #!/bin/sh
# $XTermId: resize.sh,v 1.17 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Obtain the current screen size, then resize the terminal to the nominal
# screen width/height, and restore the size.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
exec /dev/tty
IFS=';' read junk high wide
$CMD $OPT "${ESC}[19t${SUF}" > /dev/tty
IFS=';' read junk maxhigh maxwide
stty $old
wide=`echo $wide|sed -e 's/t.*//'`
maxwide=`echo $maxwide|sed -e 's/t.*//'`
original=${ESC}[8\;${high}\;${wide}t${SUF}
test $maxwide = 0 && maxwide=`expr $wide \* 2`
test $maxhigh = 0 && maxhigh=`expr $high \* 2`
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
w=$wide
h=$high
a=1
while true
do
# sleep 1
echo resizing to $h by $w
$CMD $OPT "${ESC}[8;${h};${w}t" >/dev/tty
if test $a = 1 ; then
if test $w = $maxwide ; then
h=`expr $h + $a`
if test $h = $maxhigh ; then
a=-1
fi
else
w=`expr $w + $a`
fi
else
if test $w = $wide ; then
h=`expr $h + $a`
if test $h = $high ; then
a=1
fi
else
w=`expr $w + $a`
fi
fi
done
xterm-297/vttests/query-fonts.pl 0000755 0001751 0000144 00000011125 11376440152 015626 0 ustar tom users #!/usr/bin/perl -w
# $XTermId: query-fonts.pl,v 1.5 2010/05/24 09:01:30 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2010 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Test the font-query features of xterm.
# TODO:
# test relative vs absolute font numbering
# test all font-slots
# test selection
# test bold / wide / widebold
# test actual fontname vs nominal
# extend "CSI > Ps; Ps T" to query fontname in hex
use strict;
use Getopt::Std;
use IO::Handle;
our ( $opt_a, $opt_r, $opt_s );
&getopts('ars') || die(
"Usage: $0 [options]\n
Options:\n
-a test using absolute numbers
-r test using relative numbers
-s use ^G rather than ST
"
);
our $ST = $opt_s ? "\007" : "\x1b\\";
sub no_reply($) {
open TTY, "+;
close TTY;
system "stty $old";
if ( defined $reply ) {
die("^C received\n") if ( "$reply" eq "\003" );
}
return $reply;
}
sub query_font($) {
my $param = $_[0];
my $reply;
my $n;
my $st = $opt_s ? qr/\007/ : qr/\x1b\\/;
my $osc = qr/\x1b]50/;
my $match = qr/${osc}.*${st}/;
$reply = get_reply( "\x1b]50;?" . $param . $ST );
printf "query{%s}%*s", $param, 3 - length($param), " ";
if ( defined $reply ) {
printf "%2d ", length($reply);
if ( $reply =~ /${match}/ ) {
$reply =~ s/^${osc}//;
$reply =~ s/^;//;
$reply =~ s/${st}$//;
}
else {
printf "? ";
}
my $result = "";
for ( $n = 0 ; $n < length($reply) ; ) {
my $c = substr( $reply, $n, 1 );
if ( $c =~ /[[:print:]]/ ) {
$result .= $c;
}
else {
my $k = ord substr( $reply, $n, 1 );
if ( ord $k == 0x1b ) {
$result .= "\\E";
}
elsif ( $k == 0x7f ) {
$result .= "^?";
}
elsif ( $k == 32 ) {
$result .= "\\s";
}
elsif ( $k < 32 ) {
$result .= sprintf( "^%c", $k + 64 );
}
elsif ( $k > 128 ) {
$result .= sprintf( "\\%03o", $k );
}
else {
$result .= chr($k);
}
}
$n += 1;
}
printf "{%s}", $result;
}
printf "\n";
}
if ($opt_r) {
my $n;
query_font("-");
foreach $n ( 0 .. 5 ) {
query_font( sprintf "-%d", $n );
}
query_font("+");
foreach $n ( 0 .. 5 ) {
query_font( sprintf "+%d", $n );
}
}
if ($opt_a) {
my $n;
foreach $n ( 0 .. 5 ) {
query_font( sprintf "%d", $n );
}
}
if ( not $opt_a and not $opt_r ) {
query_font("");
}
xterm-297/vttests/dynamic.pl 0000755 0001751 0000144 00000006500 11604555105 014756 0 ustar tom users #!/usr/bin/perl -w
# $XTermId: dynamic.pl,v 1.2 2011/07/05 09:32:53 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Test the dynamic-color query option of xterm.
# The programs xtermcontrol and xtermset provide more options.
use strict;
use Getopt::Std;
use IO::Handle;
our @color_names = (
"VT100 text foreground",
"VT100 text background",
"text cursor",
"mouse foreground",
"mouse background",
"Tektronix foreground",
"Tektronix background",
"highlight background",
"Tektronix cursor",
"highlight foreground"
);
our ($opt_c, $opt_r);
&getopts('c:r') || die("Usage: $0 [options]\n
Options:\n
-c XXX set cursor-color
-r reset colors
");
sub no_reply($) {
open TTY, "+;
close TTY;
system "stty $old";
if ( defined $reply ) {
die("^C received\n") if ( "$reply" eq "\003" );
}
return $reply;
}
sub query_color($) {
my $code = $_[0];
my $param1 = $code + 10;
my $reply;
$reply=get_reply("\x1b]$param1;?\007");
return unless defined $reply;
if ( $reply =~ /\x1b]$param1;.*\007/ ) {
my $value = $reply;
$value =~ s/^\x1b]$param1;//;
$value =~ s/\007//;
printf "%24s = %s\n", $color_names[$code], $value;
}
}
sub query_colors() {
my $n;
for ( $n = 0; $n <= 9; ++$n) {
&query_color($n);
}
}
sub reset_colors() {
my $n;
for ( $n = 0; $n <= 9; ++$n) {
my $code = 110 + $n;
&no_reply("\x1b]$code\007");
}
}
if ( defined ($opt_c) ) {
&no_reply("\x1b]12;$opt_c\007");
}
if ( defined ($opt_r) ) {
&reset_colors();
}
&query_colors();
xterm-297/vttests/88colors.pl 0000755 0001751 0000144 00000003546 06773747642 015046 0 ustar tom users #!/usr/bin/perl
# $XTermId: 88colors.pl,v 1.3 1999/09/27 20:12:18 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Made from 256colors.pl
for ($bg = 0; $bg < 88; $bg++) {
print "\x1b[9;1H\x1b[48;5;${bg}m\x1b[2J";
for ($fg = 0; $fg < 88; $fg++) {
print "\x1b[38;5;${fg}m";
printf "%03.3d/%03.3d ", $fg, $bg;
}
sleep 1;
print "\n";
}
xterm-297/vttests/acolors.sh 0000755 0001751 0000144 00000005576 11671154202 015004 0 ustar tom users #!/bin/sh
# $XTermId: acolors.sh,v 1.7 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2002-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Demonstrate the use of the control sequence for changing ANSI colors.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
LIST="00 30 80 d0 ff"
exec /dev/tty
read original
stty $old
original=${original}${SUF}
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD $OPT "$original" >/dev/tty; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD $OPT "$original" >/dev/tty; exit' 0 1 2 5 15
fi
$CMD "${ESC}[0;1;34mThis message is BLUE"
$CMD "${ESC}[0;1;31mThis message is RED ${ESC}[0;31m(sometimes)"
$CMD "${ESC}[0;1;32mThis message is GREEN${ESC}[0m"
while true
do
for R in $LIST
do
for G in $LIST
do
for B in $LIST
do
# color "9" is bold-red
test $R != 00 && test $G = 00 && test $B = 00 && $CMD $OPT "" >/dev/tty
$CMD $OPT "${ESC}]4;9;rgb:$R/$G/$B${SUF}" >/dev/tty
sleep 1
done
done
done
done
xterm-297/vttests/16colors.sh 0000755 0001751 0000144 00000006552 11671154202 015005 0 ustar tom users #!/bin/sh
# $XTermId: 16colors.sh,v 1.14 2011/12/11 16:21:22 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1999-2003,2011 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# Show a simple 16-color test pattern. It is a little more confusing than
# 8colors.sh, since everything is abbreviated to fit on an 80-column line.
# The high (8-15) combinations for foreground or background are marked with
# a '+' sign.
ESC=""
CMD='/bin/echo'
OPT='-n'
SUF=''
TMP=/tmp/xterm$$
eval '$CMD $OPT >$TMP || echo fail >$TMP' 2>/dev/null
( test ! -f $TMP || test -s $TMP ) &&
for verb in printf print ; do
rm -f $TMP
eval '$verb "\c" >$TMP || echo fail >$TMP' 2>/dev/null
if test -f $TMP ; then
if test ! -s $TMP ; then
CMD="$verb"
OPT=
SUF='\c'
break
fi
fi
done
rm -f $TMP
if ( trap "echo exit" EXIT 2>/dev/null ) >/dev/null
then
trap '$CMD "[0m"; exit' EXIT HUP INT TRAP TERM
else
trap '$CMD "[0m"; exit' 0 1 2 5 15
fi
echo "[0m"
while true
do
for AT in 0 1 4 7
do
case $AT in
0) attr=" ";;
1) attr="BO ";;
4) attr="UN ";;
7) attr="RV ";;
esac
for FG in 0 1 2 3 4 5 6 7
do
case $FG in
0) fcolor="BLK ";;
1) fcolor="RED ";;
2) fcolor="GRN ";;
3) fcolor="YEL ";;
4) fcolor="BLU ";;
5) fcolor="MAG ";;
6) fcolor="CYN ";;
7) fcolor="WHT ";;
esac
for HI in 3 9
do
if test $HI = 3 ; then
color=" $fcolor"
else
color="+$fcolor"
fi
$CMD $OPT "[0;${AT}m$attr$SUF"
$CMD $OPT "[${HI}${FG}m$color$SUF"
for BG in 1 2 3 4 5 6 7
do
case $BG in
0) bcolor="BLK ";;
1) bcolor="RED ";;
2) bcolor="GRN ";;
3) bcolor="YEL ";;
4) bcolor="BLU ";;
5) bcolor="MAG ";;
6) bcolor="CYN ";;
7) bcolor="WHT ";;
esac
$CMD $OPT "[4${BG}m$bcolor$SUF"
$CMD $OPT "[10${BG}m+$bcolor$SUF"
done
echo "[0m"
done
done
sleep 1
done
done
xterm-297/vttests/resize.pl 0000755 0001751 0000144 00000006611 10021511306 014621 0 ustar tom users #!/usr/bin/perl
# $XTermId: resize.pl,v 1.3 2004/03/04 02:21:58 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2004 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
# resize.sh rewritten into Perl for comparison.
# See also Term::ReadKey.
use IO::Handle;
sub write_tty {
open TTY, "+;
close TTY;
system "stty $old";
return $reply;
}
sub csi_field {
my $first = @_[0];
my $second = @_[1];
$first =~ s/^[^0-9]+//;
while ( --$second > 0 ) {
$first =~ s/^[\d]+//;
$first =~ s/^[^\d]+//;
}
$first =~ s/[^\d]+.*$//;
return $first;
}
$original=get_reply("\x1b[18t");
if ( $original =~ /\x1b\[8;\d+;\d+t/ ) {
$high=csi_field($original,2);
$wide=csi_field($original,3);
printf "parsed terminal size $high,$wide\n";
} else {
die "Cannot get terminal size via escape sequence\n";
}
#
$maximize=get_reply("\x1b[19t");
if ( $maximize =~ /\x1b\[9;\d+;\d+t/ ) {
$maxhigh=csi_field($maximize,2);
$maxwide=csi_field($maximize,3);
$maxhigh != 0 or $maxhigh = $high * 2;
$maxwide != 0 or $maxwide = $wide * 2;
printf "parsed terminal maxsize $maxhigh,$maxwide\n";
} else {
die "Cannot get terminal size via escape sequence\n";
}
sub catch_zap {
$zapped++;
}
$SIG{INT} = \&catch_zap;
$SIG{QUIT} = \&catch_zap;
$SIG{KILL} = \&catch_zap;
$SIG{HUP} = \&catch_zap;
$SIG{TERM} = \&catch_zap;
$w=$wide;
$h=$high;
$a=1;
$zapped=0;
while ( $zapped == 0 )
{
# sleep 1
printf "resizing to $h by $w\n";
write_tty("\x1b[8;$h;$w" . "t");
if ( $a == 1 ) {
if ( $w == $maxwide ) {
$h += $a;
if ( $h = $maxhigh ) {
$a = -1;
}
} else {
$w += $a;
}
} else {
if ( $w == $wide ) {
$h += $a;
if ( $h = $high ) {
$a=1;
}
} else {
$w += $a;
}
}
}
write_tty($original);
xterm-297/Makefile.in 0000644 0001751 0000144 00000042554 12161703542 013333 0 ustar tom users ## $XTermId: Makefile.in,v 1.223 2013/06/23 23:40:18 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 1997-2012,2013 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
SHELL = /bin/sh
#### Start of system configuration section. ####
srcdir = @srcdir@
VPATH = @srcdir@
x = @EXEEXT@
o = .@OBJEXT@
CC = @CC@
CPP = @CPP@
AWK = @AWK@
LINK = $(CC) $(CFLAGS)
CTAGS = @CTAGS@
ETAGS = @ETAGS@
LN_S = @LN_S@
RM = rm -f
LINT = @LINT@
INSTALL = @INSTALL@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
INSTALL_SCRIPT = @INSTALL_SCRIPT@
INSTALL_DATA = @INSTALL_DATA@
transform = @program_transform_name@
EXTRA_CFLAGS = @EXTRA_CFLAGS@
EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@
EXTRA_LOADFLAGS = @IMAKE_LOADFLAGS@
CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H @CPPFLAGS@ -DDEFCLASS=\"@APP_CLASS@\" $(EXTRA_CPPFLAGS)
CFLAGS = @CFLAGS@ $(EXTRA_CFLAGS)
LDFLAGS = @LDFLAGS@ @EXTRA_LDFLAGS@
LIBS = @LIBS@
prefix = @prefix@
exec_prefix = @exec_prefix@
datarootdir = @datarootdir@
datadir = @datadir@
manext = 1
bindir = @bindir@
libdir = @libdir@
mandir = @mandir@/man$(manext)
appsdir = @APPSDIR@
icondir = @ICONDIR@
pixmapdir = @PIXMAPDIR@
#### End of system configuration section. ####
ICON_NAME = @ICON_NAME@
ICON_SYMLINK = @ICON_SYMLINK@
DESTDIR =
BINDIR = $(DESTDIR)$(bindir)
LIBDIR = $(DESTDIR)$(libdir)
MANDIR = $(DESTDIR)$(mandir)
APPSDIR = $(DESTDIR)$(appsdir)
@no_icondir@ICONDIR = $(DESTDIR)$(icondir)
@no_pixmapdir@PIXMAPDIR = $(DESTDIR)$(pixmapdir)
INSTALL_DIRS = $(BINDIR) $(APPSDIR) $(ICONDIR) $(PIXMAPDIR) $(MANDIR)
CLASS = @APP_CLASS@
EXTRAHDR = @EXTRAHDRS@
EXTRASRC = @EXTRASRCS@
EXTRAOBJ = @EXTRAOBJS@
SRCS1 = button.c cachedGCs.c charproc.c charsets.c cursor.c \
data.c doublechr.c fontutils.c input.c \
linedata.c main.c menu.c misc.c \
print.c ptydata.c scrollback.c \
screen.c scrollbar.c tabs.c util.c version.c xstrings.c \
xtermcap.c VTPrsTbl.c $(EXTRASRC)
OBJS1 = button$o cachedGCs$o charproc$o charsets$o cursor$o \
data$o doublechr$o fontutils$o input$o \
linedata$o main$o menu$o misc$o \
print$o ptydata$o scrollback$o \
screen$o scrollbar$o tabs$o util$o version$o xstrings$o \
xtermcap$o VTPrsTbl$o $(EXTRAOBJ)
SRCS2 = resize.c version.c xstrings.c
OBJS2 = resize$o version$o xstrings$o
SRCS = $(SRCS1) $(SRCS2)
OBJS = $(OBJS1) $(OBJS2)
HDRS = VTparse.h data.h error.h main.h menu.h \
ptyx.h version.h xstrings.h xterm.h xtermcap.h $(EXTRAHDR)
PROGRAMS = xterm$x resize$x
all : $(PROGRAMS)
################################################################################
.SUFFIXES : .i .def .hin .$(manext) .ms .man .txt @GROFF_NOTE@ .html .ps .pdf
.c$o :
@RULE_CC@
@ECHO_CC@$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/$*.c
.c.i :
@RULE_CC@
@ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@
.def.hin :
grep '^CASE_' $< | $(AWK) '{printf "#define %s %d\n", $$1, n++}' >$@
.man.$(manext) :
$(SHELL) ./minstall "$(INSTALL_DATA)" $< $@ $(appsdir) $(CLASS) $* $* $(pixmapdir)
@NROFF_NOTE@.$(manext).txt :
@NROFF_NOTE@ $(SHELL) -c "tbl $*.$(manext) | nroff -man | col -bx" >$@
@NROFF_NOTE@
@NROFF_NOTE@.ms.txt :
@NROFF_NOTE@ $(SHELL) -c "tbl $*.$(manext) | nroff -ms | col -bx" >$@
@NROFF_NOTE@
@GROFF_NOTE@.$(manext).html :
@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -P -o0 -I$*_ -Thtml -man" >$@
@GROFF_NOTE@
@GROFF_NOTE@.$(manext).ps :
@GROFF_NOTE@ $(SHELL) -c "tbl $*.$(manext) | groff -man" >$@
@GROFF_NOTE@
@GROFF_NOTE@.$(manext).txt :
@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $*.$(manext) | groff -Tascii -man | col -bx" >$@
@GROFF_NOTE@
@GROFF_NOTE@.ms.html :
@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -P -o0 -I$*_ -Thtml -ms" >$@
@GROFF_NOTE@
@GROFF_NOTE@.ms.ps :
@GROFF_NOTE@ $(SHELL) -c "tbl $< | groff -ms" >$@
@GROFF_NOTE@
@GROFF_NOTE@.ms.txt :
@GROFF_NOTE@ GROFF_NO_SGR=stupid $(SHELL) -c "tbl $< | groff -Tascii -ms | col -bx" >$@
@GROFF_NOTE@
@GROFF_NOTE@.ps.pdf :
@GROFF_NOTE@ ps2pdf $*.ps
################################################################################
main$o : main.h
misc$o : version.h
$(OBJS1) : xterm.h ptyx.h xtermcfg.h
main$o resize$o screen$o : xterm_io.h
xterm$x : $(OBJS1)
@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS1) $(LIBS) $(EXTRA_LOADFLAGS)
resize$x : $(OBJS2)
@ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS2) $(LIBS)
256colres.h :
-rm -f $@
perl $(srcdir)/256colres.pl > $@
88colres.h :
-rm -f $@
perl $(srcdir)/88colres.pl > $@
charproc$o : main.h @CHARPROC_DEPS@
################################################################################
actual_xterm = `echo xterm| sed '$(transform)'`
actual_resize = `echo resize| sed '$(transform)'`
actual_uxterm = `echo uxterm| sed '$(transform)'`
actual_k8term = `echo koi8rxterm| sed '$(transform)'`
binary_xterm = $(actual_xterm)$x
binary_resize = $(actual_resize)$x
binary_uxterm = $(actual_uxterm)
binary_k8term = $(actual_k8term)
install \
install-bin \
install-full :: xterm$x resize$x $(BINDIR)
@MAY_SETUID@ $(SHELL) $(srcdir)/sinstall.sh @SINSTALL_OPTS@ "$(INSTALL_PROGRAM)" xterm$x @XTERM_PATH@ $(BINDIR)/$(binary_xterm)
@NOT_SETUID@ $(INSTALL_PROGRAM) xterm$x $(BINDIR)/$(binary_xterm)
$(INSTALL_PROGRAM) -m 755 resize$x $(BINDIR)/$(binary_resize)
EDIT_SCRIPT = sed -e s,=xterm,=\$$name, -e s,XTerm,$(CLASS),
install \
install-bin \
install-scripts \
install-full ::
@$(SHELL) -c "name=\"$(binary_xterm)\"; \
dest=\"$(binary_uxterm)\"; \
echo \"... installing $(BINDIR)/\$$dest\"; \
$(EDIT_SCRIPT) $(srcdir)/uxterm >uxterm.tmp; \
$(INSTALL_SCRIPT) -m 755 uxterm.tmp $(BINDIR)/\$$dest; \
rm -f uxterm.tmp"
@$(SHELL) -c "name=\"$(binary_xterm)\"; \
dest=\"$(binary_k8term)\"; \
echo \"... installing $(BINDIR)/\$$dest\"; \
$(EDIT_SCRIPT) $(srcdir)/koi8rxterm >k8term.tmp; \
$(INSTALL_SCRIPT) -m 755 k8term.tmp $(BINDIR)/\$$dest; \
rm -f k8term.tmp"
@-$(SHELL) -c "name=\"$(binary_xterm)\"; \
if test @XTERM_SYMLINK@ != NONE ; then \
cd $(BINDIR) && ( \
rm -f @XTERM_SYMLINK@ ; \
$(LN_S) \$$name @XTERM_SYMLINK@ ; \
echo \"... created symbolic link:\" ; \
ls -l \$$name @XTERM_SYMLINK@ ) ; \
fi"
install \
install-man \
install-full :: $(MANDIR)
@-$(SHELL) -c "for app in xterm resize uxterm koi8rxterm ; \
do \
actual=\`echo \"\$$app\" | sed '@program_transform_name@'\`; \
$(SHELL) ./minstall \"$(INSTALL_DATA)\" $(srcdir)/\$$app.man $(MANDIR)/\$$actual.$(manext) $(appsdir) $(CLASS) \$$app \$$actual $(pixmapdir); \
done"
@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext) ; fi"
@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && $(LN_S) $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi"
@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && echo '... created symbolic link:' && ls -l $(actual_xterm).$(manext) @XTERM_SYMLINK@.$(manext) ; fi"
APP_NAMES = XTerm UXTerm KOI8RXTerm
@no_appsdir@install \
@no_appsdir@install-app \
@no_appsdir@install-full :: $(APPSDIR)
@no_appsdir@ @-$(SHELL) -c 'for s in $(APP_NAMES); \
@no_appsdir@ do \
@no_appsdir@ echo "** $$s"; \
@no_appsdir@ d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
@no_appsdir@ echo installing $(APPSDIR)/$$d; \
@no_appsdir@ sed -e s/XTerm/$(CLASS)/ $(srcdir)/$$s.ad >XTerm.tmp; \
@no_appsdir@ $(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d; \
@no_appsdir@ echo installing $(APPSDIR)/$$d-color; \
@no_appsdir@ sed -e s/XTerm/$$d/ $(srcdir)/XTerm-col.ad >XTerm.tmp; \
@no_appsdir@ $(INSTALL_DATA) XTerm.tmp $(APPSDIR)/$$d-color; \
@no_appsdir@ done'
@no_appsdir@ @rm -f XTerm.tmp
@no_icondir@ @echo "... installed app-defaults"
@no_icondir@ICON_LIST = @ICON_LIST@
@no_icondir@ICON_THEME = @ICON_THEME@
@no_icondir@install \
@no_icondir@install-icon \
@no_icondir@install-full :: $(ICONDIR)
@no_icondir@ ACTUAL_XTERM=$(actual_xterm) \
@no_icondir@ $(SHELL) -c '\
@no_icondir@ h=$(ICONDIR)/$(ICON_THEME); \
@no_icondir@ for n in $(ICON_LIST); \
@no_icondir@ do \
@no_icondir@ x=$$ACTUAL_XTERM; \
@no_icondir@ l=`echo "$$n" | cut -f1 -d:`; \
@no_icondir@ r=`echo "$$n" | cut -f2 -d: |sed -e s,$(ICON_NAME),$$x-color,`; \
@no_icondir@ test -z "$$r" && continue; \
@no_icondir@ d=$$h/`echo "$$r" | sed -e "s,/[^/]*$$,,"`; \
@no_icondir@ test -d "$$d" || mkdir -p "$$d"; \
@no_icondir@ echo "installing icon $$h/$$r"; \
@no_icondir@ $(INSTALL_DATA) $$l $$h/$$r; \
@no_icondir@ s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
@no_icondir@ t=$(ICON_SYMLINK)$$s; \
@no_icondir@ b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
@no_icondir@ if test "$(ICON_SYMLINK)" != NONE ; then \
@no_icondir@ if test "$$r" != "$$t" ; then \
@no_icondir@ if test "x$$b" = "x$(ICON_NAME)" ; then \
@no_icondir@ echo "linking $$r -> $$t"; \
@no_icondir@ ( cd $$h; rm -f $$t; $(LN_S) $$r $$t; ) \
@no_icondir@ fi \
@no_icondir@ fi \
@no_icondir@ fi \
@no_icondir@ done'
@no_icondir@ @echo "... installed icons"
@no_pixmapdir@install \
@no_pixmapdir@install-icon \
@no_pixmapdir@install-full :: $(PIXMAPDIR)
@no_pixmapdir@ ACTUAL_XTERM=$(actual_xterm) \
@no_pixmapdir@ $(SHELL) -c '\
@no_pixmapdir@ h=$(PIXMAPDIR); \
@no_pixmapdir@ for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \
@no_pixmapdir@ do \
@no_pixmapdir@ l=`basename $$n`; \
@no_pixmapdir@ r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
@no_pixmapdir@ echo "installing pixmap $$h/$$r"; \
@no_pixmapdir@ $(INSTALL_DATA) $(srcdir)/icons/$$l $$h/$$r; \
@no_pixmapdir@ s=`echo "$$r" | sed -e '"'s,^.*\.,.,'"'`; \
@no_pixmapdir@ t=$(ICON_SYMLINK)$$s; \
@no_pixmapdir@ b=`basename $$n $$s | sed -e "s,_[1-9][0-9]*x.*,,"`; \
@no_pixmapdir@ if test "$(ICON_SYMLINK)" != NONE ; then \
@no_pixmapdir@ if test "x$$r" != "$$t" ; then \
@no_pixmapdir@ if test "x$$b" = "x$(ICON_NAME)" ; then \
@no_pixmapdir@ echo "linking $$r -> $$t"; \
@no_pixmapdir@ ( cd $$h; rm -f $$t; $(LN_S) $$r $$t; ) \
@no_pixmapdir@ fi \
@no_pixmapdir@ fi \
@no_pixmapdir@ fi \
@no_pixmapdir@ done'
@no_pixmapdir@ @echo "... installed icons"
install ::
@echo 'Completed installation of executables and documentation.'
@echo 'Use "make install-ti" to install terminfo description.'
TERMINFO_DIR = @TERMINFO_DIR@
SET_TERMINFO = @SET_TERMINFO@
@no_ticprog@install-full \
@no_ticprog@install-ti :: $(TERMINFO_DIR)
@no_ticprog@ @$(SHELL) -c "$(SET_TERMINFO) $(srcdir)/run-tic.sh $(srcdir)/terminfo"
@no_ticprog@ @echo 'Completed installation of terminfo description.'
install-full \
install-tc ::
@-$(SHELL) -c "test -f /etc/termcap && echo 'You must install the termcap entry manually by editing /etc/termcap'"
installdirs : $(INSTALL_DIRS)
################################################################################
uninstall \
uninstall-bin \
uninstall-full ::
-$(RM) $(BINDIR)/$(binary_xterm)
-$(RM) $(BINDIR)/$(binary_resize)
@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(BINDIR) && rm -f @XTERM_SYMLINK@; fi"
uninstall \
uninstall-bin \
uninstall-scripts \
uninstall-full ::
-$(RM) $(BINDIR)/$(binary_uxterm)
-$(RM) $(BINDIR)/$(binary_k8term)
uninstall \
uninstall-man \
uninstall-full ::
-$(RM) $(MANDIR)/$(actual_xterm).$(manext)
-$(RM) $(MANDIR)/$(actual_resize).$(manext)
-$(RM) $(MANDIR)/$(actual_uxterm).$(manext)
-$(RM) $(MANDIR)/$(actual_k8term).$(manext)
@-$(SHELL) -c "if test @XTERM_SYMLINK@ != NONE ; then cd $(MANDIR) && rm -f @XTERM_SYMLINK@.$(manext); fi"
@no_appsdir@uninstall \
@no_appsdir@uninstall-app \
@no_appsdir@uninstall-full ::
@no_appsdir@ @-$(SHELL) -c 'for s in $(APP_NAMES); \
@no_appsdir@ do \
@no_appsdir@ echo "** $$s"; \
@no_appsdir@ d=`echo $$s | sed -e s/XTerm/$(CLASS)/`; \
@no_appsdir@ echo uninstalling $(APPSDIR)/$$d; \
@no_appsdir@ $(RM) $(APPSDIR)/$$d; \
@no_appsdir@ echo uninstalling $(APPSDIR)/$$d-color; \
@no_appsdir@ $(RM) $(APPSDIR)/$$d-color; \
@no_appsdir@ done'
@no_icondir@uninstall \
@no_icondir@uninstall-icon \
@no_icondir@uninstall-full ::
@no_icondir@ -@$(SHELL) -c 'for n in $(ICON_LIST); \
@no_icondir@ do \
@no_icondir@ x=$(actual_xterm); \
@no_icondir@ r=`echo "$$n" | sed -e s,\^.\*:,, -e s,xterm,$$x,`; \
@no_icondir@ test -z "$$r" && continue; \
@no_icondir@ h=$(ICONDIR)/$(ICON_THEME); \
@no_icondir@ echo removing $$h/$$r; \
@no_icondir@ $(RM) $$h/$$r; \
@no_icondir@ done'
@no_icondir@ @echo "... removed icons"
@no_pixmapdir@uninstall \
@no_pixmapdir@uninstall-icon \
@no_pixmapdir@uninstall-full ::
@no_pixmapdir@ ACTUAL_XTERM=$(actual_xterm) \
@no_pixmapdir@ $(SHELL) -c 'for n in $(srcdir)/icons/*xterm*_32x32.xpm $(srcdir)/icons/*xterm*_48x48.xpm; \
@no_pixmapdir@ do \
@no_pixmapdir@ l=`basename $$n`; \
@no_pixmapdir@ r=`echo "$$l" | sed -e "s,xterm,$$ACTUAL_XTERM,"`; \
@no_pixmapdir@ echo removing $(PIXMAPDIR)/$$r; \
@no_pixmapdir@ $(RM) $(PIXMAPDIR)/$$r; \
@no_pixmapdir@ done'
@no_pixmapdir@ @echo "... removed icons"
################################################################################
# Desktop-utils does not provide an uninstall, and is not uniformly available.
@desktop_utils@DESKTOP_FILES = $(srcdir)/xterm.desktop $(srcdir)/uxterm.desktop
@desktop_utils@DESKTOP_FLAGS = @DESKTOP_FLAGS@
@desktop_utils@install-desktop \
@desktop_utils@install-full ::
@desktop_utils@ ACTUAL_XTERM=$(actual_xterm) \
@desktop_utils@ $(SHELL) -c 'for n in $(DESKTOP_FILES); \
@desktop_utils@ do $(SHELL) df-install $$ACTUAL_XTERM $(DESKTOP_FLAGS) $$n; \
@desktop_utils@ done'
################################################################################
mostlyclean :
-$(RM) *$o *.[is] XtermLog.* .pure core *~ *.bak *.BAK *.out *.tmp
clean : mostlyclean
-$(RM) $(PROGRAMS)
distclean :: clean
-$(RM) Makefile config.status config.cache config.log xtermcfg.h
-$(RM) df-install minstall
distclean \
docs-clean ::
-$(RM) *.ps *.pdf *.png
-$(SHELL) -c 'for p in xterm resize uxterm koi8rxterm; \
do \
$(RM) $$p.html $$p.$(manext) $$p.txt; \
done'
-$(RM) ctlseqs.html ctlseqs.$(manext)
realclean : distclean
-$(RM) tags TAGS
maintainer-clean : realclean
-$(RM) 256colres.h 88colres.h
################################################################################
terminfo.out : terminfo ; tic -a -I -1 terminfo >$@
termcap.out : termcap ; tic -a -C -U termcap >$@
################################################################################
docs-ctlseqs \
docs :: \
$(srcdir)/ctlseqs.txt \
@GROFF_NOTE@ ctlseqs.html \
@GROFF_NOTE@ ctlseqs.pdf \
@GROFF_NOTE@ ctlseqs.ps
ctlseqs.html : $(srcdir)/ctlseqs.ms
ctlseqs.pdf : ctlseqs.ps
ctlseqs.ps : $(srcdir)/ctlseqs.ms
ctlseqs.txt : $(srcdir)/ctlseqs.ms
################################################################################
docs-resize \
docs :: resize.txt @GROFF_NOTE@ resize.html resize.pdf resize.ps
resize.html : resize.$(manext)
resize.pdf : resize.ps
resize.ps : resize.$(manext)
resize.txt : resize.$(manext)
################################################################################
docs-xterm \
docs :: xterm.txt @GROFF_NOTE@ xterm.html xterm.pdf xterm.ps
xterm.html : xterm.$(manext)
xterm.pdf : xterm.ps
xterm.ps : xterm.$(manext)
xterm.txt : xterm.$(manext)
################################################################################
docs-uxterm \
docs :: uxterm.txt @GROFF_NOTE@ uxterm.html uxterm.pdf uxterm.ps
uxterm.html : uxterm.$(manext)
uxterm.pdf : uxterm.ps
uxterm.ps : uxterm.$(manext)
uxterm.txt : uxterm.$(manext)
################################################################################
docs-koi8rxterm \
docs :: koi8rxterm.txt @GROFF_NOTE@ koi8rxterm.html koi8rxterm.pdf koi8rxterm.ps
koi8rxterm.html : koi8rxterm.$(manext)
koi8rxterm.pdf : koi8rxterm.ps
koi8rxterm.ps : koi8rxterm.$(manext)
koi8rxterm.txt : koi8rxterm.$(manext)
################################################################################
lint :
$(LINT) $(CPPFLAGS) $(SRCS1)
$(LINT) $(CPPFLAGS) $(SRCS2)
tags :
$(CTAGS) $(SRCS) $(HDRS)
TAGS :
$(ETAGS) $(SRCS) $(HDRS)
$(TERMINFO_DIR) $(INSTALL_DIRS) :
mkdir -p $@
ALWAYS :
depend : $(TABLES)
makedepend -- $(CPPFLAGS) -- $(SRCS)
# DO NOT DELETE THIS LINE -- make depend depends on it.
xterm-297/fontutils.c 0000644 0001751 0000144 00000256421 12213446605 013463 0 ustar tom users /* $XTermId: fontutils.c,v 1.391 2013/09/09 22:36:53 tom Exp $ */
/*
* Copyright 1998-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
/*
* A portion of this module (for FontNameProperties) was adapted from EMU 1.3;
* it constructs font names with specific properties changed, e.g., for bold
* and double-size characters.
*/
#define RES_OFFSET(field) XtOffsetOf(SubResourceRec, field)
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define SetFontWidth(screen,dst,src) (dst)->f_width = (src)
#define SetFontHeight(screen,dst,src) (dst)->f_height = dimRound((screen)->scale_height * (float) (src))
/* from X11/Xlibint.h - not all vendors install this file */
#define CI_NONEXISTCHAR(cs) (((cs)->width == 0) && \
(((cs)->rbearing|(cs)->lbearing| \
(cs)->ascent|(cs)->descent) == 0))
#define CI_GET_CHAR_INFO_1D(fs,col,cs) \
{ \
cs = 0; \
if (col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[(col - fs->min_char_or_byte2)]; \
} \
if (CI_NONEXISTCHAR(cs)) cs = 0; \
} \
}
#define CI_GET_CHAR_INFO_2D(fs,row,col,cs) \
{ \
cs = 0; \
if (row >= fs->min_byte1 && row <= fs->max_byte1 && \
col >= fs->min_char_or_byte2 && col <= fs->max_char_or_byte2) { \
if (fs->per_char == NULL) { \
cs = &fs->min_bounds; \
} else { \
cs = &fs->per_char[((row - fs->min_byte1) * \
(fs->max_char_or_byte2 - \
fs->min_char_or_byte2 + 1)) + \
(col - fs->min_char_or_byte2)]; \
} \
if (CI_NONEXISTCHAR(cs)) cs = 0; \
} \
}
/*
* A structure to hold the relevant properties from a font
* we need to make a well formed font name for it.
*/
typedef struct {
/* registry, foundry, family */
char *beginning;
/* weight */
char *weight;
/* slant */
char *slant;
/* wideness */
char *wideness;
/* add style */
char *add_style;
int pixel_size;
char *point_size;
int res_x;
int res_y;
char *spacing;
int average_width;
/* charset registry, charset encoding */
char *end;
} FontNameProperties;
#if OPT_RENDERFONT
static void fillInFaceSize(XtermWidget, int);
#endif
#if OPT_SHIFT_FONTS
static int lookupOneFontSize(XtermWidget, int);
#endif
#if OPT_WIDE_CHARS
static unsigned
countGlyphs(XFontStruct * fp)
{
unsigned count = 0;
if (fp != 0) {
if (fp->min_byte1 == 0 && fp->max_byte1 == 0) {
count = fp->max_char_or_byte2 - fp->min_char_or_byte2;
} else if (fp->min_char_or_byte2 < 256
&& fp->max_char_or_byte2 < 256) {
unsigned first = (fp->min_byte1 << 8) + fp->min_char_or_byte2;
unsigned last = (fp->max_byte1 << 8) + fp->max_char_or_byte2;
count = last + 1 - first;
}
}
return count;
}
/*
* Verify that the wide-bold font is at least a bold font with roughly as many
* glyphs as the wide font. The counts should be the same, but settle for
* filtering out the worst of the font mismatches.
*/
static Bool
compatibleWideCounts(XFontStruct * wfs, XFontStruct * wbfs)
{
unsigned count_w = countGlyphs(wfs);
unsigned count_wb = countGlyphs(wbfs);
if (count_w <= 256 ||
count_wb <= 256 ||
((count_w / 4) * 3) > count_wb) {
TRACE(("...font server lied (count wide %u vs wide-bold %u)\n",
count_w, count_wb));
return False;
}
return True;
}
#endif /* OPT_WIDE_CHARS */
#if OPT_BOX_CHARS
static void
setupPackedFonts(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
Bool value = False;
#if OPT_RENDERFONT
#define MIXED(name) screen->name[fontnum].map.mixed
if (xw->work.render_font == True) {
int fontnum = screen->menu_font_number;
screen->allow_packing = (Boolean) (MIXED(renderFontNorm)
|| MIXED(renderFontBold)
|| MIXED(renderFontItal)
#if OPT_RENDERWIDE
|| MIXED(renderWideNorm)
|| MIXED(renderWideBold)
|| MIXED(renderWideItal)
#endif
);
#undef MIXED
}
#endif /* OPT_RENDERFONT */
value = screen->allow_packing;
SetItemSensitivity(fontMenuEntries[fontMenu_font_packedfont].widget, value);
}
#endif
/*
* Returns the fields from start to stop in a dash- separated string. This
* function will modify the source, putting '\0's in the appropiate place and
* moving the beginning forward to after the '\0'
*
* This will NOT work for the last field (but we won't need it).
*/
static char *
n_fields(char **source, int start, int stop)
{
int i;
char *str, *str1;
/*
* find the start-1th dash
*/
for (i = start - 1, str = *source; i; i--, str++)
if ((str = strchr(str, '-')) == 0)
return 0;
/*
* find the stopth dash
*/
for (i = stop - start + 1, str1 = str; i; i--, str1++)
if ((str1 = strchr(str1, '-')) == 0)
return 0;
/*
* put a \0 at the end of the fields
*/
*(str1 - 1) = '\0';
/*
* move source forward
*/
*source = str1;
return str;
}
static Boolean
check_fontname(const char *name)
{
Boolean result = True;
if (IsEmpty(name)) {
TRACE(("fontname missing\n"));
result = False;
}
return result;
}
/*
* Gets the font properties from a given font structure. We use the FONT name
* to find them out, since that seems easier.
*
* Returns a pointer to a static FontNameProperties structure
* or NULL on error.
*/
static FontNameProperties *
get_font_name_props(Display *dpy, XFontStruct * fs, char **result)
{
static FontNameProperties props;
static char *last_name;
XFontProp *fp;
int i;
Atom fontatom = XInternAtom(dpy, "FONT", False);
char *name = 0;
char *str;
/*
* first get the full font name
*/
if (fontatom != 0) {
for (i = 0, fp = fs->properties; i < fs->n_properties; i++, fp++) {
if (fp->name == fontatom) {
name = XGetAtomName(dpy, fp->card32);
break;
}
}
}
if (name == 0)
return 0;
/*
* XGetAtomName allocates memory - don't leak
*/
if (last_name != 0)
XFree(last_name);
last_name = name;
if (result != 0) {
if (!check_fontname(name))
return 0;
if (*result != 0)
free(*result);
*result = x_strdup(name);
}
/*
* Now split it up into parts and put them in
* their places. Since we are using parts of
* the original string, we must not free the Atom Name
*/
/* registry, foundry, family */
if ((props.beginning = n_fields(&name, 1, 3)) == 0)
return 0;
/* weight is the next */
if ((props.weight = n_fields(&name, 1, 1)) == 0)
return 0;
/* slant */
if ((props.slant = n_fields(&name, 1, 1)) == 0)
return 0;
/* width */
if ((props.wideness = n_fields(&name, 1, 1)) == 0)
return 0;
/* add style */
if ((props.add_style = n_fields(&name, 1, 1)) == 0)
return 0;
/* pixel size */
if ((str = n_fields(&name, 1, 1)) == 0)
return 0;
if ((props.pixel_size = atoi(str)) == 0)
return 0;
/* point size */
if ((props.point_size = n_fields(&name, 1, 1)) == 0)
return 0;
/* res_x */
if ((str = n_fields(&name, 1, 1)) == 0)
return 0;
if ((props.res_x = atoi(str)) == 0)
return 0;
/* res_y */
if ((str = n_fields(&name, 1, 1)) == 0)
return 0;
if ((props.res_y = atoi(str)) == 0)
return 0;
/* spacing */
if ((props.spacing = n_fields(&name, 1, 1)) == 0)
return 0;
/* average width */
if ((str = n_fields(&name, 1, 1)) == 0)
return 0;
if ((props.average_width = atoi(str)) == 0)
return 0;
/* the rest: charset registry and charset encoding */
props.end = name;
return &props;
}
#define ALLOCHUNK(n) ((n | 127) + 1)
static void
alloca_fontname(char **result, size_t next)
{
size_t last = (*result != 0) ? strlen(*result) : 0;
size_t have = (*result != 0) ? ALLOCHUNK(last) : 0;
size_t want = last + next + 2;
if (want >= have) {
want = ALLOCHUNK(want);
if (last != 0) {
*result = TypeRealloc(char, want, *result);
} else {
if ((*result = TypeMallocN(char, want)) != 0)
**result = '\0';
}
}
}
static void
append_fontname_str(char **result, const char *value)
{
if (value == 0)
value = "*";
alloca_fontname(result, strlen(value));
if (*result != 0) {
if (**result != '\0')
strcat(*result, "-");
strcat(*result, value);
}
}
static void
append_fontname_num(char **result, int value)
{
if (value < 0) {
append_fontname_str(result, "*");
} else {
char temp[100];
sprintf(temp, "%d", value);
append_fontname_str(result, temp);
}
}
/*
* Take the given font props and try to make a well formed font name specifying
* the same base font and size and everything, but with different weight/width
* according to the parameters. The return value is allocated, should be freed
* by the caller.
*/
static char *
derive_font_name(FontNameProperties * props,
const char *use_weight,
int use_average_width,
const char *use_encoding)
{
char *result = 0;
append_fontname_str(&result, props->beginning);
append_fontname_str(&result, use_weight);
append_fontname_str(&result, props->slant);
append_fontname_str(&result, 0);
append_fontname_str(&result, 0);
append_fontname_num(&result, props->pixel_size);
append_fontname_str(&result, props->point_size);
append_fontname_num(&result, props->res_x);
append_fontname_num(&result, props->res_y);
append_fontname_str(&result, props->spacing);
append_fontname_num(&result, use_average_width);
append_fontname_str(&result, use_encoding);
return result;
}
static char *
bold_font_name(FontNameProperties * props, int use_average_width)
{
return derive_font_name(props, "bold", use_average_width, props->end);
}
#if OPT_WIDE_CHARS
#define derive_wide_font(props, weight) \
derive_font_name(props, weight, props->average_width * 2, "ISO10646-1")
static char *
wide_font_name(FontNameProperties * props)
{
return derive_wide_font(props, "medium");
}
static char *
widebold_font_name(FontNameProperties * props)
{
return derive_wide_font(props, "bold");
}
#endif /* OPT_WIDE_CHARS */
#if OPT_DEC_CHRSET
/*
* Take the given font props and try to make a well formed font name specifying
* the same base font but changed depending on the given attributes and chrset.
*
* For double width fonts, we just double the X-resolution, for double height
* fonts we double the pixel-size and Y-resolution
*/
char *
xtermSpecialFont(TScreen *screen, unsigned atts, unsigned chrset)
{
#if OPT_TRACE
static char old_spacing[80];
static FontNameProperties old_props;
#endif
FontNameProperties *props;
char *result = 0;
const char *weight;
int pixel_size;
int res_x;
int res_y;
props = get_font_name_props(screen->display, screen->fnts[fNorm].fs, 0);
if (props == 0)
return result;
pixel_size = props->pixel_size;
res_x = props->res_x;
res_y = props->res_y;
if (atts & BOLD)
weight = "bold";
else
weight = props->weight;
if (CSET_DOUBLE(chrset))
res_x *= 2;
if (chrset == CSET_DHL_TOP
|| chrset == CSET_DHL_BOT) {
res_y *= 2;
pixel_size *= 2;
}
#if OPT_TRACE
if (old_props.res_x != res_x
|| old_props.res_x != res_y
|| old_props.pixel_size != pixel_size
|| strcmp(old_props.spacing, props->spacing)) {
TRACE(("xtermSpecialFont(atts = %#x, chrset = %#x)\n", atts, chrset));
TRACE(("res_x = %d\n", res_x));
TRACE(("res_y = %d\n", res_y));
TRACE(("point_size = %s\n", props->point_size));
TRACE(("pixel_size = %d\n", pixel_size));
TRACE(("spacing = %s\n", props->spacing));
old_props.res_x = res_x;
old_props.res_x = res_y;
old_props.pixel_size = pixel_size;
old_props.spacing = old_spacing;
sprintf(old_spacing, "%.*s", (int) sizeof(old_spacing) - 2, props->spacing);
}
#endif
append_fontname_str(&result, props->beginning);
append_fontname_str(&result, weight);
append_fontname_str(&result, props->slant);
append_fontname_str(&result, props->wideness);
append_fontname_str(&result, props->add_style);
append_fontname_num(&result, pixel_size);
append_fontname_str(&result, props->point_size);
append_fontname_num(&result, (atts & NORESOLUTION) ? -1 : res_x);
append_fontname_num(&result, (atts & NORESOLUTION) ? -1 : res_y);
append_fontname_str(&result, props->spacing);
append_fontname_str(&result, 0);
append_fontname_str(&result, props->end);
return result;
}
#endif /* OPT_DEC_CHRSET */
/*
* Case-independent comparison for font-names, including wildcards.
* XLFD allows '?' as a wildcard, but we do not handle that (no one seems
* to use it).
*/
static Bool
same_font_name(const char *pattern, const char *match)
{
Bool result = False;
if (pattern && match) {
while (*pattern && *match) {
if (*pattern == *match) {
pattern++;
match++;
} else if (*pattern == '*' || *match == '*') {
if (same_font_name(pattern + 1, match)) {
return True;
} else if (same_font_name(pattern, match + 1)) {
return True;
} else {
return False;
}
} else {
int p = x_toupper(*pattern++);
int m = x_toupper(*match++);
if (p != m)
return False;
}
}
result = (*pattern == *match); /* both should be NUL */
}
return result;
}
/*
* Double-check the fontname that we asked for versus what the font server
* actually gave us. The larger fixed fonts do not always have a matching bold
* font, and the font server may try to scale another font or otherwise
* substitute a mismatched font.
*
* If we cannot get what we requested, we will fallback to the original
* behavior, which simulates bold by overstriking each character at one pixel
* offset.
*/
static int
got_bold_font(Display *dpy, XFontStruct * fs, String requested)
{
char *actual = 0;
int got;
if (get_font_name_props(dpy, fs, &actual) == 0)
got = 0;
else
got = same_font_name(requested, actual);
free(actual);
return got;
}
/*
* If the font server tries to adjust another font, it may not adjust it
* properly. Check that the bounding boxes are compatible. Otherwise we'll
* leave trash on the display when we mix normal and bold fonts.
*/
static int
same_font_size(XtermWidget xw, XFontStruct * nfs, XFontStruct * bfs)
{
TScreen *screen = TScreenOf(xw);
TRACE(("same_font_size height %d/%d, min %d/%d max %d/%d\n",
nfs->ascent + nfs->descent,
bfs->ascent + bfs->descent,
nfs->min_bounds.width, bfs->min_bounds.width,
nfs->max_bounds.width, bfs->max_bounds.width));
return screen->free_bold_box
|| ((nfs->ascent + nfs->descent) == (bfs->ascent + bfs->descent)
&& (nfs->min_bounds.width == bfs->min_bounds.width
|| nfs->min_bounds.width == bfs->min_bounds.width + 1)
&& (nfs->max_bounds.width == bfs->max_bounds.width
|| nfs->max_bounds.width == bfs->max_bounds.width + 1));
}
/*
* Check if the font looks like it has fixed width
*/
static int
is_fixed_font(XFontStruct * fs)
{
if (fs)
return (fs->min_bounds.width == fs->max_bounds.width);
return 1;
}
/*
* Check if the font looks like a double width font (i.e. contains
* characters of width X and 2X
*/
#if OPT_WIDE_CHARS
static int
is_double_width_font(XFontStruct * fs)
{
return ((2 * fs->min_bounds.width) == fs->max_bounds.width);
}
#else
#define is_double_width_font(fs) 0
#endif
#if OPT_WIDE_CHARS && OPT_RENDERFONT && defined(HAVE_TYPE_FCCHAR32)
#define HALF_WIDTH_TEST_STRING "1234567890"
/* '1234567890' in Chinese characters in UTF-8 */
#define FULL_WIDTH_TEST_STRING "\xe4\xb8\x80\xe4\xba\x8c\xe4\xb8\x89" \
"\xe5\x9b\x9b\xe4\xba\x94" \
"\xef\xa7\x91\xe4\xb8\x83\xe5\x85\xab" \
"\xe4\xb9\x9d\xef\xa6\xb2"
/* '1234567890' in Korean script in UTF-8 */
#define FULL_WIDTH_TEST_STRING2 "\xec\x9d\xbc\xec\x9d\xb4\xec\x82\xbc" \
"\xec\x82\xac\xec\x98\xa4" \
"\xec\x9c\xa1\xec\xb9\xa0\xed\x8c\x94" \
"\xea\xb5\xac\xec\x98\x81"
#define HALF_WIDTH_CHAR1 0x0031 /* '1' */
#define HALF_WIDTH_CHAR2 0x0057 /* 'W' */
#define FULL_WIDTH_CHAR1 0x4E00 /* CJK Ideograph 'number one' */
#define FULL_WIDTH_CHAR2 0xAC00 /* Korean script syllable 'Ka' */
static Bool
is_double_width_font_xft(Display *dpy, XftFont * font)
{
XGlyphInfo gi1, gi2;
FcChar32 c1 = HALF_WIDTH_CHAR1, c2 = HALF_WIDTH_CHAR2;
String fwstr = FULL_WIDTH_TEST_STRING;
String hwstr = HALF_WIDTH_TEST_STRING;
/* Some Korean fonts don't have Chinese characters at all. */
if (!XftCharExists(dpy, font, FULL_WIDTH_CHAR1)) {
if (!XftCharExists(dpy, font, FULL_WIDTH_CHAR2))
return False; /* Not a CJK font */
else /* a Korean font without CJK Ideographs */
fwstr = FULL_WIDTH_TEST_STRING2;
}
XftTextExtents32(dpy, font, &c1, 1, &gi1);
XftTextExtents32(dpy, font, &c2, 1, &gi2);
if (gi1.xOff != gi2.xOff) /* Not a fixed-width font */
return False;
XftTextExtentsUtf8(dpy,
font,
(_Xconst FcChar8 *) hwstr,
(int) strlen(hwstr),
&gi1);
XftTextExtentsUtf8(dpy,
font,
(_Xconst FcChar8 *) fwstr,
(int) strlen(fwstr),
&gi2);
/*
* fontconfig and Xft prior to 2.2(?) set the width of half-width
* characters identical to that of full-width character in CJK double-width
* (bi-width / monospace) font even though the former is half as wide as
* the latter. This was fixed sometime before the release of fontconfig
* 2.2 in early 2003. See
* http://bugzilla.mozilla.org/show_bug.cgi?id=196312
* In the meantime, we have to check both possibilities.
*/
return ((2 * gi1.xOff == gi2.xOff) || (gi1.xOff == gi2.xOff));
}
#else
#define is_double_width_font_xft(dpy, xftfont) 0
#endif
#define EmptyFont(fs) (fs != 0 \
&& ((fs)->ascent + (fs)->descent == 0 \
|| (fs)->max_bounds.width == 0))
#define FontSize(fs) (((fs)->ascent + (fs)->descent) \
* (fs)->max_bounds.width)
const VTFontNames *
xtermFontName(const char *normal)
{
static VTFontNames data;
if (data.f_n)
free((void *) data.f_n);
memset(&data, 0, sizeof(data));
data.f_n = x_strdup(normal);
return &data;
}
static void
cache_menu_font_name(TScreen *screen, int fontnum, int which, const char *name)
{
if (name != 0) {
char *last = (char *) screen->menu_font_names[fontnum][which];
if (last != 0) {
if (strcmp(last, name)) {
free(last);
TRACE(("caching menu fontname %d.%d %s\n", fontnum, which, name));
screen->menu_font_names[fontnum][which] = x_strdup(name);
}
} else {
TRACE(("caching menu fontname %d.%d %s\n", fontnum, which, name));
screen->menu_font_names[fontnum][which] = x_strdup(name);
}
}
}
/*
* Open the given font and verify that it is non-empty. Return a null on
* failure.
*/
Bool
xtermOpenFont(XtermWidget xw,
const char *name,
XTermFonts * result,
fontWarningTypes warn,
Bool force)
{
Bool code = False;
TScreen *screen = TScreenOf(xw);
if (!IsEmpty(name)) {
if ((result->fs = XLoadQueryFont(screen->display, name)) != 0) {
code = True;
if (EmptyFont(result->fs)) {
(void) xtermCloseFont(xw, result);
code = False;
} else {
result->fn = x_strdup(name);
}
} else if (XmuCompareISOLatin1(name, DEFFONT) != 0) {
if (warn <= xw->misc.fontWarnings
#if OPT_RENDERFONT
&& !UsingRenderFont(xw)
#endif
) {
TRACE(("OOPS: cannot load font %s\n", name));
xtermWarning("cannot load font '%s'\n", name);
#if OPT_RENDERFONT
/*
* Do a sanity check in case someone's mixed up xterm with
* one of those programs that read their resource data from
* xterm's namespace.
*/
if (strchr(name, ':') != 0 || strchr(name, '=') != 0) {
xtermWarning("Use the \"-fa\" option for the Xft fonts\n");
}
#endif
} else {
TRACE(("xtermOpenFont: cannot load font '%s'\n", name));
}
if (force) {
code = xtermOpenFont(xw, DEFFONT, result, fwAlways, True);
}
}
}
return code;
}
/*
* Close the font and free the font info.
*/
XTermFonts *
xtermCloseFont(XtermWidget xw, XTermFonts * fnt)
{
if (fnt != 0 && fnt->fs != 0) {
TScreen *screen = TScreenOf(xw);
clrCgsFonts(xw, WhichVWin(screen), fnt);
XFreeFont(screen->display, fnt->fs);
xtermFreeFontInfo(fnt);
}
return 0;
}
/*
* Close the listed fonts, noting that some may use copies of the pointer.
*/
void
xtermCloseFonts(XtermWidget xw, XTermFonts * fnts)
{
int j, k;
for (j = 0; j < fMAX; ++j) {
/*
* Need to save the pointer since xtermCloseFont zeroes it
*/
XFontStruct *thisFont = fnts[j].fs;
if (thisFont != 0) {
xtermCloseFont(xw, &fnts[j]);
for (k = j + 1; k < fMAX; ++k) {
if (thisFont == fnts[k].fs)
xtermFreeFontInfo(&fnts[k]);
}
}
}
}
/*
* Make a copy of the source, assuming the XFontStruct's to be unique, but
* ensuring that the names are reallocated to simplify freeing.
*/
void
xtermCopyFontInfo(XTermFonts * target, XTermFonts * source)
{
xtermFreeFontInfo(target);
target->chrset = source->chrset;
target->flags = source->flags;
target->fn = x_strdup(source->fn);
target->fs = source->fs;
}
void
xtermFreeFontInfo(XTermFonts * target)
{
target->chrset = 0;
target->flags = 0;
if (target->fn != 0) {
free(target->fn);
target->fn = 0;
}
target->fs = 0;
}
int
xtermLoadFont(XtermWidget xw,
const VTFontNames * fonts,
Bool doresize,
int fontnum)
{
TScreen *screen = TScreenOf(xw);
VTwin *win = WhichVWin(screen);
VTFontNames myfonts;
FontNameProperties *fp;
XTermFonts fnts[fMAX];
Pixel new_normal;
Pixel new_revers;
char *tmpname = NULL;
char *normal = NULL;
Boolean proportional = False;
fontWarningTypes warn[fMAX];
int j;
memset(&myfonts, 0, sizeof(myfonts));
memset(fnts, 0, sizeof(fnts));
if (fonts != 0)
myfonts = *fonts;
if (!check_fontname(myfonts.f_n))
return 0;
/*
* Check the font names against the resource values, to see which were
* derived in a previous call. If so, we'll only warn about those if
* the warning level is set to "always".
*/
for (j = 0; j < fMAX; ++j) {
warn[j] = fwAlways;
}
#define CmpResource(field, index) \
if (same_font_name(screen->menu_font_names[fontnum][index], myfonts.field)) \
warn[index] = fwResource
CmpResource(f_n, fNorm);
if (fontnum == fontMenu_default) {
CmpResource(f_b, fBold);
#if OPT_WIDE_CHARS
CmpResource(f_b, fWide);
CmpResource(f_b, fWBold);
#endif
}
if (fontnum == fontMenu_fontescape
&& myfonts.f_n != screen->MenuFontName(fontnum)) {
if ((tmpname = x_strdup(myfonts.f_n)) == 0)
return 0;
}
TRACE(("Begin Cgs - xtermLoadFont(%s)\n", myfonts.f_n));
releaseWindowGCs(xw, win);
#define DbgResource(name, field, index) \
TRACE(("xtermLoadFont #%d "name" %s%s\n", \
fontnum, \
(warn[index] == fwResource) ? "*" : " ", \
NonNull(myfonts.field)))
DbgResource("normal", f_n, fNorm);
DbgResource("bold ", f_b, fBold);
#if OPT_WIDE_CHARS
DbgResource("wide ", f_w, fWide);
DbgResource("w/bold", f_wb, fWBold);
#endif
/*
* If we are opening the default font, and it happens to be missing, force
* that to the compiled-in default font, e.g., "fixed". If we cannot open
* the font, disable it from the menu.
*/
if (!xtermOpenFont(xw,
myfonts.f_n,
&fnts[fNorm],
warn[fNorm],
(fontnum == fontMenu_default))) {
SetItemSensitivity(fontMenuEntries[fontnum].widget, False);
goto bad;
}
normal = x_strdup(myfonts.f_n);
if (!check_fontname(myfonts.f_b)) {
warn[fBold] = fwAlways;
fp = get_font_name_props(screen->display, fnts[fNorm].fs, &normal);
if (fp != 0) {
myfonts.f_b = bold_font_name(fp, fp->average_width);
if (!xtermOpenFont(xw, myfonts.f_b, &fnts[fBold], fwAlways, False)) {
myfonts.f_b = bold_font_name(fp, -1);
xtermOpenFont(xw, myfonts.f_b, &fnts[fBold], fwAlways, False);
}
TRACE(("...derived bold '%s'\n", NonNull(myfonts.f_b)));
}
if (fp == 0 || fnts[fBold].fs == 0) {
xtermCopyFontInfo(&fnts[fBold], &fnts[fNorm]);
TRACE(("...cannot load a matching bold font\n"));
} else if (same_font_size(xw, fnts[fNorm].fs, fnts[fBold].fs)
&& got_bold_font(screen->display, fnts[fBold].fs, myfonts.f_b)) {
TRACE(("...got a matching bold font\n"));
cache_menu_font_name(screen, fontnum, fBold, myfonts.f_b);
} else {
xtermCloseFont(xw, &fnts[fBold]);
fnts[fBold] = fnts[fNorm];
TRACE(("...did not get a matching bold font\n"));
}
} else if (!xtermOpenFont(xw, myfonts.f_b, &fnts[fBold], warn[fBold], False)) {
xtermCopyFontInfo(&fnts[fBold], &fnts[fNorm]);
warn[fBold] = fwAlways;
TRACE(("...cannot load bold font '%s'\n", NonNull(myfonts.f_b)));
} else {
cache_menu_font_name(screen, fontnum, fBold, myfonts.f_b);
}
/*
* If there is no widefont specified, fake it by doubling AVERAGE_WIDTH
* of normal fonts XLFD, and asking for it. This plucks out 18x18ja
* and 12x13ja as the corresponding fonts for 9x18 and 6x13.
*/
if_OPT_WIDE_CHARS(screen, {
Boolean derived;
char *bold = NULL;
if (check_fontname(myfonts.f_w)) {
cache_menu_font_name(screen, fontnum, fWide, myfonts.f_w);
} else if (screen->utf8_fonts && !is_double_width_font(fnts[fNorm].fs)) {
fp = get_font_name_props(screen->display, fnts[fNorm].fs, &normal);
if (fp != 0) {
myfonts.f_w = wide_font_name(fp);
warn[fWide] = fwAlways;
TRACE(("...derived wide %s\n", NonNull(myfonts.f_w)));
cache_menu_font_name(screen, fontnum, fWide, myfonts.f_w);
}
}
if (check_fontname(myfonts.f_w)) {
(void) xtermOpenFont(xw, myfonts.f_w, &fnts[fWide], warn[fWide], False);
} else {
xtermCopyFontInfo(&fnts[fWide], &fnts[fNorm]);
warn[fWide] = fwAlways;
}
derived = False;
if (!check_fontname(myfonts.f_wb)) {
fp = get_font_name_props(screen->display, fnts[fBold].fs, &bold);
if (fp != 0) {
myfonts.f_wb = widebold_font_name(fp);
warn[fWBold] = fwAlways;
derived = True;
}
}
if (check_fontname(myfonts.f_wb)) {
xtermOpenFont(xw,
myfonts.f_wb,
&fnts[fWBold],
(screen->utf8_fonts
? warn[fWBold]
: (fontWarningTypes) (xw->misc.fontWarnings + 1)),
False);
if (derived
&& !compatibleWideCounts(fnts[fWide].fs, fnts[fWBold].fs)) {
xtermCloseFont(xw, &fnts[fWBold]);
}
if (fnts[fWBold].fs == 0) {
if (IsEmpty(myfonts.f_w)) {
myfonts.f_wb = myfonts.f_b;
warn[fWBold] = fwAlways;
xtermCopyFontInfo(&fnts[fWBold], &fnts[fBold]);
TRACE(("...cannot load wide-bold, use bold %s\n",
NonNull(myfonts.f_b)));
} else {
myfonts.f_wb = myfonts.f_w;
warn[fWBold] = fwAlways;
xtermCopyFontInfo(&fnts[fWBold], &fnts[fWide]);
TRACE(("...cannot load wide-bold, use wide %s\n",
NonNull(myfonts.f_w)));
}
} else {
TRACE(("...%s wide/bold %s\n",
derived ? "derived" : "given",
NonNull(myfonts.f_wb)));
cache_menu_font_name(screen, fontnum, fWBold, myfonts.f_wb);
}
} else if (is_double_width_font(fnts[fBold].fs)) {
xtermCopyFontInfo(&fnts[fWBold], &fnts[fBold]);
warn[fWBold] = fwAlways;
TRACE(("...bold font is double-width, use it %s\n", NonNull(myfonts.f_b)));
} else {
xtermCopyFontInfo(&fnts[fWBold], &fnts[fWide]);
warn[fWBold] = fwAlways;
TRACE(("...cannot load wide bold font, use wide %s\n", NonNull(myfonts.f_w)));
}
free(bold);
if (EmptyFont(fnts[fWBold].fs))
goto bad; /* can't use a 0-sized font */
});
/*
* Most of the time this call to load the font will succeed, even if
* there is no wide font : the X server doubles the width of the
* normal font, or similar.
*
* But if it did fail for some reason, then nevermind.
*/
if (EmptyFont(fnts[fBold].fs))
goto bad; /* can't use a 0-sized font */
if (!same_font_size(xw, fnts[fNorm].fs, fnts[fBold].fs)
&& (is_fixed_font(fnts[fNorm].fs) && is_fixed_font(fnts[fBold].fs))) {
TRACE(("...ignoring mismatched normal/bold fonts\n"));
xtermCloseFont(xw, &fnts[fBold]);
xtermCopyFontInfo(&fnts[fBold], &fnts[fNorm]);
}
if_OPT_WIDE_CHARS(screen, {
if (fnts[fWide].fs != 0
&& fnts[fWBold].fs != 0
&& !same_font_size(xw, fnts[fWide].fs, fnts[fWBold].fs)
&& (is_fixed_font(fnts[fWide].fs) && is_fixed_font(fnts[fWBold].fs))) {
TRACE(("...ignoring mismatched normal/bold wide fonts\n"));
xtermCloseFont(xw, &fnts[fWBold]);
xtermCopyFontInfo(&fnts[fWBold], &fnts[fWide]);
}
});
/*
* Normal/bold fonts should be the same width. Also, the min/max
* values should be the same.
*/
if (!is_fixed_font(fnts[fNorm].fs)
|| !is_fixed_font(fnts[fBold].fs)
|| fnts[fNorm].fs->max_bounds.width != fnts[fBold].fs->max_bounds.width) {
TRACE(("Proportional font! normal %d/%d, bold %d/%d\n",
fnts[fNorm].fs->min_bounds.width,
fnts[fNorm].fs->max_bounds.width,
fnts[fBold].fs->min_bounds.width,
fnts[fBold].fs->max_bounds.width));
proportional = True;
}
if_OPT_WIDE_CHARS(screen, {
if (fnts[fWide].fs != 0
&& fnts[fWBold].fs != 0
&& (!is_fixed_font(fnts[fWide].fs)
|| !is_fixed_font(fnts[fWBold].fs)
|| fnts[fWide].fs->max_bounds.width != fnts[fWBold].fs->max_bounds.width)) {
TRACE(("Proportional font! wide %d/%d, wide bold %d/%d\n",
fnts[fWide].fs->min_bounds.width,
fnts[fWide].fs->max_bounds.width,
fnts[fWBold].fs->min_bounds.width,
fnts[fWBold].fs->max_bounds.width));
proportional = True;
}
});
/* TODO : enforce that the width of the wide font is 2* the width
of the narrow font */
/*
* If we're switching fonts, free the old ones. Otherwise we'll leak
* the memory that is associated with the old fonts. The
* XLoadQueryFont call allocates a new XFontStruct.
*/
xtermCloseFonts(xw, screen->fnts);
xtermCopyFontInfo(&(screen->fnts[fNorm]), &fnts[fNorm]);
xtermCopyFontInfo(&(screen->fnts[fBold]), &fnts[fBold]);
#if OPT_WIDE_CHARS
xtermCopyFontInfo(&(screen->fnts[fWide]), &fnts[fWide]);
if (fnts[fWBold].fs == NULL)
xtermCopyFontInfo(&fnts[fWBold], &fnts[fWide]);
xtermCopyFontInfo(&(screen->fnts[fWBold]), &fnts[fWBold]);
#endif
new_normal = getXtermForeground(xw, xw->flags, xw->cur_foreground);
new_revers = getXtermBackground(xw, xw->flags, xw->cur_background);
setCgsFore(xw, win, gcNorm, new_normal);
setCgsBack(xw, win, gcNorm, new_revers);
setCgsFont(xw, win, gcNorm, &(screen->fnts[fNorm]));
copyCgs(xw, win, gcBold, gcNorm);
setCgsFont(xw, win, gcBold, &(screen->fnts[fBold]));
setCgsFore(xw, win, gcNormReverse, new_revers);
setCgsBack(xw, win, gcNormReverse, new_normal);
setCgsFont(xw, win, gcNormReverse, &(screen->fnts[fNorm]));
copyCgs(xw, win, gcBoldReverse, gcNormReverse);
setCgsFont(xw, win, gcBoldReverse, &(screen->fnts[fBold]));
if_OPT_WIDE_CHARS(screen, {
if (screen->fnts[fWide].fs != 0
&& screen->fnts[fWBold].fs != 0) {
setCgsFore(xw, win, gcWide, new_normal);
setCgsBack(xw, win, gcWide, new_revers);
setCgsFont(xw, win, gcWide, &(screen->fnts[fWide]));
copyCgs(xw, win, gcWBold, gcWide);
setCgsFont(xw, win, gcWBold, &(screen->fnts[fWBold]));
setCgsFore(xw, win, gcWideReverse, new_revers);
setCgsBack(xw, win, gcWideReverse, new_normal);
setCgsFont(xw, win, gcWideReverse, &(screen->fnts[fWide]));
copyCgs(xw, win, gcWBoldReverse, gcWideReverse);
setCgsFont(xw, win, gcWBoldReverse, &(screen->fnts[fWBold]));
}
});
#if OPT_BOX_CHARS
screen->allow_packing = proportional;
setupPackedFonts(xw);
#endif
screen->fnt_prop = (Boolean) (proportional && !(screen->force_packed));
screen->fnt_boxes = True;
#if OPT_BOX_CHARS
/*
* Xterm uses character positions 1-31 of a font for the line-drawing
* characters. Check that they are all present. The null character
* (0) is special, and is not used.
*/
#if OPT_RENDERFONT
if (UsingRenderFont(xw)) {
/*
* FIXME: we shouldn't even be here if we're using Xft.
*/
screen->fnt_boxes = False;
TRACE(("assume Xft missing line-drawing chars\n"));
} else
#endif
{
unsigned ch;
TRACE(("normal font is %scomplete\n",
FontIsIncomplete(&fnts[fNorm]) ? "in" : ""));
TRACE(("bold font is %scomplete\n",
FontIsIncomplete(&fnts[fBold]) ? "in" : ""));
for (ch = 1; ch < 32; ch++) {
unsigned n = ch;
#if OPT_WIDE_CHARS
if (screen->utf8_mode || screen->unicode_font) {
n = dec2ucs(ch);
if (n == UCS_REPL)
continue;
}
#endif
if (IsXtermMissingChar(screen, n, &fnts[fNorm])) {
TRACE(("missing normal char #%d\n", n));
screen->fnt_boxes = False;
break;
}
if (IsXtermMissingChar(screen, n, &fnts[fBold])) {
TRACE(("missing bold char #%d\n", n));
screen->fnt_boxes = False;
break;
}
}
}
TRACE(("Will %suse internal line-drawing characters\n",
screen->fnt_boxes ? "not " : ""));
#endif
if (screen->always_bold_mode) {
screen->enbolden = screen->bold_mode;
} else {
screen->enbolden = screen->bold_mode
&& ((fnts[fNorm].fs == fnts[fBold].fs)
|| same_font_name(normal, myfonts.f_b));
}
TRACE(("Will %suse 1-pixel offset/overstrike to simulate bold\n",
screen->enbolden ? "" : "not "));
set_menu_font(False);
screen->menu_font_number = fontnum;
set_menu_font(True);
if (tmpname) { /* if setting escape or sel */
if (screen->MenuFontName(fontnum))
free((void *) screen->MenuFontName(fontnum));
screen->MenuFontName(fontnum) = tmpname;
if (fontnum == fontMenu_fontescape) {
SetItemSensitivity(fontMenuEntries[fontMenu_fontescape].widget,
True);
}
#if OPT_SHIFT_FONTS
screen->menu_font_sizes[fontnum] = FontSize(fnts[fNorm].fs);
#endif
}
if (normal)
free(normal);
set_cursor_gcs(xw);
xtermUpdateFontInfo(xw, doresize);
TRACE(("Success Cgs - xtermLoadFont\n"));
return 1;
bad:
if (normal)
free(normal);
if (tmpname)
free(tmpname);
#if OPT_RENDERFONT
if (x_strcasecmp(myfonts.f_n, DEFFONT)) {
int code;
myfonts.f_n = DEFFONT;
TRACE(("...recovering for TrueType fonts\n"));
code = xtermLoadFont(xw, &myfonts, doresize, fontnum);
if (code) {
SetItemSensitivity(fontMenuEntries[fontnum].widget,
UsingRenderFont(xw));
TRACE(("...recovered size %dx%d\n",
FontHeight(screen),
FontWidth(screen)));
}
return code;
}
#endif
releaseWindowGCs(xw, win);
xtermCloseFonts(xw, fnts);
TRACE(("Fail Cgs - xtermLoadFont\n"));
return 0;
}
#if OPT_LOAD_VTFONTS || OPT_WIDE_CHARS
/*
* Collect font-names that we can modify with the load-vt-fonts() action.
*/
#define MERGE_SUBFONT(src,dst,name) \
if (IsEmpty(dst.name)) { \
TRACE(("MERGE_SUBFONT " #dst "." #name " merge %s\n", NonNull(src.name))); \
dst.name = src.name; \
} else { \
TRACE(("MERGE_SUBFONT " #dst "." #name " found %s\n", NonNull(dst.name))); \
}
#define INFER_SUBFONT(src,dst,name) \
if (IsEmpty(dst.name)) { \
TRACE(("INFER_SUBFONT " #dst "." #name " will infer\n")); \
dst.name = x_strdup(""); \
} else { \
TRACE(("INFER_SUBFONT " #dst "." #name " found %s\n", NonNull(dst.name))); \
}
#define COPY_MENU_FONTS(src,dst) \
TRACE(("COPY_MENU_FONTS " #src " to " #dst "\n")); \
for (n = fontMenu_default; n <= fontMenu_lastBuiltin; ++n) { \
for (m = 0; m < fMAX; ++m) { \
dst.menu_font_names[n][m] = x_strdup(src.menu_font_names[n][m]); \
} \
TRACE((".. " #dst ".menu_fonts_names[%d] = %s\n", n, dst.menu_font_names[n][fNorm])); \
}
void
xtermSaveVTFonts(XtermWidget xw)
{
TScreen *screen = TScreenOf(xw);
Cardinal n, m;
if (!screen->savedVTFonts) {
screen->savedVTFonts = True;
TRACE(("xtermSaveVTFonts saving original\n"));
screen->cacheVTFonts.default_font = xw->misc.default_font;
COPY_MENU_FONTS(xw->screen, screen->cacheVTFonts);
}
}
#define SAME_STRING(x,y) ((x) == (y) || ((x) && (y) && !strcmp(x, y)))
#define SAME_MEMBER(n) SAME_STRING(a->n, b->n)
static Boolean
sameSubResources(SubResourceRec * a, SubResourceRec * b)
{
Boolean result = True;
int n;
if (!SAME_MEMBER(default_font.f_n)
|| !SAME_MEMBER(default_font.f_b)
#if OPT_WIDE_CHARS
|| !SAME_MEMBER(default_font.f_w)
|| !SAME_MEMBER(default_font.f_wb)
#endif
) {
TRACE(("sameSubResources: default_font differs\n"));
result = False;
} else {
for (n = 0; n < NMENUFONTS; ++n) {
if (!SAME_MEMBER(menu_font_names[n][fNorm])) {
TRACE(("sameSubResources: menu_font_names[%d] differs\n", n));
result = False;
break;
}
}
}
return result;
}
/*
* Load the "VT" font names from the given subresource name/class. These
* correspond to the VT100 resources.
*/
static Bool
xtermLoadVTFonts(XtermWidget xw, String myName, String myClass)
{
SubResourceRec subresourceRec;
SubResourceRec referenceRec;
/*
* These are duplicates of the VT100 font resources, but with a special
* application/classname passed in to distinguish them.
*/
static XtResource font_resources[] =
{
Sres(XtNfont, XtCFont, default_font.f_n, DEFFONT),
Sres(XtNboldFont, XtCBoldFont, default_font.f_b, DEFBOLDFONT),
#if OPT_WIDE_CHARS
Sres(XtNwideFont, XtCWideFont, default_font.f_w, DEFWIDEFONT),
Sres(XtNwideBoldFont, XtCWideBoldFont, default_font.f_wb, DEFWIDEBOLDFONT),
#endif
Sres(XtNfont1, XtCFont1, MenuFontName(fontMenu_font1), NULL),
Sres(XtNfont2, XtCFont2, MenuFontName(fontMenu_font2), NULL),
Sres(XtNfont3, XtCFont3, MenuFontName(fontMenu_font3), NULL),
Sres(XtNfont4, XtCFont4, MenuFontName(fontMenu_font4), NULL),
Sres(XtNfont5, XtCFont5, MenuFontName(fontMenu_font5), NULL),
Sres(XtNfont6, XtCFont6, MenuFontName(fontMenu_font6), NULL),
};
Cardinal n, m;
Bool status = True;
TScreen *screen = TScreenOf(xw);
TRACE(("called xtermLoadVTFonts(name=%s, class=%s)\n",
NonNull(myName), NonNull(myClass)));
xtermSaveVTFonts(xw);
if (IsEmpty(myName)) {
TRACE(("xtermLoadVTFonts restoring original\n"));
xw->misc.default_font = screen->cacheVTFonts.default_font;
COPY_MENU_FONTS(screen->cacheVTFonts, xw->screen);
for (n = 0; n < XtNumber(screen->cacheVTFonts.menu_font_names); ++n) {
screen->MenuFontName(n) = screen->cacheVTFonts.MenuFontName(n);
}
} else {
TRACE(("xtermLoadVTFonts(%s, %s)\n", myName, myClass));
memset(&referenceRec, 0, sizeof(referenceRec));
memset(&subresourceRec, 0, sizeof(subresourceRec));
XtGetSubresources((Widget) xw, (XtPointer) &subresourceRec,
myName, myClass,
font_resources,
(Cardinal) XtNumber(font_resources),
NULL, (Cardinal) 0);
/*
* XtGetSubresources returns no status, so we compare the returned
* data against a zero'd struct to see if any data is returned.
*/
if (memcmp(&referenceRec, &subresourceRec, sizeof(referenceRec))
&& !sameSubResources(&(screen->cacheVTFonts), &subresourceRec)) {
screen->mergedVTFonts = True;
/*
* If a particular resource value was not found, use the original.
*/
MERGE_SUBFONT(xw->misc, subresourceRec, default_font.f_n);
INFER_SUBFONT(xw->misc, subresourceRec, default_font.f_b);
#if OPT_WIDE_CHARS
INFER_SUBFONT(xw->misc, subresourceRec, default_font.f_w);
INFER_SUBFONT(xw->misc, subresourceRec, default_font.f_wb);
#endif
for (n = fontMenu_font1; n <= fontMenu_lastBuiltin; ++n)
MERGE_SUBFONT(xw->screen, subresourceRec, MenuFontName(n));
/*
* Finally, copy the subresource data to the widget.
*/
xw->misc.default_font = subresourceRec.default_font;
COPY_MENU_FONTS(subresourceRec, xw->screen);
screen->MenuFontName(fontMenu_default) = x_strdup(xw->misc.default_font.f_n);
screen->menu_font_names[0][fBold] = x_strdup(xw->misc.default_font.f_b);
#if OPT_WIDE_CHARS
screen->menu_font_names[0][fWide] = x_strdup(xw->misc.default_font.f_w);
screen->menu_font_names[0][fWBold] = x_strdup(xw->misc.default_font.f_wb);
#endif
} else {
TRACE(("...no resources found\n"));
status = False;
}
}
return status;
}
#if OPT_WIDE_CHARS
static Bool
isWideFont(XFontStruct * fp, const char *tag, Bool nullOk)
{
Bool result = False;
(void) tag;
if (okFont(fp)) {
unsigned count = countGlyphs(fp);
TRACE(("isWideFont(%s) found %d cells\n", tag, count));
result = (count > 256) ? True : False;
} else {
result = nullOk;
}
return result;
}
/*
* If the current fonts are not wide, load the UTF8 fonts.
*
* Called during initialization (for wide-character mode), the fonts have not
* been setup, so we pass nullOk=True to isWideFont().
*
* Called after initialization, e.g., in response to the UTF-8 menu entry
* (starting from narrow character mode), it checks if the fonts are not wide.
*/
Bool
xtermLoadWideFonts(XtermWidget xw, Bool nullOk)
{
TScreen *screen = TScreenOf(xw);
Bool result;
if (EmptyFont(screen->fnts[fWide].fs)) {
result = (isWideFont(screen->fnts[fNorm].fs, "normal", nullOk)
&& isWideFont(screen->fnts[fBold].fs, "bold", nullOk));
} else {
result = (isWideFont(screen->fnts[fWide].fs, "wide", nullOk)
&& isWideFont(screen->fnts[fWBold].fs, "wide-bold", nullOk));
if (result && !screen->utf8_latin1) {
result = (isWideFont(screen->fnts[fNorm].fs, "normal", nullOk)
&& isWideFont(screen->fnts[fBold].fs, "bold", nullOk));
}
}
if (!result) {
TRACE(("current fonts are not all wide%s\n", nullOk ? " nullOk" : ""));
result = xtermLoadVTFonts(xw, XtNutf8Fonts, XtCUtf8Fonts);
}
TRACE(("xtermLoadWideFonts:%d\n", result));
return result;
}
#endif /* OPT_WIDE_CHARS */
/*
* Restore the default fonts, i.e., if we had switched to wide-fonts.
*/
Bool
xtermLoadDefaultFonts(XtermWidget xw)
{
Bool result;
result = xtermLoadVTFonts(xw, NULL, NULL);
TRACE(("xtermLoadDefaultFonts:%d\n", result));
return result;
}
#endif /* OPT_LOAD_VTFONTS || OPT_WIDE_CHARS */
#if OPT_LOAD_VTFONTS
void
HandleLoadVTFonts(Widget w,
XEvent * event GCC_UNUSED,
String *params GCC_UNUSED,
Cardinal *param_count GCC_UNUSED)
{
static char empty[] = ""; /* appease strict compilers */
XtermWidget xw;
if ((xw = getXtermWidget(w)) != 0) {
TScreen *screen = TScreenOf(xw);
char name_buf[80];
char class_buf[80];
String name = (String) ((*param_count > 0) ? params[0] : empty);
char *myName = (char *) MyStackAlloc(strlen(name) + 1, name_buf);
String convert = (String) ((*param_count > 1) ? params[1] : myName);
char *myClass = (char *) MyStackAlloc(strlen(convert) + 1, class_buf);
int n;
TRACE(("HandleLoadVTFonts(%d)\n", *param_count));
strcpy(myName, name);
strcpy(myClass, convert);
if (*param_count == 1)
myClass[0] = x_toupper(myClass[0]);
if (xtermLoadVTFonts(xw, myName, myClass)) {
/*
* When switching fonts, try to preserve the font-menu selection, since
* it is less surprising to do that (if the font-switching can be
* undone) than to switch to "Default".
*/
int font_number = screen->menu_font_number;
if (font_number > fontMenu_lastBuiltin)
font_number = fontMenu_lastBuiltin;
for (n = 0; n < NMENUFONTS; ++n)
screen->menu_font_sizes[n] = 0;
SetVTFont(xw, font_number, True,
((font_number == fontMenu_default)
? &(xw->misc.default_font)
: NULL));
}
MyStackFree(myName, name_buf);
MyStackFree(myClass, class_buf);
}
}
#endif /* OPT_LOAD_VTFONTS */
/*
* Set the limits for the box that outlines the cursor.
*/
void
xtermSetCursorBox(TScreen *screen)
{
static XPoint VTbox[NBOX];
XPoint *vp;
int fw = FontWidth(screen) - 1;
int fh = FontHeight(screen) - 1;
int ww = isCursorBar(screen) ? 1 : fw;
int hh = isCursorUnderline(screen) ? 1 : fh;
vp = &VTbox[1];
(vp++)->x = (short) ww;
(vp++)->y = (short) hh;
(vp++)->x = (short) -ww;
vp->y = (short) -hh;
screen->box = VTbox;
}
#define CACHE_XFT(dst,src) if (src != 0) {\
checkXft(xw, &(dst[fontnum]), src);\
TRACE(("Xft metrics %s[%d] = %d (%d,%d)%s advance %d, actual %d%s\n",\
#dst,\
fontnum,\
src->height,\
src->ascent,\
src->descent,\
((src->ascent + src->descent) > src->height ? "*" : ""),\
src->max_advance_width,\
dst[fontnum].map.min_width,\
dst[fontnum].map.mixed ? " mixed" : ""));\
}
#if OPT_RENDERFONT
#if OPT_TRACE > 1
static FcChar32
xtermXftFirstChar(XftFont * xft)
{
FcChar32 map[FC_CHARSET_MAP_SIZE];
FcChar32 next;
FcChar32 first;
int i;
first = FcCharSetFirstPage(xft->charset, map, &next);
for (i = 0; i < FC_CHARSET_MAP_SIZE; i++)
if (map[i]) {
FcChar32 bits = map[i];
first += i * 32;
while (!(bits & 0x1)) {
bits >>= 1;
first++;
}
break;
}
return first;
}
static FcChar32
xtermXftLastChar(XftFont * xft)
{
FcChar32 this, last, next;
FcChar32 map[FC_CHARSET_MAP_SIZE];
int i;
last = FcCharSetFirstPage(xft->charset, map, &next);
while ((this = FcCharSetNextPage(xft->charset, map, &next)) != FC_CHARSET_DONE)
last = this;
last &= ~0xff;
for (i = FC_CHARSET_MAP_SIZE - 1; i >= 0; i--)
if (map[i]) {
FcChar32 bits = map[i];
last += i * 32 + 31;
while (!(bits & 0x80000000)) {
last--;
bits <<= 1;
}
break;
}
return (long) last;
}
static void
dumpXft(XtermWidget xw, XTermXftFonts * data)
{
XftFont *xft = data->font;
TScreen *screen = TScreenOf(xw);
VTwin *win = WhichVWin(screen);
FcChar32 c;
FcChar32 first = xtermXftFirstChar(xft);
FcChar32 last = xtermXftLastChar(xft);
unsigned count = 0;
unsigned outside = 0;
TRACE(("dumpXft {{\n"));
TRACE((" data range %#6x..%#6x\n", first, last));
for (c = first; c <= last; ++c) {
if (FcCharSetHasChar(xft->charset, c)) {
int width = my_wcwidth((int) c);
XGlyphInfo extents;
XftTextExtents32(XtDisplay(xw), xft, &c, 1, &extents);
TRACE(("%#6x %2d %.1f\n", c, width,
((double) extents.width) / win->f_width));
if (extents.width > win->f_width)
++outside;
++count;
}
}
TRACE(("}} %u total, %u outside\n", count, outside));
}
#define DUMP_XFT(xw, data) dumpXft(xw, data)
#else
#define DUMP_XFT(xw, data) /* nothing */
#endif
static void
checkXft(XtermWidget xw, XTermXftFonts * data, XftFont * xft)
{
FcChar32 c;
Dimension width = 0;
data->font = xft;
data->map.min_width = 0;
data->map.max_width = (Dimension) xft->max_advance_width;
/*
* For each ASCII or ISO-8859-1 printable code, ask what its width is.
* Given the maximum width for those, we have a reasonable estimate of
* the single-column width.
*
* Ignore control characters - their extent information is misleading.
*/
for (c = 32; c < 256; ++c) {
if (c >= 127 && c <= 159)
continue;
if (FcCharSetHasChar(xft->charset, c)) {
XGlyphInfo extents;
XftTextExtents32(XtDisplay(xw), xft, &c, 1, &extents);
if (width < extents.width && extents.width <= data->map.max_width) {
width = extents.width;
}
}
}
data->map.min_width = width;
data->map.mixed = (data->map.max_width >= (data->map.min_width + 1));
}
static XftFont *
xtermOpenXft(XtermWidget xw, const char *name, XftPattern * pat, const char *tag)
{
TScreen *screen = TScreenOf(xw);
Display *dpy = screen->display;
XftPattern *match;
XftResult status;
XftFont *result = 0;
if (pat != 0) {
match = XftFontMatch(dpy, DefaultScreen(dpy), pat, &status);
if (match != 0) {
result = XftFontOpenPattern(dpy, match);
if (result != 0) {
TRACE(("...matched %s font\n", tag));
} else {
TRACE(("...could did not open %s font\n", tag));
XftPatternDestroy(match);
if (xw->misc.fontWarnings >= fwAlways) {
TRACE(("OOPS cannot open %s font \"%s\"\n", tag, name));
xtermWarning("cannot open %s font \"%s\"\n", tag, name);
}
}
} else {
TRACE(("...did not match %s font\n", tag));
if (xw->misc.fontWarnings >= fwResource) {
TRACE(("OOPS: cannot match %s font \"%s\"\n", tag, name));
xtermWarning("cannot match %s font \"%s\"\n", tag, name);
}
}
}
return result;
}
#endif
#if OPT_RENDERFONT
#if OPT_SHIFT_FONTS
/*
* Don't make a dependency on the math library for a single function.
* (Newton Raphson).
*/
static double
dimSquareRoot(double value)
{
double result = 0.0;
if (value > 0.0) {
int n;
double older = value;
for (n = 0; n < 10; ++n) {
double delta = (older * older - value) / (2.0 * older);
double newer = older - delta;
older = newer;
result = newer;
if (delta > -0.001 && delta < 0.001)
break;
}
}
return result;
}
#endif
/*
* Given the Xft font metrics, determine the actual font size. This is used
* for each font to ensure that normal, bold and italic fonts follow the same
* rule.
*/
static void
setRenderFontsize(TScreen *screen, VTwin * win, XftFont * font, const char *tag)
{
if (font != 0) {
int width, height, ascent, descent;
(void) screen;
width = font->max_advance_width;
height = font->height;
ascent = font->ascent;
descent = font->descent;
if (height < ascent + descent) {
TRACE(("...increase height from %d\n", height));
height = ascent + descent;
}
if (is_double_width_font_xft(screen->display, font)) {
TRACE(("...reduced width from %d\n", width));
width >>= 1;
}
if (tag == 0) {
SetFontWidth(screen, win, width);
SetFontHeight(screen, win, height);
win->f_ascent = ascent;
win->f_descent = descent;
TRACE(("setRenderFontsize result %dx%d (%d+%d)\n",
width, height, ascent, descent));
} else if (win->f_width < width ||
win->f_height < height ||
win->f_ascent < ascent ||
win->f_descent < descent) {
TRACE(("setRenderFontsize %s changed %dx%d (%d+%d) to %dx%d (%d+%d)\n",
tag,
win->f_width, win->f_height, win->f_ascent, win->f_descent,
width, height, ascent, descent));
SetFontWidth(screen, win, width);
SetFontHeight(screen, win, height);
win->f_ascent = ascent;
win->f_descent = descent;
} else {
TRACE(("setRenderFontsize %s unchanged\n", tag));
}
}
}
#endif
static void
checkFontInfo(int value, const char *tag)
{
if (value == 0) {
xtermWarning("Selected font has no non-zero %s for ISO-8859-1 encoding\n", tag);
exit(1);
}
}
#if OPT_RENDERFONT
void
xtermCloseXft(TScreen *screen, XTermXftFonts * pub)
{
if (pub->font != 0) {
XftFontClose(screen->display, pub->font);
pub->font = 0;
}
}
/*
* Get the faceName/faceDoublesize resource setting. Strip off "xft:", which
* is not recognized by XftNameParse().
*/
String
getFaceName(XtermWidget xw, Bool wideName GCC_UNUSED)
{
#if OPT_RENDERWIDE
String result = (wideName
? xw->misc.face_wide_name
: xw->misc.face_name);
#else
String result = xw->misc.face_name;
#endif
if (!IsEmpty(result) && !strncmp(result, "xft:", (size_t) 4))
result += 4;
return x_nonempty(result);
}
/*
* If we change the faceName, we'll have to re-acquire all of the fonts that
* are derived from it.
*/
void
setFaceName(XtermWidget xw, const char *value)
{
TScreen *screen = TScreenOf(xw);
int n;
Boolean changed = (Boolean) ((xw->misc.face_name == 0)
|| strcmp(xw->misc.face_name, value));
if (changed) {
xw->misc.face_name = x_strdup(value);
for (n = 0; n < NMENUFONTS; ++n) {
xw->misc.face_size[n] = -1.0;
xtermCloseXft(screen, &(screen->renderFontNorm[n]));
xtermCloseXft(screen, &(screen->renderFontBold[n]));
xtermCloseXft(screen, &(screen->renderFontBold[n]));
#if OPT_RENDERWIDE
xtermCloseXft(screen, &(screen->renderWideNorm[n]));
xtermCloseXft(screen, &(screen->renderWideBold[n]));
xtermCloseXft(screen, &(screen->renderWideItal[n]));
#endif
}
}
}
#endif
/*
* Compute useful values for the font/window sizes
*/
void
xtermComputeFontInfo(XtermWidget xw,
VTwin * win,
XFontStruct * font,
int sbwidth)
{
TScreen *screen = TScreenOf(xw);
int i, j, width, height;
#if OPT_RENDERFONT
int fontnum = screen->menu_font_number;
#endif
#if OPT_RENDERFONT
/*
* xterm contains a lot of references to fonts, assuming they are fixed
* size. This chunk of code overrides the actual font-selection (see
* drawXtermText()), if the user has selected render-font. All of the
* font-loading for fixed-fonts still goes on whether or not this chunk
* overrides it.
*/
if (UsingRenderFont(xw) && fontnum >= 0) {
String face_name = getFaceName(xw, False);
XftFont *norm = screen->renderFontNorm[fontnum].font;
XftFont *bold = screen->renderFontBold[fontnum].font;
XftFont *ital = screen->renderFontItal[fontnum].font;
#if OPT_RENDERWIDE
XftFont *wnorm = screen->renderWideNorm[fontnum].font;
XftFont *wbold = screen->renderWideBold[fontnum].font;
XftFont *wital = screen->renderWideItal[fontnum].font;
#endif
if (norm == 0 && face_name) {
XftPattern *pat;
double face_size;
TRACE(("xtermComputeFontInfo font %d: norm(face %s, size %.1f)\n",
fontnum, face_name,
xw->misc.face_size[fontnum]));
fillInFaceSize(xw, fontnum);
face_size = xw->misc.face_size[fontnum];
/*
* By observation (there is no documentation), XftPatternBuild is
* cumulative. Build the bold- and italic-patterns on top of the
* normal pattern.
*/
#define NormXftPattern \
XFT_FAMILY, XftTypeString, "mono", \
XFT_SIZE, XftTypeDouble, face_size, \
XFT_SPACING, XftTypeInteger, XFT_MONO
#define BoldXftPattern(norm) \
XFT_WEIGHT, XftTypeInteger, XFT_WEIGHT_BOLD, \
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
#define ItalXftPattern(norm) \
XFT_SLANT, XftTypeInteger, XFT_SLANT_ITALIC, \
XFT_CHAR_WIDTH, XftTypeInteger, norm->max_advance_width
if ((pat = XftNameParse(face_name)) != 0) {
#define OPEN_XFT(tag) xtermOpenXft(xw, face_name, pat, tag)
XftPatternBuild(pat,
NormXftPattern,
(void *) 0);
norm = OPEN_XFT("normal");
if (norm != 0) {
XftPatternBuild(pat,
BoldXftPattern(norm),
(void *) 0);
bold = OPEN_XFT("bold");
#if OPT_ISO_COLORS
if (screen->italicULMode
&& (pat = XftNameParse(face_name)) != 0) {
XftPatternBuild(pat,
NormXftPattern,
ItalXftPattern(norm),
(void *) 0);
ital = OPEN_XFT("italic");
}
#endif /* OPT_ISO_COLORS */
#undef OPEN_XFT
/*
* FIXME: just assume that the corresponding font has no
* graphics characters.
*/
if (screen->fnt_boxes) {
screen->fnt_boxes = False;
TRACE(("Xft opened - will %suse internal line-drawing characters\n",
screen->fnt_boxes ? "not " : ""));
}
}
XftPatternDestroy(pat);
}
CACHE_XFT(screen->renderFontNorm, norm);
CACHE_XFT(screen->renderFontBold, bold);
CACHE_XFT(screen->renderFontItal, ital);
/*
* See xtermXftDrawString().
*/
#if OPT_RENDERWIDE
if (norm != 0 && screen->wide_chars) {
int char_width = norm->max_advance_width * 2;
#ifdef FC_ASPECT
double aspect = ((xw->misc.face_wide_name
|| screen->renderFontNorm[fontnum].map.mixed)
? 1.0
: 2.0);
#endif
face_name = getFaceName(xw, True);
TRACE(("xtermComputeFontInfo wide(face %s, char_width %d)\n",
NonNull(face_name),
char_width));
#define WideXftPattern \
XFT_FAMILY, XftTypeString, "mono", \
XFT_SIZE, XftTypeDouble, face_size, \
XFT_SPACING, XftTypeInteger, XFT_MONO
if (face_name && (pat = XftNameParse(face_name)) != 0) {
#define OPEN_XFT(tag) xtermOpenXft(xw, face_name, pat, tag)
XftPatternBuild(pat,
WideXftPattern,
XFT_CHAR_WIDTH, XftTypeInteger, char_width,
#ifdef FC_ASPECT
FC_ASPECT, XftTypeDouble, aspect,
#endif
(void *) 0);
wnorm = OPEN_XFT("wide");
if (wnorm != 0) {
XftPatternBuild(pat,
WideXftPattern,
BoldXftPattern(wnorm),
(void *) 0);
wbold = OPEN_XFT("wide-bold");
#if OPT_ISO_COLORS
if (screen->italicULMode
&& (pat = XftNameParse(face_name)) != 0) {
XftPatternBuild(pat,
WideXftPattern,
ItalXftPattern(wnorm),
(void *) 0);
wital = OPEN_XFT("wide-italic");
}
#endif
#undef OPEN_XFT
}
XftPatternDestroy(pat);
}
CACHE_XFT(screen->renderWideNorm, wnorm);
CACHE_XFT(screen->renderWideBold, wbold);
CACHE_XFT(screen->renderWideItal, wital);
}
#endif /* OPT_RENDERWIDE */
}
if (norm == 0) {
TRACE(("...no TrueType font found for number %d, disable menu entry\n", fontnum));
xw->work.render_font = False;
update_font_renderfont();
/* now we will fall through into the bitmap fonts */
} else {
setRenderFontsize(screen, win, norm, NULL);
setRenderFontsize(screen, win, bold, "bold");
setRenderFontsize(screen, win, ital, "ital");
#if OPT_BOX_CHARS
setupPackedFonts(xw);
if (screen->force_packed) {
XTermXftFonts *use = &(screen->renderFontNorm[fontnum]);
SetFontHeight(screen, win, use->font->ascent + use->font->descent);
SetFontWidth(screen, win, use->map.min_width);
TRACE(("...packed TrueType font %dx%d vs %d\n",
win->f_height,
win->f_width,
use->map.max_width));
}
#endif
DUMP_XFT(xw, &(screen->renderFontNorm[fontnum]));
}
}
/*
* Are we handling a bitmap font?
*/
else
#endif /* OPT_RENDERFONT */
{
if (is_double_width_font(font) && !(screen->fnt_prop)) {
SetFontWidth(screen, win, font->min_bounds.width);
} else {
SetFontWidth(screen, win, font->max_bounds.width);
}
SetFontHeight(screen, win, font->ascent + font->descent);
win->f_ascent = font->ascent;
win->f_descent = font->descent;
}
i = 2 * screen->border + sbwidth;
j = 2 * screen->border;
width = MaxCols(screen) * win->f_width + i;
height = MaxRows(screen) * win->f_height + j;
win->fullwidth = (Dimension) width;
win->fullheight = (Dimension) height;
win->width = width - i;
win->height = height - j;
TRACE(("xtermComputeFontInfo window %dx%d (full %dx%d), fontsize %dx%d (asc %d, dsc %d)\n",
win->height,
win->width,
win->fullheight,
win->fullwidth,
win->f_height,
win->f_width,
win->f_ascent,
win->f_descent));
checkFontInfo(win->f_height, "height");
checkFontInfo(win->f_width, "width");
}
/* save this information as a side-effect for double-sized characters */
void
xtermSaveFontInfo(TScreen *screen, XFontStruct * font)
{
screen->fnt_wide = (Dimension) (font->max_bounds.width);
screen->fnt_high = (Dimension) (font->ascent + font->descent);
TRACE(("xtermSaveFontInfo %dx%d\n", screen->fnt_high, screen->fnt_wide));
}
/*
* After loading a new font, update the structures that use its size.
*/
void
xtermUpdateFontInfo(XtermWidget xw, Bool doresize)
{
TScreen *screen = TScreenOf(xw);
int scrollbar_width;
VTwin *win = &(screen->fullVwin);
scrollbar_width = (xw->misc.scrollbar
? (screen->scrollWidget->core.width +
BorderWidth(screen->scrollWidget))
: 0);
xtermComputeFontInfo(xw, win, screen->fnts[fNorm].fs, scrollbar_width);
xtermSaveFontInfo(screen, screen->fnts[fNorm].fs);
if (doresize) {
if (VWindow(screen)) {
xtermClear(xw);
}
TRACE(("xtermUpdateFontInfo {{\n"));
DoResizeScreen(xw); /* set to the new natural size */
ResizeScrollBar(xw);
Redraw();
TRACE(("... }} xtermUpdateFontInfo\n"));
#ifdef SCROLLBAR_RIGHT
updateRightScrollbar(xw);
#endif
}
xtermSetCursorBox(screen);
}
#if OPT_BOX_CHARS
/*
* Returns true if the given character is missing from the specified font.
*/
Bool
xtermMissingChar(unsigned ch, XTermFonts * font)
{
Bool result = False;
XFontStruct *fs = font->fs;
XCharStruct *pc = 0;
if (fs->max_byte1 == 0) {
#if OPT_WIDE_CHARS
if (ch < 256)
#endif
{
CI_GET_CHAR_INFO_1D(fs, E2A(ch), pc);
}
}
#if OPT_WIDE_CHARS
else {
CI_GET_CHAR_INFO_2D(fs, HI_BYTE(ch), LO_BYTE(ch), pc);
}
#endif
if (pc == 0 || CI_NONEXISTCHAR(pc)) {
TRACE(("xtermMissingChar %#04x (!exists)\n", ch));
result = True;
}
if (ch < KNOWN_MISSING) {
font->known_missing[ch] = (Char) (result ? 2 : 1);
}
return result;
}
/*
* The grid is arbitrary, enough resolution that nothing's lost in
* initialization.
*/
#define BOX_HIGH 60
#define BOX_WIDE 60
#define MID_HIGH (BOX_HIGH/2)
#define MID_WIDE (BOX_WIDE/2)
#define CHR_WIDE ((9*BOX_WIDE)/10)
#define CHR_HIGH ((9*BOX_HIGH)/10)
/*
* ...since we'll scale the values anyway.
*/
#define SCALED_X(n) ((int)(n) * (((int) font_width) - 1)) / (BOX_WIDE-1)
#define SCALED_Y(n) ((int)(n) * (((int) font_height) - 1)) / (BOX_HIGH-1)
#define SCALE_X(n) n = SCALED_X(n)
#define SCALE_Y(n) n = SCALED_Y(n)
#define SEG(x0,y0,x1,y1) x0,y0, x1,y1
/*
* Draw the given graphic character, if it is simple enough (i.e., a
* line-drawing character).
*/
void
xtermDrawBoxChar(XtermWidget xw,
unsigned ch,
unsigned flags,
GC gc,
int x,
int y,
int cells)
{
TScreen *screen = TScreenOf(xw);
/* *INDENT-OFF* */
static const short glyph_ht[] = {
SEG(1*BOX_WIDE/10, 0, 1*BOX_WIDE/10,5*MID_HIGH/6), /* H */
SEG(6*BOX_WIDE/10, 0, 6*BOX_WIDE/10,5*MID_HIGH/6),
SEG(1*BOX_WIDE/10,5*MID_HIGH/12,6*BOX_WIDE/10,5*MID_HIGH/12),
SEG(2*BOX_WIDE/10, MID_HIGH, CHR_WIDE, MID_HIGH), /* T */
SEG(6*BOX_WIDE/10, MID_HIGH, 6*BOX_WIDE/10, CHR_HIGH),
-1
}, glyph_ff[] = {
SEG(1*BOX_WIDE/10, 0, 6*BOX_WIDE/10, 0), /* F */
SEG(1*BOX_WIDE/10,5*MID_HIGH/12,6*CHR_WIDE/12,5*MID_HIGH/12),
SEG(1*BOX_WIDE/10, 0, 0*BOX_WIDE/3, 5*MID_HIGH/6),
SEG(1*BOX_WIDE/3, MID_HIGH, CHR_WIDE, MID_HIGH), /* F */
SEG(1*BOX_WIDE/3, 8*MID_HIGH/6,10*CHR_WIDE/12,8*MID_HIGH/6),
SEG(1*BOX_WIDE/3, MID_HIGH, 1*BOX_WIDE/3, CHR_HIGH),
-1
}, glyph_lf[] = {
SEG(1*BOX_WIDE/10, 0, 1*BOX_WIDE/10,9*MID_HIGH/12), /* L */
SEG(1*BOX_WIDE/10,9*MID_HIGH/12,6*BOX_WIDE/10,9*MID_HIGH/12),
SEG(1*BOX_WIDE/3, MID_HIGH, CHR_WIDE, MID_HIGH), /* F */
SEG(1*BOX_WIDE/3, 8*MID_HIGH/6,10*CHR_WIDE/12,8*MID_HIGH/6),
SEG(1*BOX_WIDE/3, MID_HIGH, 1*BOX_WIDE/3, CHR_HIGH),
-1
}, glyph_nl[] = {
SEG(1*BOX_WIDE/10,5*MID_HIGH/6, 1*BOX_WIDE/10, 0), /* N */
SEG(1*BOX_WIDE/10, 0, 5*BOX_WIDE/6, 5*MID_HIGH/6),
SEG(5*BOX_WIDE/6, 5*MID_HIGH/6, 5*BOX_WIDE/6, 0),
SEG(1*BOX_WIDE/3, MID_HIGH, 1*BOX_WIDE/3, CHR_HIGH), /* L */
SEG(1*BOX_WIDE/3, CHR_HIGH, CHR_WIDE, CHR_HIGH),
-1
}, glyph_vt[] = {
SEG(1*BOX_WIDE/10, 0, 5*BOX_WIDE/12,5*MID_HIGH/6), /* V */
SEG(5*BOX_WIDE/12,5*MID_HIGH/6, 5*BOX_WIDE/6, 0),
SEG(2*BOX_WIDE/10, MID_HIGH, CHR_WIDE, MID_HIGH), /* T */
SEG(6*BOX_WIDE/10, MID_HIGH, 6*BOX_WIDE/10, CHR_HIGH),
-1
}, plus_or_minus[] =
{
SEG( 0, 5*BOX_HIGH/6, CHR_WIDE, 5*BOX_HIGH/6),
SEG( MID_WIDE, 2*BOX_HIGH/6, MID_WIDE, 4*BOX_HIGH/6),
SEG( 0, 3*BOX_HIGH/6, CHR_WIDE, 3*BOX_HIGH/6),
-1
}, lower_right_corner[] =
{
SEG( 0, MID_HIGH, MID_WIDE, MID_HIGH),
SEG( MID_WIDE, MID_HIGH, MID_WIDE, 0),
-1
}, upper_right_corner[] =
{
SEG( 0, MID_HIGH, MID_WIDE, MID_HIGH),
SEG( MID_WIDE, MID_HIGH, MID_WIDE, BOX_HIGH),
-1
}, upper_left_corner[] =
{
SEG( MID_WIDE, MID_HIGH, BOX_WIDE, MID_HIGH),
SEG( MID_WIDE, MID_HIGH, MID_WIDE, BOX_HIGH),
-1
}, lower_left_corner[] =
{
SEG( MID_WIDE, 0, MID_WIDE, MID_HIGH),
SEG( MID_WIDE, MID_WIDE, BOX_WIDE, MID_HIGH),
-1
}, cross[] =
{
SEG( 0, MID_HIGH, BOX_WIDE, MID_HIGH),
SEG( MID_WIDE, 0, MID_WIDE, BOX_HIGH),
-1
}, scan_line_1[] =
{
SEG( 0, 0, BOX_WIDE, 0),
-1
}, scan_line_3[] =
{
SEG( 0, BOX_HIGH/4, BOX_WIDE, BOX_HIGH/4),
-1
}, scan_line_7[] =
{
SEG( 0, MID_HIGH, BOX_WIDE, MID_HIGH),
-1
}, scan_line_9[] =
{
SEG( 0, 3*BOX_HIGH/4, BOX_WIDE, 3*BOX_HIGH/4),
-1
}, horizontal_line[] =
{
SEG( 0, BOX_HIGH, BOX_WIDE, BOX_HIGH),
-1
}, left_tee[] =
{
SEG( MID_WIDE, 0, MID_WIDE, BOX_HIGH),
SEG( MID_WIDE, MID_HIGH, BOX_WIDE, MID_HIGH),
-1
}, right_tee[] =
{
SEG( MID_WIDE, 0, MID_WIDE, BOX_HIGH),
SEG( MID_WIDE, MID_HIGH, 0, MID_HIGH),
-1
}, bottom_tee[] =
{
SEG( 0, MID_HIGH, BOX_WIDE, MID_HIGH),
SEG( MID_WIDE, 0, MID_WIDE, MID_HIGH),
-1
}, top_tee[] =
{
SEG( 0, MID_HIGH, BOX_WIDE, MID_HIGH),
SEG( MID_WIDE, MID_HIGH, MID_WIDE, BOX_HIGH),
-1
}, vertical_line[] =
{
SEG( MID_WIDE, 0, MID_WIDE, BOX_HIGH),
-1
}, less_than_or_equal[] =
{
SEG( CHR_WIDE, BOX_HIGH/3, 0, MID_HIGH),
SEG( CHR_WIDE, 2*BOX_HIGH/3, 0, MID_HIGH),
SEG( 0, 3*BOX_HIGH/4, CHR_WIDE, 3*BOX_HIGH/4),
-1
}, greater_than_or_equal[] =
{
SEG( 0, BOX_HIGH/3, CHR_WIDE, MID_HIGH),
SEG( 0, 2*BOX_HIGH/3, CHR_WIDE, MID_HIGH),
SEG( 0, 3*BOX_HIGH/4, CHR_WIDE, 3*BOX_HIGH/4),
-1
}, greek_pi[] =
{
SEG( 0, MID_HIGH, CHR_WIDE, MID_HIGH),
SEG(5*CHR_WIDE/6, MID_HIGH, 5*CHR_WIDE/6, CHR_HIGH),
SEG(2*CHR_WIDE/6, MID_HIGH, 2*CHR_WIDE/6, CHR_HIGH),
-1
}, not_equal_to[] =
{
SEG(2*BOX_WIDE/3, 1*BOX_HIGH/3, 1*BOX_WIDE/3, CHR_HIGH),
SEG( 0, 2*BOX_HIGH/3, CHR_WIDE, 2*BOX_HIGH/3),
SEG( 0, MID_HIGH, CHR_WIDE, MID_HIGH),
-1
};
/* *INDENT-ON* */
static const short *lines[] =
{
0, /* 00 (unused) */
0, /* 01 diamond */
0, /* 02 box */
glyph_ht, /* 03 HT */
glyph_ff, /* 04 FF */
0, /* 05 CR */
glyph_lf, /* 06 LF */
0, /* 07 degrees (small circle) */
plus_or_minus, /* 08 */
glyph_nl, /* 09 */
glyph_vt, /* 0A */
lower_right_corner, /* 0B */
upper_right_corner, /* 0C */
upper_left_corner, /* 0D */
lower_left_corner, /* 0E */
cross, /* 0F */
scan_line_1, /* 10 */
scan_line_3, /* 11 */
scan_line_7, /* 12 */
scan_line_9, /* 13 */
horizontal_line, /* 14 */
left_tee, /* 15 */
right_tee, /* 16 */
bottom_tee, /* 17 */
top_tee, /* 18 */
vertical_line, /* 19 */
less_than_or_equal, /* 1A */
greater_than_or_equal, /* 1B */
greek_pi, /* 1C */
not_equal_to, /* 1D */
0, /* 1E LB */
0, /* 1F bullet */
};
GC gc2;
CgsEnum cgsId = (ch == 2) ? gcDots : gcLine;
VTwin *cgsWin = WhichVWin(screen);
const short *p;
unsigned font_width = (unsigned) (((flags & DOUBLEWFONT) ? 2 : 1) * screen->fnt_wide);
unsigned font_height = (unsigned) (((flags & DOUBLEHFONT) ? 2 : 1) * screen->fnt_high);
if (cells > 1)
font_width *= (unsigned) cells;
#if OPT_WIDE_CHARS
/*
* Try to show line-drawing characters if we happen to be in UTF-8
* mode, but have gotten an old-style font.
*/
if (screen->utf8_mode
#if OPT_RENDERFONT
&& !UsingRenderFont(xw)
#endif
&& (ch > 127)
&& (ch != UCS_REPL)) {
unsigned n;
for (n = 1; n < 32; n++) {
if (dec2ucs(n) == ch
&& !((flags & BOLD)
? IsXtermMissingChar(screen, n, &screen->fnts[fBold])
: IsXtermMissingChar(screen, n, &screen->fnts[fNorm]))) {
TRACE(("...use xterm-style linedrawing\n"));
ch = n;
break;
}
}
}
#endif
TRACE(("DRAW_BOX(%d) cell %dx%d at %d,%d%s\n",
ch, font_height, font_width, y, x,
(ch >= (sizeof(lines) / sizeof(lines[0]))
? "-BAD"
: "")));
if (cgsId == gcDots) {
setCgsFont(xw, cgsWin, cgsId, getCgsFont(xw, cgsWin, gc));
setCgsFore(xw, cgsWin, cgsId, getCgsFore(xw, cgsWin, gc));
setCgsBack(xw, cgsWin, cgsId, getCgsBack(xw, cgsWin, gc));
} else {
setCgsFont(xw, cgsWin, cgsId, getCgsFont(xw, cgsWin, gc));
setCgsFore(xw, cgsWin, cgsId, getCgsBack(xw, cgsWin, gc));
setCgsBack(xw, cgsWin, cgsId, getCgsBack(xw, cgsWin, gc));
}
gc2 = getCgsGC(xw, cgsWin, cgsId);
if (!(flags & NOBACKGROUND)) {
XFillRectangle(screen->display, VDrawable(screen), gc2, x, y,
font_width,
font_height);
}
setCgsFont(xw, cgsWin, cgsId, getCgsFont(xw, cgsWin, gc));
setCgsFore(xw, cgsWin, cgsId, getCgsFore(xw, cgsWin, gc));
setCgsBack(xw, cgsWin, cgsId, getCgsBack(xw, cgsWin, gc));
gc2 = getCgsGC(xw, cgsWin, cgsId);
XSetLineAttributes(screen->display, gc2,
(flags & BOLD)
? ((font_height > 12)
? font_height / 12
: 1)
: ((font_height > 16)
? font_height / 16
: 1),
LineSolid,
CapProjecting,
JoinMiter);
if (ch == 1) { /* diamond */
XPoint points[5];
int npoints = 5, n;
points[0].x = MID_WIDE;
points[0].y = BOX_HIGH / 4;
points[1].x = 8 * BOX_WIDE / 8;
points[1].y = MID_HIGH;
points[2].x = points[0].x;
points[2].y = 3 * BOX_HIGH / 4;
points[3].x = 0 * BOX_WIDE / 8;
points[3].y = points[1].y;
points[4].x = points[0].x;
points[4].y = points[0].y;
for (n = 0; n < npoints; ++n) {
points[n].x = (short) SCALED_X(points[n].x);
points[n].y = (short) SCALED_Y(points[n].y);
points[n].x = (short) (points[n].x + x);
points[n].y = (short) (points[n].y + y);
}
XFillPolygon(screen->display,
VDrawable(screen), gc2,
points, npoints,
Convex, CoordModeOrigin);
} else if (ch == 7) { /* degrees */
unsigned width = (BOX_WIDE / 3);
int x_coord = MID_WIDE - (int) (width / 2);
int y_coord = MID_HIGH - (int) width;
SCALE_X(x_coord);
SCALE_Y(y_coord);
width = (unsigned) SCALED_X(width);
XDrawArc(screen->display,
VDrawable(screen), gc2,
x + x_coord, y + y_coord, width, width,
0,
360 * 64);
} else if (ch == 0x1f) { /* bullet */
unsigned width = 7 * BOX_WIDE / 10;
int x_coord = MID_WIDE - (int) (width / 3);
int y_coord = MID_HIGH - (int) (width / 3);
SCALE_X(x_coord);
SCALE_Y(y_coord);
width = (unsigned) SCALED_X(width);
XDrawArc(screen->display,
VDrawable(screen), gc2,
x + x_coord, y + y_coord, width, width,
0,
360 * 64);
} else if (ch < (sizeof(lines) / sizeof(lines[0]))
&& (p = lines[ch]) != 0) {
int coord[4];
int n = 0;
while (*p >= 0) {
coord[n++] = *p++;
if (n == 4) {
SCALE_X(coord[0]);
SCALE_Y(coord[1]);
SCALE_X(coord[2]);
SCALE_Y(coord[3]);
XDrawLine(screen->display,
VDrawable(screen), gc2,
x + coord[0], y + coord[1],
x + coord[2], y + coord[3]);
n = 0;
}
}
} else if (screen->force_all_chars) {
/* bounding rectangle, for debugging */
XDrawRectangle(screen->display, VDrawable(screen), gc2, x, y,
font_width - 1,
font_height - 1);
}
}
#if OPT_RENDERFONT
/*
* Check if the given character has a glyph known to Xft.
*
* see xc/lib/Xft/xftglyphs.c
*/
Bool
xtermXftMissing(XtermWidget xw, XftFont * font, unsigned wc)
{
Bool result = False;
if (font != 0) {
TScreen *screen = TScreenOf(xw);
if (!XftGlyphExists(screen->display, font, wc)) {
#if OPT_WIDE_CHARS
TRACE(("xtermXftMissing %d (dec=%#x, ucs=%#x)\n",
wc, ucs2dec(wc), dec2ucs(wc)));
#else
TRACE(("xtermXftMissing %d\n", wc));
#endif
result = True;
}
}
return result;
}
#endif /* OPT_RENDERFONT && OPT_WIDE_CHARS */
#endif /* OPT_BOX_CHARS */
#if OPT_WIDE_CHARS
#define MY_UCS(ucs,dec) case ucs: result = dec; break
unsigned
ucs2dec(unsigned ch)
{
unsigned result = ch;
if ((ch > 127)
&& (ch != UCS_REPL)) {
switch (ch) {
MY_UCS(0x25ae, 0); /* black vertical rectangle */
MY_UCS(0x25c6, 1); /* black diamond */
MY_UCS(0x2592, 2); /* medium shade */
MY_UCS(0x2409, 3); /* symbol for horizontal tabulation */
MY_UCS(0x240c, 4); /* symbol for form feed */
MY_UCS(0x240d, 5); /* symbol for carriage return */
MY_UCS(0x240a, 6); /* symbol for line feed */
MY_UCS(0x00b0, 7); /* degree sign */
MY_UCS(0x00b1, 8); /* plus-minus sign */
MY_UCS(0x2424, 9); /* symbol for newline */
MY_UCS(0x240b, 10); /* symbol for vertical tabulation */
MY_UCS(0x2518, 11); /* box drawings light up and left */
MY_UCS(0x2510, 12); /* box drawings light down and left */
MY_UCS(0x250c, 13); /* box drawings light down and right */
MY_UCS(0x2514, 14); /* box drawings light up and right */
MY_UCS(0x253c, 15); /* box drawings light vertical and horizontal */
MY_UCS(0x23ba, 16); /* box drawings scan 1 */
MY_UCS(0x23bb, 17); /* box drawings scan 3 */
MY_UCS(0x2500, 18); /* box drawings light horizontal */
MY_UCS(0x23bc, 19); /* box drawings scan 7 */
MY_UCS(0x23bd, 20); /* box drawings scan 9 */
MY_UCS(0x251c, 21); /* box drawings light vertical and right */
MY_UCS(0x2524, 22); /* box drawings light vertical and left */
MY_UCS(0x2534, 23); /* box drawings light up and horizontal */
MY_UCS(0x252c, 24); /* box drawings light down and horizontal */
MY_UCS(0x2502, 25); /* box drawings light vertical */
MY_UCS(0x2264, 26); /* less-than or equal to */
MY_UCS(0x2265, 27); /* greater-than or equal to */
MY_UCS(0x03c0, 28); /* greek small letter pi */
MY_UCS(0x2260, 29); /* not equal to */
MY_UCS(0x00a3, 30); /* pound sign */
MY_UCS(0x00b7, 31); /* middle dot */
}
}
return result;
}
#undef MY_UCS
#define MY_UCS(ucs,dec) case dec: result = ucs; break
unsigned
dec2ucs(unsigned ch)
{
unsigned result = ch;
if (xtermIsDecGraphic(ch)) {
switch (ch) {
MY_UCS(0x25ae, 0); /* black vertical rectangle */
MY_UCS(0x25c6, 1); /* black diamond */
MY_UCS(0x2592, 2); /* medium shade */
MY_UCS(0x2409, 3); /* symbol for horizontal tabulation */
MY_UCS(0x240c, 4); /* symbol for form feed */
MY_UCS(0x240d, 5); /* symbol for carriage return */
MY_UCS(0x240a, 6); /* symbol for line feed */
MY_UCS(0x00b0, 7); /* degree sign */
MY_UCS(0x00b1, 8); /* plus-minus sign */
MY_UCS(0x2424, 9); /* symbol for newline */
MY_UCS(0x240b, 10); /* symbol for vertical tabulation */
MY_UCS(0x2518, 11); /* box drawings light up and left */
MY_UCS(0x2510, 12); /* box drawings light down and left */
MY_UCS(0x250c, 13); /* box drawings light down and right */
MY_UCS(0x2514, 14); /* box drawings light up and right */
MY_UCS(0x253c, 15); /* box drawings light vertical and horizontal */
MY_UCS(0x23ba, 16); /* box drawings scan 1 */
MY_UCS(0x23bb, 17); /* box drawings scan 3 */
MY_UCS(0x2500, 18); /* box drawings light horizontal */
MY_UCS(0x23bc, 19); /* box drawings scan 7 */
MY_UCS(0x23bd, 20); /* box drawings scan 9 */
MY_UCS(0x251c, 21); /* box drawings light vertical and right */
MY_UCS(0x2524, 22); /* box drawings light vertical and left */
MY_UCS(0x2534, 23); /* box drawings light up and horizontal */
MY_UCS(0x252c, 24); /* box drawings light down and horizontal */
MY_UCS(0x2502, 25); /* box drawings light vertical */
MY_UCS(0x2264, 26); /* less-than or equal to */
MY_UCS(0x2265, 27); /* greater-than or equal to */
MY_UCS(0x03c0, 28); /* greek small letter pi */
MY_UCS(0x2260, 29); /* not equal to */
MY_UCS(0x00a3, 30); /* pound sign */
MY_UCS(0x00b7, 31); /* middle dot */
}
}
return result;
}
#endif /* OPT_WIDE_CHARS */
#if OPT_SHIFT_FONTS
static int
lookupOneFontSize(XtermWidget xw, int fontnum)
{
TScreen *screen = TScreenOf(xw);
if (screen->menu_font_sizes[fontnum] == 0) {
XTermFonts fnt;
memset(&fnt, 0, sizeof(fnt));
screen->menu_font_sizes[fontnum] = -1;
if (xtermOpenFont(xw,
screen->MenuFontName(fontnum),
&fnt,
((fontnum <= fontMenu_lastBuiltin)
? fwAlways
: fwResource),
True)) {
if (fontnum <= fontMenu_lastBuiltin
|| strcmp(fnt.fn, DEFFONT)) {
screen->menu_font_sizes[fontnum] = FontSize(fnt.fs);
if (screen->menu_font_sizes[fontnum] <= 0)
screen->menu_font_sizes[fontnum] = -1;
}
xtermCloseFont(xw, &fnt);
}
}
return (screen->menu_font_sizes[fontnum] > 0);
}
/*
* Cache the font-sizes so subsequent larger/smaller font actions will go fast.
*/
static void
lookupFontSizes(XtermWidget xw)
{
int n;
for (n = 0; n < NMENUFONTS; n++) {
(void) lookupOneFontSize(xw, n);
}
}
#if OPT_RENDERFONT
static void
fillInFaceSize(XtermWidget xw, int fontnum)
{
TScreen *screen = TScreenOf(xw);
float value;
double face_size = xw->misc.face_size[fontnum];
if (face_size <= 0.0) {
#if OPT_SHIFT_FONTS
/*
* If the user is switching font-sizes, make it follow by
* default the same ratios to the default as the fixed fonts
* would, for easy comparison. There will be some differences
* since the fixed fonts have a variety of height/width ratios,
* but this is simpler than adding another resource value - and
* as noted above, the data for the fixed fonts are available.
*/
(void) lookupOneFontSize(xw, 0);
if (fontnum == fontMenu_default) {
sscanf(DEFFACESIZE, "%f", &value);
face_size = value;
} else if (lookupOneFontSize(xw, fontnum)
&& (screen->menu_font_sizes[0]
!= screen->menu_font_sizes[fontnum])) {
double ratio;
long num = screen->menu_font_sizes[fontnum];
long den = screen->menu_font_sizes[0];
if (den <= 0)
den = 1;
ratio = dimSquareRoot((double) num / (double) den);
face_size = (ratio * xw->misc.face_size[0]);
TRACE(("scaled[%d] using %3ld/%ld = %.2f -> %f\n",
fontnum, num, den, ratio, face_size));
} else
#endif
{
#define LikeBitmap(s) (((s) / 78.0) * xw->misc.face_size[fontMenu_default])
switch (fontnum) {
case fontMenu_font1:
face_size = LikeBitmap(2.0);
break;
case fontMenu_font2:
face_size = LikeBitmap(35.0);
break;
case fontMenu_font3:
face_size = LikeBitmap(60.0);
break;
default:
sscanf(DEFFACESIZE, "%f", &value);
face_size = value;
break;
case fontMenu_font4:
face_size = LikeBitmap(90.0);
break;
case fontMenu_font5:
face_size = LikeBitmap(135.0);
break;
case fontMenu_font6:
face_size = LikeBitmap(200.0);
break;
}
TRACE(("builtin[%d] -> %f\n", fontnum, face_size));
}
xw->misc.face_size[fontnum] = (float) face_size;
}
}
/* no selection or escape */
#define NMENU_RENDERFONTS (fontMenu_lastBuiltin + 1)
/*
* Workaround for breakage in font-packages - check if all of the bitmap font
* sizes are the same, and if we're using TrueType fonts.
*/
static Boolean
useFaceSizes(XtermWidget xw)
{
Boolean result = False;
int n;
TRACE(("useFaceSizes {{\n"));
if (UsingRenderFont(xw)) {
Boolean nonzero = True;
for (n = 0; n < NMENU_RENDERFONTS; ++n) {
if (xw->misc.face_size[n] <= 0.0) {
nonzero = False;
break;
}
}
if (!nonzero) {
Boolean broken_fonts = True;
TScreen *screen = TScreenOf(xw);
long first;
lookupFontSizes(xw);
first = screen->menu_font_sizes[0];
for (n = 0; n < NMENUFONTS; n++) {
if (screen->menu_font_sizes[n] > 0
&& screen->menu_font_sizes[n] != first) {
broken_fonts = False;
break;
}
}
if (broken_fonts) {
TRACE(("bitmap fonts are broken - set faceSize resources\n"));
for (n = 0; n < NMENUFONTS; n++) {
fillInFaceSize(xw, n);
}
}
}
result = True;
}
TRACE(("...}}useFaceSizes %d\n", result));
return result;
}
#endif /* OPT_RENDERFONT */
/*
* Find the index of a larger/smaller font (according to the sign of 'relative'
* and its magnitude), starting from the 'old' index.
*/
int
lookupRelativeFontSize(XtermWidget xw, int old, int relative)
{
TScreen *screen = TScreenOf(xw);
int n, m = -1;
TRACE(("lookupRelativeFontSize(old=%d, relative=%d)\n", old, relative));
if (!IsIcon(screen)) {
#if OPT_RENDERFONT
if (useFaceSizes(xw)) {
TRACE(("...using FaceSize\n"));
if (relative != 0) {
for (n = 0; n < NMENU_RENDERFONTS; ++n) {
fillInFaceSize(xw, n);
if (xw->misc.face_size[n] > 0 &&
xw->misc.face_size[n] != xw->misc.face_size[old]) {
int cmp_0 = ((xw->misc.face_size[n] >
xw->misc.face_size[old])
? relative
: -relative);
int cmp_m = ((m < 0)
? 1
: ((xw->misc.face_size[n] <
xw->misc.face_size[m])
? relative
: -relative));
if (cmp_0 > 0 && cmp_m > 0) {
m = n;
}
}
}
}
} else
#endif
{
TRACE(("...using bitmap areas\n"));
lookupFontSizes(xw);
if (relative != 0) {
for (n = 0; n < NMENUFONTS; ++n) {
if (screen->menu_font_sizes[n] > 0 &&
screen->menu_font_sizes[n] !=
screen->menu_font_sizes[old]) {
int cmp_0 = ((screen->menu_font_sizes[n] >
screen->menu_font_sizes[old])
? relative
: -relative);
int cmp_m = ((m < 0)
? 1
: ((screen->menu_font_sizes[n] <
screen->menu_font_sizes[m])
? relative
: -relative));
if (cmp_0 > 0 && cmp_m > 0) {
m = n;
}
}
}
}
}
TRACE(("...new index %d\n", m));
if (m >= 0) {
if (relative > 1)
m = lookupRelativeFontSize(xw, m, relative - 1);
else if (relative < -1)
m = lookupRelativeFontSize(xw, m, relative + 1);
}
}
return m;
}
/* ARGSUSED */
void
HandleLargerFont(Widget w GCC_UNUSED,
XEvent * event GCC_UNUSED,
String *params GCC_UNUSED,
Cardinal *param_count GCC_UNUSED)
{
XtermWidget xw;
TRACE(("Handle larger-vt-font for %p\n", (void *) w));
if ((xw = getXtermWidget(w)) != 0) {
if (xw->misc.shift_fonts) {
TScreen *screen = TScreenOf(xw);
int m;
m = lookupRelativeFontSize(xw, screen->menu_font_number, 1);
if (m >= 0) {
SetVTFont(xw, m, True, NULL);
} else {
Bell(xw, XkbBI_MinorError, 0);
}
}
}
}
/* ARGSUSED */
void
HandleSmallerFont(Widget w GCC_UNUSED,
XEvent * event GCC_UNUSED,
String *params GCC_UNUSED,
Cardinal *param_count GCC_UNUSED)
{
XtermWidget xw;
TRACE(("Handle smaller-vt-font for %p\n", (void *) w));
if ((xw = getXtermWidget(w)) != 0) {
if (xw->misc.shift_fonts) {
TScreen *screen = TScreenOf(xw);
int m;
m = lookupRelativeFontSize(xw, screen->menu_font_number, -1);
if (m >= 0) {
SetVTFont(xw, m, True, NULL);
} else {
Bell(xw, XkbBI_MinorError, 0);
}
}
}
}
#endif
int
xtermGetFont(const char *param)
{
int fontnum;
switch (param[0]) {
case 'd':
case 'D':
case '0':
fontnum = fontMenu_default;
break;
case '1':
fontnum = fontMenu_font1;
break;
case '2':
fontnum = fontMenu_font2;
break;
case '3':
fontnum = fontMenu_font3;
break;
case '4':
fontnum = fontMenu_font4;
break;
case '5':
fontnum = fontMenu_font5;
break;
case '6':
fontnum = fontMenu_font6;
break;
case 'e':
case 'E':
fontnum = fontMenu_fontescape;
break;
case 's':
case 'S':
fontnum = fontMenu_fontsel;
break;
default:
fontnum = -1;
break;
}
return fontnum;
}
/* ARGSUSED */
void
HandleSetFont(Widget w GCC_UNUSED,
XEvent * event GCC_UNUSED,
String *params,
Cardinal *param_count)
{
XtermWidget xw;
if ((xw = getXtermWidget(w)) != 0) {
int fontnum;
VTFontNames fonts;
memset(&fonts, 0, sizeof(fonts));
if (*param_count == 0) {
fontnum = fontMenu_default;
} else {
Cardinal maxparams = 1; /* total number of params allowed */
int result = xtermGetFont(params[0]);
switch (result) {
case fontMenu_default: /* FALLTHRU */
case fontMenu_font1: /* FALLTHRU */
case fontMenu_font2: /* FALLTHRU */
case fontMenu_font3: /* FALLTHRU */
case fontMenu_font4: /* FALLTHRU */
case fontMenu_font5: /* FALLTHRU */
case fontMenu_font6: /* FALLTHRU */
break;
case fontMenu_fontescape:
#if OPT_WIDE_CHARS
maxparams = 5;
#else
maxparams = 3;
#endif
break;
case fontMenu_fontsel:
maxparams = 2;
break;
default:
Bell(xw, XkbBI_MinorError, 0);
return;
}
fontnum = result;
if (*param_count > maxparams) { /* see if extra args given */
Bell(xw, XkbBI_MinorError, 0);
return;
}
switch (*param_count) { /* assign 'em */
#if OPT_WIDE_CHARS
case 5:
fonts.f_wb = params[4];
/* FALLTHRU */
case 4:
fonts.f_w = params[3];
/* FALLTHRU */
#endif
case 3:
fonts.f_b = params[2];
/* FALLTHRU */
case 2:
fonts.f_n = params[1];
break;
}
}
SetVTFont(xw, fontnum, True, &fonts);
}
}
void
SetVTFont(XtermWidget xw,
int which,
Bool doresize,
const VTFontNames * fonts)
{
TScreen *screen = TScreenOf(xw);
TRACE(("SetVTFont(which=%d, f_n=%s, f_b=%s)\n", which,
(fonts && fonts->f_n) ? fonts->f_n : "",
(fonts && fonts->f_b) ? fonts->f_b : ""));
if (IsIcon(screen)) {
Bell(xw, XkbBI_MinorError, 0);
} else if (which >= 0 && which < NMENUFONTS) {
VTFontNames myfonts;
memset(&myfonts, 0, sizeof(myfonts));
if (fonts != 0)
myfonts = *fonts;
if (which == fontMenu_fontsel) { /* go get the selection */
FindFontSelection(xw, myfonts.f_n, False);
} else {
int oldFont = screen->menu_font_number;
#define USE_CACHED(field, name) \
if (myfonts.field == 0) { \
myfonts.field = x_strdup(screen->menu_font_names[which][name]); \
TRACE(("set myfonts." #field " from menu_font_names[%d][" #name "] %s\n", \
which, NonNull(myfonts.field))); \
} else { \
TRACE(("set myfonts." #field " reused\n")); \
}
#define SAVE_FNAME(field, name) \
if (myfonts.field != 0) { \
if (screen->menu_font_names[which][name] == 0 \
|| strcmp(screen->menu_font_names[which][name], myfonts.field)) { \
TRACE(("updating menu_font_names[%d][" #name "] to %s\n", \
which, myfonts.field)); \
screen->menu_font_names[which][name] = x_strdup(myfonts.field); \
} \
}
USE_CACHED(f_n, fNorm);
USE_CACHED(f_b, fBold);
#if OPT_WIDE_CHARS
USE_CACHED(f_w, fWide);
USE_CACHED(f_wb, fWBold);
#endif
if (xtermLoadFont(xw,
&myfonts,
doresize, which)) {
/*
* If successful, save the data so that a subsequent query via
* OSC-50 will return the expected values.
*/
SAVE_FNAME(f_n, fNorm);
SAVE_FNAME(f_b, fBold);
#if OPT_WIDE_CHARS
SAVE_FNAME(f_w, fWide);
SAVE_FNAME(f_wb, fWBold);
#endif
} else {
xtermLoadFont(xw,
xtermFontName(screen->MenuFontName(oldFont)),
doresize, oldFont);
Bell(xw, XkbBI_MinorError, 0);
}
}
} else {
Bell(xw, XkbBI_MinorError, 0);
}
return;
}
xterm-297/XTerm-col.ad 0000644 0001751 0000144 00000013302 11241555255 013377 0 ustar tom users ! $XTermId: XTerm-col.ad,v 1.22 2009/08/15 15:56:29 tom Exp $
! -----------------------------------------------------------------------------
! this file is part of xterm
!
! Copyright 2002-2006,2009 by Thomas E. Dickey
!
! All Rights Reserved
!
! Permission is hereby granted, free of charge, to any person obtaining a
! copy of this software and associated documentation files (the
! "Software"), to deal in the Software without restriction, including
! without limitation the rights to use, copy, modify, merge, publish,
! distribute, sublicense, and/or sell copies of the Software, and to
! permit persons to whom the Software is furnished to do so, subject to
! the following conditions:
!
! The above copyright notice and this permission notice shall be included
! in all copies or substantial portions of the Software.
!
! THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
! OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
! MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
! IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
! CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
! TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
! SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
!
! Except as contained in this notice, the name(s) of the above copyright
! holders shall not be used in advertising or otherwise to promote the
! sale, use or other dealings in this Software without prior written
! authorization.
! -----------------------------------------------------------------------------
#include "XTerm"
*VT100*colorMode: on
*VT100*boldColors: on
*VT100*dynamicColors: on
! Uncomment this for "white" text on a dark background.
!*VT100*foreground: gray90
!*VT100*background: black
! - OR -
! Uncomment this for black text on a "white" background.
!*VT100*foreground: black
!*VT100*background: gray90
! - OR -
! leave the foreground/background colors alone (at the mercy of your desktop
! designer).
! Color the popup/pulldown menu border to match the text widget foreground.
!*SimpleMenu*borderColor: gray15
! Uncomment this to use color for underline attribute
!*VT100*colorULMode: on
*VT100*colorUL: yellow
!*VT100*italicULMode: on
! Uncomment this to disable underlining, e.g., if colorULMode is set.
!*VT100*underLine: off
! Uncomment this to use color for the bold attribute
!*VT100*colorBDMode: on
*VT100*colorBD: white
! Uncomment this to use the bold/underline colors in preference to other colors
!*VT100*colorAttrMode: on
! These are the 8 ANSI colors and their bright equivalents. Depending on
! other resource settings, xterm may use the bright colors when displaying
! bold text (see the boldColors resource).
*VT100*color0: black
*VT100*color1: red3
*VT100*color2: green3
*VT100*color3: yellow3
*VT100*color4: blue2
*VT100*color5: magenta3
*VT100*color6: cyan3
*VT100*color7: gray90
*VT100*color8: gray50
*VT100*color9: red
*VT100*color10: green
*VT100*color11: yellow
*VT100*color12: rgb:5c/5c/ff
*VT100*color13: magenta
*VT100*color14: cyan
*VT100*color15: white
! Disclaimer: there are no standard colors used in terminal emulation.
!
! The choice for color4 and color12 is a tradeoff between contrast, depending
! on whether they are used for text or backgrounds. Note that either color4 or
! color12 would be used for text, while only color4 would be used for a
! background. These are treated specially, since the luminosity of blue is
! only about half that of red/green, and is typically not accounted for in the
! RGB scheme.
!
! Blue text on a black background should be readable.
! Blue backgrounds should not be "too" bright.
!
! Originally color4/color12 were set to the names blue3/blue
!*VT100*color4: blue3
!*VT100*color12: blue
!
! They are from rgb.txt respectively:
! 0 0 205 blue3
! 0 0 255 blue
! However, blue3 is not readable on a black background.
!
! Another choice was from the Debian settings:
!*VT100*color4: DodgerBlue1
!*VT100*color12: SteelBlue1
!
! From rgb.txt:
! 30 144 255 DodgerBlue1
! 99 184 255 SteelBlue1
!
! Some users object to this choice because the background (color4) is brighter
! than they are accustomed. Others point out that the different weights for
! the red/green components make it appear to be not really blue. Finally, it
! provides poor contrast against color13 and color14.
!
! The current choice uses equal weights for red/green (effectively adding a
! gray to the result). It is brighter than the original choice, and provides
! more contrast between color12 and color13, color14 than SteelBlue1 did.
! Contrast of color4 against black is slightly improved over the original.
!
! Some refinement is certainly possible (you are welcome to try) -TD
#if PLANES > 8
! Color the popup menus and the menubar to match:
*SimpleMenu*background: AntiqueWhite
*SimpleMenu*foreground: gray15
! Color the menubar to match:
*Form.menubar.background: AntiqueWhite
*Form.menubar*background: AntiqueWhite
*Form.menubar.foreground: gray15
*Form.menubar*foreground: gray15
*Form.background: AntiqueWhite
*form.background: AntiqueWhite
! The following two sections take advantage of new features in version 7
! of the Athena widget library. Comment them out if you have a shallow
! color depth.
!*SimpleMenu*backgroundPixmap: gradient:vertical?dimension=350&start=gray90&end=gray60
!*SimpleMenu*foreground: gray15
!*VT100.scrollbar.thumb: vlines2
!*VT100.scrollbar.width: 14
!*VT100.scrollbar.background: gray60
!*VT100.scrollbar.foreground: rgb:a/5/5
!*VT100.scrollbar.borderWidth: 0
!*VT100.scrollbar.displayList:\
!foreground gray90;\
!lines 1,-1,-1,-1,-1,1;\
!foreground gray60;\
!lines -1,0,0,0,0,-1
#endif
xterm-297/charclass.c 0000644 0001751 0000144 00000013120 11274661707 013372 0 ustar tom users /* $XTermId: charclass.c,v 1.22 2009/11/05 23:46:15 tom Exp $ */
/*
* Compact and efficient reimplementation of the
* xterm character class mechanism for large character sets
*
* Markus Kuhn -- mkuhn@acm.org -- 2000-07-03
*
* Xterm allows users to select entire words with a double-click on the left
* mouse button. Opinions might differ on what type of characters are part of
* separate words, therefore xterm allows users to configure a class code for
* each 8-bit character. Words are maximum length sequences of neighboring
* characters with identical class code. Extending this mechanism to Unicode
* naively would create an at least 2^16 entries (128 kB) long class code
* table.
*
* Instead, we transform the character class table into a list of intervals,
* that will be accessed via a linear search. Changes made to the table by the
* user will be appended. A special class code IDENT (default) marks
* characters who have their code number as the class code.
*
* We could alternatively use a sorted table of non-overlapping intervals that
* can be accessed via binary search, but merging in new intervals is
* significantly more hassle and not worth the effort here.
*/
#include
#include
#if OPT_WIDE_CHARS
static struct classentry {
int cclass;
int first;
int last;
} *classtab;
/*
* Special convention for classtab[0]:
* - classtab[0].cclass is the allocated number of entries in classtab
* - classtab[0].first = 1 (first used entry in classtab)
* - classtab[0].last is the last used entry in classtab
*/
int
SetCharacterClassRange(int low, int high, int value)
{
if (high < low)
return -1; /* nothing to do */
/* make sure we have at least one free entry left at table end */
if (classtab[0].last > classtab[0].cclass - 2) {
classtab[0].cclass += 5 + classtab[0].cclass / 4;
classtab = TypeRealloc(struct classentry,
(unsigned) classtab[0].cclass, classtab);
if (!classtab)
abort();
}
/* simply append new interval to end of interval array */
classtab[0].last++;
classtab[classtab[0].last].first = low;
classtab[classtab[0].last].last = high;
classtab[classtab[0].last].cclass = value;
return 0;
}
typedef enum {
IDENT = -1,
ALNUM = 48,
CNTRL = 1,
BLANK = 32
} Classes;
void
init_classtab(void)
{
const int size = 50;
classtab = TypeMallocN(struct classentry, (unsigned) size);
if (!classtab)
abort();
classtab[0].cclass = size;
classtab[0].first = 1;
classtab[0].last = 0;
/* old xterm default classes */
SetCharacterClassRange(0, 0, BLANK);
SetCharacterClassRange(1, 31, CNTRL);
SetCharacterClassRange('\t', '\t', BLANK);
SetCharacterClassRange('0', '9', ALNUM);
SetCharacterClassRange('A', 'Z', ALNUM);
SetCharacterClassRange('_', '_', ALNUM);
SetCharacterClassRange('a', 'z', ALNUM);
SetCharacterClassRange(127, 159, CNTRL);
SetCharacterClassRange(160, 191, IDENT);
SetCharacterClassRange(192, 255, ALNUM);
SetCharacterClassRange(215, 215, IDENT);
SetCharacterClassRange(247, 247, IDENT);
/* added Unicode classes */
SetCharacterClassRange(0x0100, 0xffdf, ALNUM); /* mostly characters */
SetCharacterClassRange(0x037e, 0x037e, IDENT); /* Greek question mark */
SetCharacterClassRange(0x0387, 0x0387, IDENT); /* Greek ano teleia */
SetCharacterClassRange(0x055a, 0x055f, IDENT); /* Armenian punctuation */
SetCharacterClassRange(0x0589, 0x0589, IDENT); /* Armenian full stop */
SetCharacterClassRange(0x0700, 0x070d, IDENT); /* Syriac punctuation */
SetCharacterClassRange(0x104a, 0x104f, IDENT); /* Myanmar punctuation */
SetCharacterClassRange(0x10fb, 0x10fb, IDENT); /* Georgian punctuation */
SetCharacterClassRange(0x1361, 0x1368, IDENT); /* Ethiopic punctuation */
SetCharacterClassRange(0x166d, 0x166e, IDENT); /* Canadian Syl. punctuation */
SetCharacterClassRange(0x17d4, 0x17dc, IDENT); /* Khmer punctuation */
SetCharacterClassRange(0x1800, 0x180a, IDENT); /* Mongolian punctuation */
SetCharacterClassRange(0x2000, 0x200a, BLANK); /* spaces */
SetCharacterClassRange(0x200b, 0x27ff, IDENT); /* punctuation and symbols */
SetCharacterClassRange(0x2070, 0x207f, 0x2070); /* superscript */
SetCharacterClassRange(0x2080, 0x208f, 0x2080); /* subscript */
SetCharacterClassRange(0x3000, 0x3000, BLANK); /* ideographic space */
SetCharacterClassRange(0x3001, 0x3020, IDENT); /* ideographic punctuation */
SetCharacterClassRange(0x3040, 0x309f, 0x3040); /* Hiragana */
SetCharacterClassRange(0x30a0, 0x30ff, 0x30a0); /* Katakana */
SetCharacterClassRange(0x3300, 0x9fff, 0x4e00); /* CJK Ideographs */
SetCharacterClassRange(0xac00, 0xd7a3, 0xac00); /* Hangul Syllables */
SetCharacterClassRange(0xf900, 0xfaff, 0x4e00); /* CJK Ideographs */
SetCharacterClassRange(0xfe30, 0xfe6b, IDENT); /* punctuation forms */
SetCharacterClassRange(0xff00, 0xff0f, IDENT); /* half/fullwidth ASCII */
SetCharacterClassRange(0xff1a, 0xff20, IDENT); /* half/fullwidth ASCII */
SetCharacterClassRange(0xff3b, 0xff40, IDENT); /* half/fullwidth ASCII */
SetCharacterClassRange(0xff5b, 0xff64, IDENT); /* half/fullwidth ASCII */
return;
}
int
CharacterClass(int c)
{
int i, cclass = IDENT;
for (i = classtab[0].first; i <= classtab[0].last; i++)
if (classtab[i].first <= c && classtab[i].last >= c)
cclass = classtab[i].cclass;
if (cclass < 0)
cclass = c;
return cclass;
}
#ifdef NO_LEAKS
void
noleaks_CharacterClass(void)
{
if (classtab != 0) {
free(classtab);
classtab = 0;
}
}
#endif
#endif /* OPT_WIDE_CHARS */
xterm-297/uxterm.desktop 0000644 0001751 0000144 00000003525 11771711255 014206 0 ustar tom users # $XTermId: uxterm.desktop,v 1.13 2012/06/24 22:20:29 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2006-2010,2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
[Desktop Entry]
Name=UXTerm
#GenericName=Terminal
Comment=standard terminal emulator for the X window system
Exec=uxterm
Terminal=false
Type=Application
Encoding=UTF-8
Icon=xterm-color_48x48
Categories=System;TerminalEmulator;
xterm-297/README.i18n 0000644 0001751 0000144 00000017514 07754555565 012750 0 ustar tom users -- $XFree86: xc/programs/xterm/README.i18n,v 1.1 2003/11/13 01:16:37 dickey Exp $
Using xterm in your language
============================
Since XFree86 version 4.0, the internationalization (i18n) feature of
xterm is gradually improved. Xterm is being improved even now. You
need only set the standard locale environment variables such as
LC_CTYPE, LC_ALL, LC_CTYPE, or LANG. Once the locale is set up you can
use xterm in your favorite character encoding.
This document explains how the i18n feature is realized and how to
configure xterm for your character encoding.
Refer to locale(7) for details of the locale mechanism.
Basic i18n-related settings and resources
=========================================
These settings apply to XFree86 xterm patch #181, and the program luit
which is distributed with XFree86 4.4
1. Usage of "locale mode"
On startup, xterm must be in "locale mode" to make it follow the
current locale. You can invoke xterm in locale mode in these ways:
a. Set "vt100.locale" resource "true". This resource was
introduced since XFree86 4.3. The default value of the "locale"
resource is "medium", which means xterm follows the locale only
in Chinese, Japanese, Korean, or Thai locales. For example,
XTerm*locale: true
in your ~/.Xresources file.
or
b. Invoke xterm with the "-lc" option.
2. Converter program "luit"
The "luit" must be available in the standard XFree86 binary
directory. It is usually available because it is part of the
XFree86 distribution. The standard binary directory may differ from
system to system. /usr/X11R6/bin/luit is an example.
"luit" is used to convert between Unicode and the character encoding
for your locale. When built for XFree86, xterm includes logic for
invoking luit.
3. Locale setting
Finally, you will need to configure your locale. We expect that you
have already configured your locale for other software. For example,
LANG=de_DE@euro
export LANG
in your ~/.xsession file. There are many ways to configure locale.
For example, your display manager may have a mechanism to invoke a
window manager in your favorite locale, or you may have system-wide
locale setting in /etc/environment. You may also have set the
LC_ALL variable instead of the LANG variable.
How to use xterm in different locale temporarily
================================================
You may sometimes need to invoke xterm in a different character encoding
than your current locale. For example, use xterm to login remote systems
in different locale.
Do this by invoking xterm in the target locale. For example,
$ LANG=ru_RU.KOI8-R xterm &
Previously, font setting has been used in such cases.
$ xterm -fn -misc-fixed-medium-r-normal--10-*-*-*-*-*-koi8-r &
This does not work well in conjunction with the "locale" resource,
because luit and xterm combined rely upon Unicode fonts.
How to set fonts for UTF-8/locale modes
=======================================
Since xterm patch #181, xterm can automatically use Unicode fonts in
UTF-8 mode and locale mode. Few of you will need to modify the default
setting to display your language. In particular, Unicode fonts in
combination with locale mode will satisfy the needs of not only
ISO-8859-1 users but also East Asian and other non-ISO-8859-1 users.
If you want to set your favorite Unicode font for UTF-8 and locale
modes, you should add a line such as the following in your ~/.Xresources
file:
XTerm*VT100.utf8Fonts.font: \
-misc-fixed-medium-r-semicondensed--13-120-75-75-c-60-iso10646-1
The leading "XTerm*" pattern is more specific than the system's
app-defaults file, therefore it overrides the corresponding line
beginning with
*VT100.utf8Fonts.font:
Here is an additional note. If you want to display East Asian
doublewidth characters (CJK Ideogram, Hiragana, Katakana, Hangul,
and so on), we recommend using
-misc-fixed-medium-r-semicondensed--13-*-*-*-*-*-iso10646-1
or
-misc-fixed-medium-r-normal--18-*-*-*-*-*-iso10646-1
because these two fonts have corresponding doublewidth fonts. These
fonts are used as default font and default "Large" font, respectively.
The internals of xterm i18n
===========================
You do not need to read this section if you only want to configure your
xterm. Here we describe how xterm is implemented to support i18n.
The original version of xterm does not support locale or character
encoding. Its I/O stream is interpreted as a mere 8-bit index for a
font.
Beginning with XFree86 4.0, xterm supported UTF-8. It was implemented
as a separate UTF-8 mode from the conventional 8-bit mode. Character
encodings had no effect on the 8-bit mode. The UTF-8 mode has been
extended to support doublewidth characters (for East Asian characters)
and combining characters (such as accents for Latin alphabets and Thai
vowels/tone marks).
Doublewidth characters are characters that occupy two continuing
columns on the terminal. Xterm uses separate fonts for normal
(singlewidth) characters and doublewidth characters. Though xterm has
configuration items for specifying doublewidth fonts, it will
automatically search for a font with exactly twice as wide and the same
name as the specified normal font.
The default behavior of xterm was modified to use this UTF-8 mode in
UTF-8 locales. A command line option of "-u8" and a resource of "utf8"
were introduced to choose UTF-8 mode.
"luit" was introduced to XFree86 at version 4.2. It converts between
UTF-8 and other encodings. When luit is invoked in a UTF-8 terminal,
the terminal acts as if it is really running in the other encoding.
Since XFree86 version 4.3, xterm provides a new mode to invoke luit
automatically to support various encodings. The mode where xterm
invokes luit is called "locale mode". It is the third mode following
conventional 8-bit mode and UTF-8 mode. In the locale mode, xterm is
aware of the current locale and character encoding. Since locale mode
uses luit, it is based on the UTF-8 mode. That is, xterm works in UTF-8
mode and luit works as a converter between UTF-8 and the character
encoding for your locale. This is why the locale mode always needs
Unicode fonts. The default behavior of xterm is modified so that the
"locale mode" will be adopted in Chinese (Big5 and GB2312), Japanese
(EUC-JP), Korean (EUC-KR), and Thai (ISO-8859-11, as known as TIS-620)
locales. Locale mode is chosen for these character encodings because
these encodings are not supported by conventional 8-bit mode even by
changing fonts (ISO-8859-11 needs combining characters and others need
doublewidth characters).
To control the locale mode, command line options of "-lc" and "-en" and
a resource of "locale" were introduced. The command line option of
"-u8" and a resource of "utf8" were made obsolete by them, though
retained for compatibility.
Since XFree86 version 4.4, xterm can have two sets of default fonts,
one for conventional 8-bit mode and another for UTF-8 and locale modes,
by introducing the "utf8Fonts" subresource.
Future TODO Items
=================
We anticipate that xterm's locale mode will be used increasingly in the
future. Since the UTF-8 and locale modes use more resources than
conventional 8-bit mode (because it needs larger fonts and another
process "luit"), faster hardware may be needed to gain complete
acceptance by users. However, the locale mechanism allows users
to manipulate data in a standard form. Its usefulness compensates
in part for reduced performance.
Xterm supports antialiased fonts ("-fa" and "-fs" command line options).
Currently UTF-8 nor locale modes do not work with antialiased fonts.
Xterm does not support bi-directional or RTL languages such as Hebrew
and Arab. A simple standard how terminal should behave for these
languages is needed.
Xterm does not support Unicode characters above U+10000.
xterm-297/xterm.desktop 0000644 0001751 0000144 00000003522 11771711255 014016 0 ustar tom users # $XTermId: xterm.desktop,v 1.14 2012/06/24 22:20:29 tom Exp $
# -----------------------------------------------------------------------------
# this file is part of xterm
#
# Copyright 2006-2010,2012 by Thomas E. Dickey
#
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
# The above copyright notice and this permission notice shall be included
# in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#
# Except as contained in this notice, the name(s) of the above copyright
# holders shall not be used in advertising or otherwise to promote the
# sale, use or other dealings in this Software without prior written
# authorization.
# -----------------------------------------------------------------------------
[Desktop Entry]
Name=XTerm
#GenericName=Terminal
Comment=standard terminal emulator for the X window system
Exec=xterm
Terminal=false
Type=Application
Encoding=UTF-8
Icon=xterm-color_48x48
Categories=System;TerminalEmulator;
xterm-297/trace.c 0000644 0001751 0000144 00000060274 12213211404 012514 0 ustar tom users /* $XTermId: trace.c,v 1.149 2013/09/09 00:15:00 tom Exp $ */
/*
* Copyright 1997-2012,2013 by Thomas E. Dickey
*
* All Rights Reserved
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, sublicense, and/or sell copies of the Software, and to
* permit persons to whom the Software is furnished to do so, subject to
* the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
* Except as contained in this notice, the name(s) of the above copyright
* holders shall not be used in advertising or otherwise to promote the
* sale, use or other dealings in this Software without prior written
* authorization.
*/
/*
* debugging support via TRACE macro.
*/
#include /* for definition of GCC_UNUSED */
#include
#if OPT_TRACE
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#ifdef HAVE_X11_TRANSLATEI_H
#include
#else
#ifdef __cplusplus
extern "C" {
#endif
extern String _XtPrintXlations(Widget w,
XtTranslations xlations,
Widget accelWidget,
_XtBoolean includeRHS);
#ifdef __cplusplus
}
#endif
#endif
const char *trace_who = "parent";
static FILE *trace_fp;
void
Trace(const char *fmt,...)
{
static const char *trace_out;
va_list ap;
if (trace_fp != 0
&& trace_who != trace_out) {
fclose(trace_fp);
trace_fp = 0;
}
trace_out = trace_who;
if (!trace_fp) {
unsigned oldmask = umask(077);
char name[BUFSIZ];
#if 0 /* usually I do not want unique names */
int unique;
for (unique = 0;; ++unique) {
if (unique)
sprintf(name, "Trace-%s.out-%d", trace_who, unique);
else
sprintf(name, "Trace-%s.out", trace_who);
if ((trace_fp = fopen(name, "r")) == 0) {
break;
}
fclose(trace_fp);
}
#else
sprintf(name, "Trace-%s.out", trace_who);
#endif
trace_fp = fopen(name, "w");
if (trace_fp != 0) {
fprintf(trace_fp, "%s\n", xtermVersion());
TraceIds(NULL, 0);
}
if (!trace_fp) {
xtermWarning("Cannot open \"%s\"\n", name);
exit(EXIT_FAILURE);
}
(void) umask(oldmask);
}
va_start(ap, fmt);
vfprintf(trace_fp, fmt, ap);
(void) fflush(trace_fp);
va_end(ap);
}
void
TraceClose(void)
{
if (trace_fp != 0) {
(void) fclose(trace_fp);
(void) fflush(stdout);
(void) fflush(stderr);
(void) visibleChars(NULL, 0);
(void) visibleIChars(NULL, 0);
trace_fp = 0;
}
}
void
TraceIds(const char *fname, int lnum)
{
Trace("process %d ", (int) getpid());
#ifdef HAVE_UNISTD_H
Trace("real (%u/%u) effective (%u/%u)",
(unsigned) getuid(), (unsigned) getgid(),
(unsigned) geteuid(), (unsigned) getegid());
#endif
if (fname != 0) {
Trace(" (%s@%d)\n", fname, lnum);
} else {
time_t now = time((time_t *) 0);
Trace("-- %s", ctime(&now));
}
}
void
TraceTime(const char *fname, int lnum)
{
time_t now;
if (fname != 0) {
Trace("datetime (%s@%d) ", fname, lnum);
}
now = time((time_t *) 0);
Trace("-- %s", ctime(&now));
}
static void
formatAscii(char *dst, unsigned value)
{
switch (value) {
case '\\':
sprintf(dst, "\\\\");
break;
case '\b':
sprintf(dst, "\\b");
break;
case '\n':
sprintf(dst, "\\n");
break;
case '\r':
sprintf(dst, "\\r");
break;
case '\t':
sprintf(dst, "\\t");
break;
default:
if (E2A(value) < 32 || (E2A(value) >= 127 && E2A(value) < 160))
sprintf(dst, "\\%03o", value & 0xff);
else
sprintf(dst, "%c", CharOf(value));
break;
}
}
#if OPT_DEC_CHRSET
const char *
visibleDblChrset(unsigned chrset)
{
const char *result = "?";
switch (chrset) {
case CSET_SWL:
result = "CSET_SWL";
break;
case CSET_DHL_TOP:
result = "CSET_DHL_TOP";
break;
case CSET_DHL_BOT:
result = "CSET_DHL_BOT";
break;
case CSET_DWL:
result = "CSET_DWL";
break;
}
return result;
}
#endif
const char *
visibleScsCode(unsigned chrset)
{
#define MAP(to,from) case from: result = to; break
const char *result = "";
switch ((DECNRCM_codes) chrset) {
MAP("B", nrc_ASCII);
MAP("A", nrc_British);
MAP("A", nrc_British_Latin_1);
MAP("&4", nrc_Cyrillic);
MAP("0", nrc_DEC_Spec_Graphic);
MAP("1", nrc_DEC_Alt_Chars);
MAP("2", nrc_DEC_Alt_Graphics);
MAP("<", nrc_DEC_Supp);
MAP("%5", nrc_DEC_Supp_Graphic);
MAP(">", nrc_DEC_Technical);
MAP("4", nrc_Dutch);
MAP("5", nrc_Finnish);
MAP("C", nrc_Finnish2);
MAP("R", nrc_French);
MAP("f", nrc_French2);
MAP("Q", nrc_French_Canadian);
MAP("9", nrc_French_Canadian2);
MAP("K", nrc_German);
MAP("\"?", nrc_Greek);
MAP("F", nrc_Greek_Supp);
MAP("\"4", nrc_Hebrew);
MAP("%=", nrc_Hebrew2);
MAP("H", nrc_Hebrew_Supp);
MAP("Y", nrc_Italian);
MAP("M", nrc_Latin_5_Supp);
MAP("L", nrc_Latin_Cyrillic);
MAP("`", nrc_Norwegian_Danish);
MAP("E", nrc_Norwegian_Danish2);
MAP("6", nrc_Norwegian_Danish3);
MAP("%6", nrc_Portugese);
MAP("&5", nrc_Russian);
MAP("%3", nrc_SCS_NRCS);
MAP("Z", nrc_Spanish);
MAP("7", nrc_Swedish);
MAP("H", nrc_Swedish2);
MAP("=", nrc_Swiss);
MAP("%0", nrc_Turkish);
MAP("%2", nrc_Turkish2);
MAP("", nrc_Unknown);
}
#undef MAP
return result;
}
char *
visibleChars(const Char *buf, unsigned len)
{
static char *result;
static unsigned used;
if (buf != 0) {
unsigned limit = ((len + 1) * 8) + 1;
char *dst;
if (limit > used) {
used = limit;
result = XtRealloc(result, used);
}
if (result != 0) {
dst = result;
*dst = '\0';
while (len--) {
unsigned value = *buf++;
formatAscii(dst, value);
dst += strlen(dst);
}
}
} else if (result != 0) {
free(result);
result = 0;
used = 0;
}
return result;
}
char *
visibleIChars(IChar *buf, unsigned len)
{
static char *result;
static unsigned used;
if (buf != 0) {
unsigned limit = ((len + 1) * 8) + 1;
char *dst;
if (limit > used) {
used = limit;
result = XtRealloc(result, used);
}
if (result != 0) {
dst = result;
*dst = '\0';
while (len--) {
unsigned value = *buf++;
#if OPT_WIDE_CHARS
if (value > 255)
sprintf(dst, "\\u+%04X", value);
else
#endif
formatAscii(dst, value);
dst += strlen(dst);
}
}
} else if (result != 0) {
free(result);
result = 0;
used = 0;
}
return result;
}
char *
visibleUChar(unsigned chr)
{
IChar buf[1];
buf[0] = chr;
return visibleIChars(buf, 1);
}
#define CASETYPE(name) case name: result = #name; break
const char *
visibleKeyboardType(xtermKeyboardType type)
{
const char *result = "?";
switch (type) {
CASETYPE(keyboardIsLegacy); /* bogus vt220 codes for F1-F4, etc. */
CASETYPE(keyboardIsDefault);
CASETYPE(keyboardIsHP);
CASETYPE(keyboardIsSCO);
CASETYPE(keyboardIsSun);
CASETYPE(keyboardIsTermcap);
CASETYPE(keyboardIsVT220);
}
return result;
}
const char *
visibleEventType(int type)
{
const char *result = "?";
switch (type) {
CASETYPE(KeyPress);
CASETYPE(KeyRelease);
CASETYPE(ButtonPress);
CASETYPE(ButtonRelease);
CASETYPE(MotionNotify);
CASETYPE(EnterNotify);
CASETYPE(LeaveNotify);
CASETYPE(FocusIn);
CASETYPE(FocusOut);
CASETYPE(KeymapNotify);
CASETYPE(Expose);
CASETYPE(GraphicsExpose);
CASETYPE(NoExpose);
CASETYPE(VisibilityNotify);
CASETYPE(CreateNotify);
CASETYPE(DestroyNotify);
CASETYPE(UnmapNotify);
CASETYPE(MapNotify);
CASETYPE(MapRequest);
CASETYPE(ReparentNotify);
CASETYPE(ConfigureNotify);
CASETYPE(ConfigureRequest);
CASETYPE(GravityNotify);
CASETYPE(ResizeRequest);
CASETYPE(CirculateNotify);
CASETYPE(CirculateRequest);
CASETYPE(PropertyNotify);
CASETYPE(SelectionClear);
CASETYPE(SelectionRequest);
CASETYPE(SelectionNotify);
CASETYPE(ColormapNotify);
CASETYPE(ClientMessage);
CASETYPE(MappingNotify);
}
return result;
}
const char *
visibleNotifyMode(int code)
{
const char *result = "?";
switch (code) {
CASETYPE(NotifyNormal);
CASETYPE(NotifyGrab);
CASETYPE(NotifyUngrab);
CASETYPE(NotifyWhileGrabbed);
}
return result;
}
const char *
visibleNotifyDetail(int code)
{
const char *result = "?";
switch (code) {
CASETYPE(NotifyAncestor);
CASETYPE(NotifyVirtual);
CASETYPE(NotifyInferior);
CASETYPE(NotifyNonlinear);
CASETYPE(NotifyNonlinearVirtual);
CASETYPE(NotifyPointer);
CASETYPE(NotifyPointerRoot);
CASETYPE(NotifyDetailNone);
}
return result;
}
const char *
visibleSelectionTarget(Display *d, Atom a)
{
const char *result = "?";
if (a == XA_STRING) {
result = "XA_STRING";
} else if (a == XA_TEXT(d)) {
result = "XA_TEXT()";
} else if (a == XA_COMPOUND_TEXT(d)) {
result = "XA_COMPOUND_TEXT()";
} else if (a == XA_UTF8_STRING(d)) {
result = "XA_UTF8_STRING()";
} else if (a == XA_TARGETS(d)) {
result = "XA_TARGETS()";
}
return result;
}
const char *
visibleXError(int code)
{
static char temp[80];
const char *result = "?";
switch (code) {
CASETYPE(Success);
CASETYPE(BadRequest);
CASETYPE(BadValue);
CASETYPE(BadWindow);
CASETYPE(BadPixmap);
CASETYPE(BadAtom);
CASETYPE(BadCursor);
CASETYPE(BadFont);
CASETYPE(BadMatch);
CASETYPE(BadDrawable);
CASETYPE(BadAccess);
CASETYPE(BadAlloc);
CASETYPE(BadColor);
CASETYPE(BadGC);
CASETYPE(BadIDChoice);
CASETYPE(BadName);
CASETYPE(BadLength);
CASETYPE(BadImplementation);
default:
sprintf(temp, "%d", code);
result = temp;
break;
}
return result;
}
#if OPT_TRACE_FLAGS
#define isScrnFlag(flag) ((flag) == LINEWRAPPED)
static char *
ScrnText(LineData *ld)
{
return visibleIChars(ld->charData, ld->lineSize);
}
#define SHOW_BAD_LINE(name, ld) \
Trace("OOPS " #name " bad row\n")
#define SHOW_SCRN_FLAG(name,code) \
Trace(#name " %s:%s\n", \
code ? "*" : "", \
ScrnText(ld))
void
LineClrFlag(LineData *ld, int flag)
{
if (ld == 0) {
SHOW_BAD_LINE(LineClrFlag, ld);
assert(0);
} else if (isScrnFlag(flag)) {
SHOW_SCRN_FLAG(LineClrFlag, 0);
}
LineFlags(ld) &= ~flag;
}
void
LineSetFlag(LineData *ld, int flag)
{
if (ld == 0) {
SHOW_BAD_LINE(LineSetFlag, ld);
assert(0);
} else if (isScrnFlag(flag)) {
SHOW_SCRN_FLAG(LineSetFlag, 1);
}
LineFlags(ld) |= flag;
}
int
LineTstFlag(LineData ld, int flag)
{
int code = 0;
if (ld == 0) {
SHOW_BAD_LINE(LineTstFlag, ld);
} else {
code = LineFlags(ld);
if (isScrnFlag(flag)) {
SHOW_SCRN_FLAG(LineTstFlag, code);
}
}
return code;
}
#endif /* OPT_TRACE_FLAGS */
/*
* Trace the normal or alternate screen, showing color values up to 16, e.g.,
* for debugging with vttest.
*/
void
TraceScreen(XtermWidget xw, int whichBuf)
{
TScreen *screen = TScreenOf(xw);
int row, col;
if (screen->editBuf_index[whichBuf]) {
TRACE(("TraceScreen %d:\n", whichBuf));
for (row = 0; row <= screen->max_row; ++row) {
LineData *ld = getLineData(screen, row);
TRACE((" %3d:", row));
if (ld != 0) {
for (col = 0; col < ld->lineSize; ++col) {
int ch = (int) ld->charData[col];
if (ch < ' ')
ch = ' ';
if (ch >= 127)
ch = '#';
TRACE(("%c", ch));
}
TRACE((":\n"));
TRACE((" xx:"));
for (col = 0; col < ld->lineSize; ++col) {
unsigned attrs = ld->attribs[col];
char ch;
if (attrs & PROTECTED) {
ch = '*';
} else if (attrs & BLINK) {
ch = 'B';
} else if (attrs & CHARDRAWN) {
ch = '+';
} else {
ch = ' ';
}
TRACE(("%c", ch));
}
TRACE((":\n"));
#if 0
TRACE((" fg:"));
for (col = 0; col < ld->lineSize; ++col) {
unsigned fg = extract_fg(xw, ld->color[col], ld->attribs[col]);
if (fg > 15)
fg = 15;
TRACE(("%1x", fg));
}
TRACE((":\n"));
TRACE((" bg:"));
for (col = 0; col < ld->lineSize; ++col) {
unsigned bg = extract_bg(xw, ld->color[col], ld->attribs[col]);
if (bg > 15)
bg = 15;
TRACE(("%1x", bg));
}
TRACE((":\n"));
#endif
} else {
TRACE(("null lineData\n"));
}
}
} else {
TRACE(("TraceScreen %d is nil\n", whichBuf));
}
}
void
TraceFocus(Widget w, XEvent * ev)
{
TRACE(("trace_focus event type %d:%s\n",
ev->type, visibleEventType(ev->type)));
switch (ev->type) {
case FocusIn:
case FocusOut:
{
XFocusChangeEvent *event = (XFocusChangeEvent *) ev;
TRACE(("\tdetail: %s\n", visibleNotifyDetail(event->detail)));
TRACE(("\tmode: %s\n", visibleNotifyMode(event->mode)));
TRACE(("\twindow: %#lx\n", event->window));
}
break;
case EnterNotify:
case LeaveNotify:
{
XCrossingEvent *event = (XCrossingEvent *) ev;
TRACE(("\tdetail: %s\n", visibleNotifyDetail(event->detail)));
TRACE(("\tmode: %s\n", visibleNotifyMode(event->mode)));
TRACE(("\twindow: %#lx\n", event->window));
TRACE(("\tfocus: %d\n", event->focus));
TRACE(("\troot: %#lx\n", event->root));
TRACE(("\tsubwindow: %#lx\n", event->subwindow));
}
break;
}
while (w != 0) {
TRACE(("w %p -> %#lx\n", (void *) w, XtWindow(w)));
w = XtParent(w);
}
}
void
TraceSizeHints(XSizeHints * hints)
{
TRACE(("size hints:\n"));
if (hints->flags & (USPosition | PPosition))
TRACE((" position %d,%d%s%s\n", hints->y, hints->x,
hints->flags & USPosition ? " user" : "",
hints->flags & PPosition ? " prog" : ""));
if (hints->flags & (USSize | PSize))
TRACE((" size %d,%d%s%s\n", hints->height, hints->width,
hints->flags & USSize ? " user" : "",
hints->flags & PSize ? " prog" : ""));
if (hints->flags & PMinSize)
TRACE((" min %d,%d\n", hints->min_height, hints->min_width));
if (hints->flags & PMaxSize)
TRACE((" max %d,%d\n", hints->max_height, hints->max_width));
if (hints->flags & PResizeInc)
TRACE((" inc %d,%d\n", hints->height_inc, hints->width_inc));
else
TRACE((" inc NONE!\n"));
if (hints->flags & PAspect)
TRACE((" min aspect %d/%d\n", hints->min_aspect.y, hints->min_aspect.y));
if (hints->flags & PAspect)
TRACE((" max aspect %d/%d\n", hints->max_aspect.y, hints->max_aspect.y));
if (hints->flags & PBaseSize)
TRACE((" base %d,%d\n", hints->base_height, hints->base_width));
if (hints->flags & PWinGravity)
TRACE((" gravity %d\n", hints->win_gravity));
}
static void
TraceEventMask(const char *tag, long mask)
{
#define DATA(name) { name##Mask, #name }
/* *INDENT-OFF* */
static struct {
long mask;
const char *name;
} table[] = {
DATA(KeyPress),
DATA(KeyRelease),
DATA(ButtonPress),
DATA(ButtonRelease),
DATA(EnterWindow),
DATA(LeaveWindow),
DATA(PointerMotion),
DATA(PointerMotionHint),
DATA(Button1Motion),
DATA(Button2Motion),
DATA(Button3Motion),
DATA(Button4Motion),
DATA(Button5Motion),
DATA(ButtonMotion),
DATA(KeymapState),
DATA(Exposure),
DATA(VisibilityChange),
DATA(StructureNotify),
DATA(ResizeRedirect),
DATA(SubstructureNotify),
DATA(SubstructureRedirect),
DATA(FocusChange),
DATA(PropertyChange),
DATA(ColormapChange),
DATA(OwnerGrabButton),
};
#undef DATA
Cardinal n;
/* *INDENT-ON* */
for (n = 0; n < XtNumber(table); ++n) {
if (table[n].mask & mask) {
TRACE(("%s %s\n", tag, table[n].name));
}
}
}
void
TraceWindowAttributes(XWindowAttributes * attrs)
{
TRACE(("window attributes:\n"));
TRACE((" position %d,%d\n", attrs->y, attrs->x));
TRACE((" size %dx%d\n", attrs->height, attrs->width));
TRACE((" border %d\n", attrs->border_width));
TRACE((" depth %d\n", attrs->depth));
TRACE((" bit_gravity %d\n", attrs->bit_gravity));
TRACE((" win_gravity %d\n", attrs->win_gravity));
TRACE((" root %#lx\n", (long) attrs->root));
TRACE((" class %s\n", ((attrs->class == InputOutput)
? "InputOutput"
: ((attrs->class == InputOnly)
? "InputOnly"
: "unknown"))));
TRACE((" map_state %s\n", ((attrs->map_state == IsUnmapped)
? "IsUnmapped"
: ((attrs->map_state == IsUnviewable)
? "IsUnviewable"
: ((attrs->map_state == IsViewable)
? "IsViewable"
: "unknown")))));
TRACE((" all_events\n"));
TraceEventMask(" ", attrs->all_event_masks);
TRACE((" your_events\n"));
TraceEventMask(" ", attrs->your_event_mask);
TRACE((" no_propagate\n"));
TraceEventMask(" ", attrs->do_not_propagate_mask);
}
void
TraceWMSizeHints(XtermWidget xw)
{
XSizeHints sizehints = xw->hints;
getXtermSizeHints(xw);
TraceSizeHints(&xw->hints);
xw->hints = sizehints;
}
/*
* Some calls to XGetAtom() will fail, and we don't want to stop. So we use
* our own error-handler.
*/
/* ARGSUSED */
static int
no_error(Display *dpy GCC_UNUSED, XErrorEvent * event GCC_UNUSED)
{
return 1;
}
const char *
ModifierName(unsigned modifier)
{
const char *s = "";
if (modifier & ShiftMask)
s = " Shift";
else if (modifier & LockMask)
s = " Lock";
else if (modifier & ControlMask)
s = " Control";
else if (modifier & Mod1Mask)
s = " Mod1";
else if (modifier & Mod2Mask)
s = " Mod2";
else if (modifier & Mod3Mask)
s = " Mod3";
else if (modifier & Mod4Mask)
s = " Mod4";
else if (modifier & Mod5Mask)
s = " Mod5";
return s;
}
void
TraceTranslations(const char *name, Widget w)
{
String result;
XErrorHandler save = XSetErrorHandler(no_error);
XtTranslations xlations;
Widget xcelerat;
TRACE(("TraceTranslations for %s (widget %#lx) {{\n", name, (long) w));
if (w) {
XtVaGetValues(w,
XtNtranslations, &xlations,
XtNaccelerators, &xcelerat,
(XtPointer) 0);
TRACE(("... xlations %#08lx\n", (long) xlations));
TRACE(("... xcelerat %#08lx\n", (long) xcelerat));
result = _XtPrintXlations(w, xlations, xcelerat, True);
TRACE(("%s\n", NonNull(result)));
if (result)
XFree((char *) result);
} else {
TRACE(("none (widget is null)\n"));
}
TRACE(("}}\n"));
XSetErrorHandler(save);
}
XtGeometryResult
TraceResizeRequest(const char *fn, int ln, Widget w,
unsigned reqwide,
unsigned reqhigh,
Dimension *gotwide,
Dimension *gothigh)
{
XtGeometryResult rc;
TRACE(("%s@%d ResizeRequest %ux%u\n", fn, ln, reqhigh, reqwide));
rc = XtMakeResizeRequest((Widget) w,
(Dimension) reqwide,
(Dimension) reqhigh,
gotwide, gothigh);
TRACE(("... ResizeRequest -> "));
if (gothigh && gotwide)
TRACE(("%dx%d ", *gothigh, *gotwide));
TRACE(("(%d)\n", rc));
return rc;
}
#define XRES_S(name) Trace(#name " = %s\n", NonNull(resp->name))
#define XRES_B(name) Trace(#name " = %s\n", BtoS(resp->name))
#define XRES_I(name) Trace(#name " = %d\n", resp->name)
void
TraceXtermResources(void)
{
XTERM_RESOURCE *resp = &resource;
Trace("XTERM_RESOURCE settings:\n");
XRES_S(icon_geometry);
XRES_S(title);
XRES_S(icon_hint);
XRES_S(icon_name);
XRES_S(term_name);
XRES_S(tty_modes);
XRES_I(minBufSize);
XRES_I(maxBufSize);
XRES_B(hold_screen);
XRES_B(utmpInhibit);
XRES_B(utmpDisplayId);
XRES_B(messages);
XRES_S(menuLocale);
XRES_S(omitTranslation);
XRES_S(keyboardType);
#if OPT_PRINT_ON_EXIT
XRES_I(printModeNow);
XRES_I(printModeOnXError);
XRES_I(printOptsNow);
XRES_I(printOptsOnXError);
XRES_S(printFileNow);
XRES_S(printFileOnXError);
#endif
#if OPT_SUNPC_KBD
XRES_B(sunKeyboard);
#endif
#if OPT_HP_FUNC_KEYS
XRES_B(hpFunctionKeys);
#endif
#if OPT_SCO_FUNC_KEYS
XRES_B(scoFunctionKeys);
#endif
#if OPT_SUN_FUNC_KEYS
XRES_B(sunFunctionKeys);
#endif
#if OPT_INITIAL_ERASE
XRES_B(ptyInitialErase);
XRES_B(backarrow_is_erase);
#endif
XRES_B(useInsertMode);
#if OPT_ZICONBEEP
XRES_I(zIconBeep);
XRES_S(zIconFormat);
#endif
#if OPT_PTY_HANDSHAKE
XRES_B(wait_for_map);
XRES_B(ptyHandshake);
XRES_B(ptySttySize);
#endif
#if OPT_SAME_NAME
XRES_B(sameName);
#endif
#if OPT_SESSION_MGT
XRES_B(sessionMgt);
#endif
#if OPT_TOOLBAR
XRES_B(toolBar);
#endif
#if OPT_MAXIMIZE
XRES_B(maximized);
XRES_S(fullscreen_s);
#endif
}
void
TraceArgv(const char *tag, char **argv)
{
int n = 0;
TRACE(("%s:\n", tag));
while (*argv != 0) {
TRACE((" %d:%s\n", n++, *argv++));
}
}
static char *
parse_option(char *dst, String src, int first)
{
char *s;
if (!strncmp(src, "-/+", (size_t) 3)) {
dst[0] = (char) first;
strcpy(dst + 1, src + 3);
} else {
strcpy(dst, src);
}
for (s = dst; *s != '\0'; s++) {
if (*s == '#' || *s == '%' || *s == 'S') {
s[1] = '\0';
} else if (*s == ' ') {
*s = '\0';
break;
}
}
return dst;
}
static Bool
same_option(OptionHelp * opt, XrmOptionDescRec * res)
{
char temp[BUFSIZ];
return !strcmp(parse_option(temp, opt->opt, res->option[0]), res->option);
}
static Bool
standard_option(String opt)
{
static const char *table[] =
{
"+rv",
"+synchronous",
"-background",
"-bd",
"-bg",
"-bordercolor",
"-borderwidth",
"-bw",
"-display",
"-fg",
"-fn",
"-font",
"-foreground",
"-geometry",
"-iconic",
"-name",
"-reverse",
"-rv",
"-selectionTimeout",
"-synchronous",
"-title",
"-xnllanguage",
"-xrm",
"-xtsessionID",
};
Cardinal n;
char temp[BUFSIZ];
opt = parse_option(temp, opt, '-');
for (n = 0; n < XtNumber(table); n++) {
if (!strcmp(opt, table[n]))
return True;
}
return False;
}
/*
* Analyse the options/help messages for inconsistencies.
*/
void
TraceOptions(OptionHelp * options, XrmOptionDescRec * resources, Cardinal res_count)
{
OptionHelp *opt_array = sortedOpts(options, resources, res_count);
size_t j, k;
XrmOptionDescRec *res_array = sortedOptDescs(resources, res_count);
Bool first, found;
TRACE(("Checking options-tables for inconsistencies:\n"));
#if 0
TRACE(("Options listed in help-message:\n"));
for (j = 0; options[j].opt != 0; j++)
TRACE(("%5d %-28s %s\n", j, opt_array[j].opt, opt_array[j].desc));
TRACE(("Options listed in resource-table:\n"));
for (j = 0; j < res_count; j++)
TRACE(("%5d %-28s %s\n", j, res_array[j].option, res_array[j].specifier));
#endif
/* list all options[] not found in resources[] */
for (j = 0, first = True; options[j].opt != 0; j++) {
found = False;
for (k = 0; k < res_count; k++) {
if (same_option(&opt_array[j], &res_array[k])) {
found = True;
break;
}
}
if (!found) {
if (first) {
TRACE(("Options listed in help, not found in resource list:\n"));
first = False;
}
TRACE((" %-28s%s\n", opt_array[j].opt,
standard_option(opt_array[j].opt) ? " (standard)" : ""));
}
}
/* list all resources[] not found in options[] */
for (j = 0, first = True; j < res_count; j++) {
found = False;
for (k = 0; options[k].opt != 0; k++) {
if (same_option(&opt_array[k], &res_array[j])) {
found = True;
break;
}
}
if (!found) {
if (first) {
TRACE(("Resource list items not found in options-help:\n"));
first = False;
}
TRACE((" %s\n", res_array[j].option));
}
}
TRACE(("Resource list items that will be ignored by XtOpenApplication:\n"));
for (j = 0; j < res_count; j++) {
switch (res_array[j].argKind) {
case XrmoptionSkipArg:
TRACE((" %-28s {param}\n", res_array[j].option));
break;
case XrmoptionSkipNArgs:
TRACE((" %-28s {%ld params}\n", res_array[j].option, (long)
res_array[j].value));
break;
case XrmoptionSkipLine:
TRACE((" %-28s {remainder of line}\n", res_array[j].option));
break;
case XrmoptionIsArg:
case XrmoptionNoArg:
case XrmoptionResArg:
case XrmoptionSepArg:
case XrmoptionStickyArg:
default:
break;
}
}
}
#else
extern void empty_trace(void);
void
empty_trace(void)
{
}
#endif
xterm-297/aclocal.m4 0000644 0001751 0000144 00000401301 12167134376 013124 0 ustar tom users dnl $XTermId: aclocal.m4,v 1.369 2013/07/10 01:29:34 tom Exp $
dnl
dnl ---------------------------------------------------------------------------
dnl
dnl Copyright 1997-2012,2013 by Thomas E. Dickey
dnl
dnl All Rights Reserved
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
dnl "Software"), to deal in the Software without restriction, including
dnl without limitation the rights to use, copy, modify, merge, publish,
dnl distribute, sublicense, and/or sell copies of the Software, and to
dnl permit persons to whom the Software is furnished to do so, subject to
dnl the following conditions:
dnl
dnl The above copyright notice and this permission notice shall be included
dnl in all copies or substantial portions of the Software.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
dnl IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY
dnl CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
dnl TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
dnl SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
dnl
dnl Except as contained in this notice, the name(s) of the above copyright
dnl holders shall not be used in advertising or otherwise to promote the
dnl sale, use or other dealings in this Software without prior written
dnl authorization.
dnl
dnl ---------------------------------------------------------------------------
dnl See
dnl http://invisible-island.net/autoconf/autoconf.html
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42
dnl -------------------
dnl Inserted as requested by gettext 0.10.40
dnl File from /usr/share/aclocal
dnl codeset.m4
dnl ====================
dnl serial AM1
dnl
dnl From Bruno Haible.
AC_DEFUN([AM_LANGINFO_CODESET],
[
AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
[AC_TRY_LINK([#include ],
[char* cs = nl_langinfo(CODESET);],
am_cv_langinfo_codeset=yes,
am_cv_langinfo_codeset=no)
])
if test $am_cv_langinfo_codeset = yes; then
AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
[Define if you have and nl_langinfo(CODESET).])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_CHECK version: 4 updated: 2013/03/04 19:52:56
dnl ------------------
dnl Conditionally generate script according to whether we're using a given autoconf.
dnl
dnl $1 = version to compare against
dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
dnl $3 = code to use if AC_ACVERSION is older than $1.
define([CF_ACVERSION_CHECK],
[
ifdef([AC_ACVERSION], ,[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])dnl
ifdef([m4_version_compare],
[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
[CF_ACVERSION_COMPARE(
AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
dnl --------------------
dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
dnl MAJOR2, MINOR2, TERNARY2,
dnl PRINTABLE2, not FOUND, FOUND)
define([CF_ACVERSION_COMPARE],
[ifelse(builtin([eval], [$2 < $5]), 1,
[ifelse([$8], , ,[$8])],
[ifelse([$9], , ,[$9])])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42
dnl -------------
dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
dnl The second parameter if given makes this macro verbose.
dnl
dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
dnl confused by the quotes (which require backslashes to keep them usable).
AC_DEFUN([CF_ADD_CFLAGS],
[
cf_fix_cppflags=no
cf_new_cflags=
cf_new_cppflags=
cf_new_extra_cppflags=
for cf_add_cflags in $1
do
case $cf_fix_cppflags in
no)
case $cf_add_cflags in #(vi
-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi
case $cf_add_cflags in
-D*)
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
test "${cf_add_cflags}" != "${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=yes
if test $cf_fix_cppflags = yes ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
elif test "${cf_tst_cflags}" = "\"'" ; then
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
continue
fi
;;
esac
case "$CPPFLAGS" in
*$cf_add_cflags) #(vi
;;
*) #(vi
case $cf_add_cflags in #(vi
-D*)
cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
;;
esac
cf_new_cppflags="$cf_new_cppflags $cf_add_cflags"
;;
esac
;;
*)
cf_new_cflags="$cf_new_cflags $cf_add_cflags"
;;
esac
;;
yes)
cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags"
cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
test "${cf_add_cflags}" != "${cf_tst_cflags}" \
&& test -z "${cf_tst_cflags}" \
&& cf_fix_cppflags=no
;;
esac
done
if test -n "$cf_new_cflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
CFLAGS="$CFLAGS $cf_new_cflags"
fi
if test -n "$cf_new_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
CPPFLAGS="$CPPFLAGS $cf_new_cppflags"
fi
if test -n "$cf_new_extra_cppflags" ; then
ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS"
fi
AC_SUBST(EXTRA_CPPFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
dnl ----------
dnl Add a library, used to enforce consistency.
dnl
dnl $1 = library to add, without the "-l"
dnl $2 = variable to update (default $LIBS)
AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05
dnl -----------
dnl Add one or more libraries, used to enforce consistency.
dnl
dnl $1 = libraries to add, with the "-l", etc.
dnl $2 = variable to update (default $LIBS)
AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
dnl ----------------
dnl Add a given library after another, e.g., following the one it satisfies a
dnl dependency for.
dnl
dnl $1 = the first library
dnl $2 = its dependency
AC_DEFUN([CF_ADD_LIB_AFTER],[
CF_VERBOSE(...before $LIBS)
LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's% % %g'`
CF_VERBOSE(...after $LIBS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
dnl --------------
dnl Allow user to disable a normally-on option.
AC_DEFUN([CF_ARG_DISABLE],
[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31
dnl -------------
dnl Allow user to enable a normally-off option.
AC_DEFUN([CF_ARG_ENABLE],
[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl
dnl ---------------------------------------------------------------------------
dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42
dnl -------------
dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
dnl values.
dnl
dnl Parameters:
dnl $1 = option name
dnl $2 = help-string
dnl $3 = action to perform if option is not default
dnl $4 = action if perform if option is default
dnl $5 = default option value (either 'yes' or 'no')
AC_DEFUN([CF_ARG_OPTION],
[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
if test "$enableval" != "$5" ; then
ifelse([$3],,[ :]dnl
,[ $3]) ifelse([$4],,,[
else
$4])
fi],[enableval=$5 ifelse([$4],,,[
$4
])dnl
])])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CC_ENV_FLAGS version: 1 updated: 2012/10/03 05:25:49
dnl ---------------
dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
dnl into CC. This will not help with broken scripts that wrap the compiler with
dnl options, but eliminates a more common category of user confusion.
AC_DEFUN([CF_CC_ENV_FLAGS],
[
# This should have been defined by AC_PROG_CC
: ${CC:=cc}
AC_MSG_CHECKING(\$CC variable)
case "$CC" in #(vi
*[[\ \ ]]-[[IUD]]*)
AC_MSG_RESULT(broken)
AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
# humor him...
cf_flags=`echo "$CC" | sed -e 's/^[[^ ]]*[[ ]]//'`
CC=`echo "$CC" | sed -e 's/[[ ]].*//'`
CF_ADD_CFLAGS($cf_flags)
;;
*)
AC_MSG_RESULT(ok)
;;
esac
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
dnl --------------
dnl Check if we're accidentally using a cache from a different machine.
dnl Derive the system name, as a check for reusing the autoconf cache.
dnl
dnl If we've packaged config.guess and config.sub, run that (since it does a
dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
dnl which is useful in cross-compiles.
dnl
dnl Note: we would use $ac_config_sub, but that is one of the places where
dnl autoconf 2.5x broke compatibility with autoconf 2.13
AC_DEFUN([CF_CHECK_CACHE],
[
if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
ifelse([$1],,[AC_CANONICAL_HOST],[$1])
system_name="$host_os"
else
system_name="`(uname -s -r) 2>/dev/null`"
if test -z "$system_name" ; then
system_name="`(hostname) 2>/dev/null`"
fi
fi
test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
test -z "$system_name" && system_name="$cf_cv_system_name"
test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
if test ".$system_name" != ".$cf_cv_system_name" ; then
AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
AC_MSG_ERROR("Please remove config.cache and try again.")
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_CFLAGS version: 2 updated: 2001/12/30 19:09:58
dnl ---------------
dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
dnl a build-configuration such as imake. These have the pitfall that they
dnl often contain compiler-specific options which we cannot use, mixed with
dnl preprocessor options that we usually can.
AC_DEFUN([CF_CHECK_CFLAGS],
[
CF_VERBOSE(checking additions to CFLAGS)
cf_check_cflags="$CFLAGS"
cf_check_cppflags="$CPPFLAGS"
CF_ADD_CFLAGS($1,yes)
if test "$cf_check_cflags" != "$CFLAGS" ; then
AC_TRY_LINK([#include ],[printf("Hello world");],,
[CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS)
if test "$cf_check_cppflags" != "$CPPFLAGS" ; then
CF_VERBOSE(but keeping change to \$CPPFLAGS)
fi
CFLAGS="$cf_check_flags"])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42
dnl --------------
dnl Check for data that is usually declared in or , e.g.,
dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it
dnl ourselves.
dnl
dnl $1 = the name to check
dnl $2 = the assumed type
AC_DEFUN([CF_CHECK_ERRNO],
[
AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
AC_TRY_COMPILE([
#ifdef HAVE_STDLIB_H
#include
#endif
#include
#include
#include ],
ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1,
[cf_cv_dcl_$1=yes],
[cf_cv_dcl_$1=no])
])
if test "$cf_cv_dcl_$1" = no ; then
CF_UPPER(cf_result,decl_$1)
AC_DEFINE_UNQUOTED($cf_result)
fi
# It's possible (for near-UNIX clones) that the data doesn't exist
CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2]))
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
dnl --------------------
dnl Check for existence of external data in the current set of libraries. If
dnl we can modify it, it's real enough.
dnl $1 = the name to check
dnl $2 = its type
AC_DEFUN([CF_CHECK_EXTERN_DATA],
[
AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[
AC_TRY_LINK([
#undef $1
extern $2 $1;
],
[$1 = 2],
[cf_cv_have_$1=yes],
[cf_cv_have_$1=no])
])
if test "$cf_cv_have_$1" = yes ; then
CF_UPPER(cf_result,have_$1)
AC_DEFINE_UNQUOTED($cf_result)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39
dnl -----------------
dnl Check if the given compiler is really clang. clang's C driver defines
dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
dnl not ignore some gcc options.
dnl
dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
dnl the wrappers for gcc and g++ warnings.
dnl
dnl $1 = GCC (default) or GXX
dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
dnl $3 = CFLAGS (default) or CXXFLAGS
AC_DEFUN([CF_CLANG_COMPILER],[
ifelse([$2],,CLANG_COMPILER,[$2])=no
if test "$ifelse([$1],,[$1],GCC)" = yes ; then
AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
AC_TRY_COMPILE([],[
#ifdef __clang__
#else
make an error
#endif
],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
],[])
ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_DESKTOP version: 2 updated: 2011/04/22 05:17:37
dnl ------------------
dnl Handle a configure option "--disable-desktop", which sets a shell
dnl variable $desktop_utils to a "#" if the feature is not wanted, or to an
dnl empty string if enabled. The variable is used to substitute in front of
dnl corresponding makefile-rules.
dnl
dnl It also tells the configure script to substitute the environment variable
dnl $DESKTOP_FLAGS, which can be used by external scripts to customize the
dnl invocation of desktop-file-util.
dnl
dnl $1 = program name
AC_DEFUN([CF_DISABLE_DESKTOP],[
# Comment-out the install-desktop rule if the desktop-utils are not found.
AC_MSG_CHECKING(if you want to install desktop files)
CF_ARG_OPTION(desktop,
[ --disable-desktop disable install of $1 desktop files],
[enable_desktop=$enableval],
[enable_desktop=$enableval],yes)
AC_MSG_RESULT($enable_desktop)
desktop_utils=
if test "$enable_desktop" = yes ; then
AC_CHECK_PROG(desktop_utils,desktop-file-install,yes,no)
fi
test "$desktop_utils" = yes && desktop_utils= || desktop_utils="#"
AC_SUBST(DESKTOP_FLAGS)
])
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_ECHO version: 12 updated: 2012/10/06 16:30:28
dnl ---------------
dnl You can always use "make -n" to see the actual options, but it's hard to
dnl pick out/analyze warning messages when the compile-line is long.
dnl
dnl Sets:
dnl ECHO_LT - symbol to control if libtool is verbose
dnl ECHO_LD - symbol to prefix "cc -o" lines
dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
dnl SHOW_CC - symbol to put before explicit "cc -c" lines
dnl ECHO_CC - symbol to put before any "cc" line
dnl
AC_DEFUN([CF_DISABLE_ECHO],[
AC_MSG_CHECKING(if you want to see long compiling messages)
CF_ARG_DISABLE(echo,
[ --disable-echo do not display "compiling" commands],
[
ECHO_LT='--silent'
ECHO_LD='@echo linking [$]@;'
RULE_CC='@echo compiling [$]<'
SHOW_CC='@echo compiling [$]@'
ECHO_CC='@'
],[
ECHO_LT=''
ECHO_LD=''
RULE_CC=''
SHOW_CC=''
ECHO_CC=''
])
AC_MSG_RESULT($enableval)
AC_SUBST(ECHO_LT)
AC_SUBST(ECHO_LD)
AC_SUBST(RULE_CC)
AC_SUBST(SHOW_CC)
AC_SUBST(ECHO_CC)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_LEAKS version: 7 updated: 2012/10/02 20:55:03
dnl ----------------
dnl Combine no-leak checks with the libraries or tools that are used for the
dnl checks.
AC_DEFUN([CF_DISABLE_LEAKS],[
AC_REQUIRE([CF_WITH_DMALLOC])
AC_REQUIRE([CF_WITH_DBMALLOC])
AC_REQUIRE([CF_WITH_VALGRIND])
AC_MSG_CHECKING(if you want to perform memory-leak testing)
AC_ARG_ENABLE(leaks,
[ --disable-leaks test: free permanent memory, analyze leaks],
[if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
: ${with_no_leaks:=no})
AC_MSG_RESULT($with_no_leaks)
if test "$with_no_leaks" = yes ; then
AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.])
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33
dnl ---------------------
dnl The rpath-hack makes it simpler to build programs, particularly with the
dnl *BSD ports which may have essential libraries in unusual places. But it
dnl can interfere with building an executable for the base system. Use this
dnl option in that case.
AC_DEFUN([CF_DISABLE_RPATH_HACK],
[
AC_MSG_CHECKING(if rpath-hack should be disabled)
CF_ARG_DISABLE(rpath-hack,
[ --disable-rpath-hack don't add rpath options for additional libraries],
[cf_disable_rpath_hack=yes],
[cf_disable_rpath_hack=no])
AC_MSG_RESULT($cf_disable_rpath_hack)
if test "$cf_disable_rpath_hack" = no ; then
CF_RPATH_HACK
fi
])
dnl ---------------------------------------------------------------------------
dnl CF_ENABLE_NARROWPROTO version: 3 updated: 2006/02/12 17:46:00
dnl ---------------------
dnl If this is not set properly, Xaw's scrollbars will not work.
dnl The so-called "modular" configuration for X.org omits most of the
dnl configure checks that would be needed to provide compatibility with
dnl older X builds. This one breaks things noticeably.
AC_DEFUN([CF_ENABLE_NARROWPROTO],
[
AC_MSG_CHECKING(if you want narrow prototypes for X libraries)
case `$ac_config_guess` in #(vi
*cygwin*|*freebsd*|*gnu*|*irix5*|*irix6*|*linux-gnu*|*netbsd*|*openbsd*|*qnx*|*sco*|*sgi*) #(vi
cf_default_narrowproto=yes
;;
*)
cf_default_narrowproto=no
;;
esac
CF_ARG_OPTION(narrowproto,
[ --enable-narrowproto enable narrow prototypes for X libraries],
[enable_narrowproto=$enableval],
[enable_narrowproto=$cf_default_narrowproto],
[$cf_default_narrowproto])
AC_MSG_RESULT($enable_narrowproto)
])
dnl ---------------------------------------------------------------------------
dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39
dnl --------
dnl Check if 'errno' is declared in
AC_DEFUN([CF_ERRNO],
[
CF_CHECK_ERRNO(errno)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_GRANTPT version: 10 updated: 2013/04/17 05:31:24
dnl ---------------
dnl Check for grantpt versus openpty, as well as functions that "should" be
dnl available if grantpt is available.
AC_DEFUN([CF_FUNC_GRANTPT],[
AC_CHECK_HEADERS( \
stropts.h \
)
cf_func_grantpt="grantpt ptsname"
case $host_os in #(vi
darwin[[0-9]].*) #(vi
;;
*)
cf_func_grantpt="$cf_func_grantpt posix_openpt"
;;
esac
AC_CHECK_FUNCS($cf_func_grantpt)
cf_grantpt_opts=
if test "x$ac_cv_func_grantpt" = "xyes" ; then
AC_MSG_CHECKING(if grantpt really works)
AC_TRY_LINK(CF__GRANTPT_HEAD,CF__GRANTPT_BODY,[
AC_TRY_RUN(CF__GRANTPT_HEAD
int main(void)
{
CF__GRANTPT_BODY
}
,
,ac_cv_func_grantpt=no
,ac_cv_func_grantpt=maybe)
],ac_cv_func_grantpt=no)
AC_MSG_RESULT($ac_cv_func_grantpt)
if test "x$ac_cv_func_grantpt" != "xno" ; then
if test "x$ac_cv_func_grantpt" = "xyes" ; then
AC_MSG_CHECKING(for pty features)
dnl if we have no stropts.h, skip the checks for streams modules
if test "x$ac_cv_header_stropts_h" = xyes
then
cf_pty_this=0
else
cf_pty_this=3
fi
cf_pty_defines=
while test $cf_pty_this != 6
do
cf_pty_feature=
cf_pty_next=`expr $cf_pty_this + 1`
CF_MSG_LOG(pty feature test $cf_pty_next:5)
AC_TRY_RUN(#define CONFTEST $cf_pty_this
$cf_pty_defines
CF__GRANTPT_HEAD
int main(void)
{
CF__GRANTPT_BODY
}
,
[
case $cf_pty_next in #(vi
1) #(vi - streams
cf_pty_feature=ptem
;;
2) #(vi - streams
cf_pty_feature=ldterm
;;
3) #(vi - streams
cf_pty_feature=ttcompat
;;
4) #(vi
cf_pty_feature=pty_isatty
;;
5) #(vi
cf_pty_feature=pty_tcsetattr
;;
6) #(vi
cf_pty_feature=tty_tcsetattr
;;
esac
],[
case $cf_pty_next in #(vi
1|2|3)
CF_MSG_LOG(skipping remaining streams features $cf_pty_this..2)
cf_pty_next=3
;;
esac
])
if test -n "$cf_pty_feature"
then
cf_pty_defines="$cf_pty_defines
#define CONFTEST_$cf_pty_feature 1
"
cf_grantpt_opts="$cf_grantpt_opts $cf_pty_feature"
fi
cf_pty_this=$cf_pty_next
done
AC_MSG_RESULT($cf_grantpt_opts)
cf_grantpt_opts=`echo "$cf_grantpt_opts" | sed -e 's/ isatty//'`
fi
fi
fi
dnl If we found grantpt, but no features, e.g., for streams or if we are not
dnl able to use tcsetattr, then give openpty a try. In particular, Darwin 10.7
dnl has a more functional openpty than posix_openpt.
dnl
dnl There is no configure run-test for openpty, since older implementations do
dnl not always run properly as a non-root user. For that reason, we also allow
dnl the configure script to suppress this check entirely with $disable_openpty.
if test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then
AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no])
if test "$cf_have_openpty" = yes ; then
ac_cv_func_grantpt=no
LIBS="-lutil $LIBS"
AC_DEFINE(HAVE_OPENPTY,1,[Define to 1 if you have the openpty function])
AC_CHECK_HEADERS( \
util.h \
libutil.h \
pty.h \
)
fi
fi
dnl If we did not settle on using openpty, fill in the definitions for grantpt.
if test "x$ac_cv_func_grantpt" != xno
then
CF_VERBOSE(will rely upon grantpt)
AC_DEFINE(HAVE_WORKING_GRANTPT,1,[Define to 1 if the grantpt function seems to work])
for cf_feature in $cf_grantpt_opts
do
cf_feature=`echo "$cf_feature" | sed -e 's/ //g'`
CF_UPPER(cf_FEATURE,$cf_feature)
AC_DEFINE_UNQUOTED(HAVE_GRANTPT_$cf_FEATURE)
done
elif test "x$cf_have_openpty" = xno
then
CF_VERBOSE(will rely upon BSD-pseudoterminals)
else
CF_VERBOSE(will rely upon openpty)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_FUNC_TGETENT version: 19 updated: 2012/10/04 20:12:20
dnl ---------------
dnl Check for tgetent function in termcap library. If we cannot find this,
dnl we'll use the $LINES and $COLUMNS environment variables to pass screen
dnl size information to subprocesses. (We cannot use terminfo's compatibility
dnl function, since it cannot provide the termcap-format data).
dnl
dnl If the --disable-full-tgetent option is given, we'll settle for the first
dnl tgetent function we find. Since the search list in that case does not
dnl include the termcap library, that allows us to default to terminfo.
AC_DEFUN([CF_FUNC_TGETENT],
[
# compute a reasonable value for $TERM to give tgetent(), since we may be
# running in 'screen', which sets $TERMCAP to a specific entry that is not
# necessarily in /etc/termcap - unsetenv is not portable, so we cannot simply
# discard $TERMCAP.
cf_TERMVAR=vt100
if test -n "$TERMCAP"
then
cf_TERMCAP=`echo "$TERMCAP" | tr '\n' ' ' | sed -e 's/^..|//' -e 's/|.*//'`
case "$cf_TERMCAP" in #(vi
screen*.*) #(vi
;;
*)
cf_TERMVAR="$cf_TERMCAP"
;;
esac
fi
test -z "$cf_TERMVAR" && cf_TERMVAR=vt100
AC_MSG_CHECKING(if we want full tgetent function)
CF_ARG_DISABLE(full-tgetent,
[ --disable-full-tgetent disable check for full tgetent function],
cf_full_tgetent=no,
cf_full_tgetent=yes,yes)
AC_MSG_RESULT($cf_full_tgetent)
if test "$cf_full_tgetent" = yes ; then
cf_test_message="full tgetent"
else
cf_test_message="tgetent"
fi
AC_CACHE_CHECK(for $cf_test_message function,cf_cv_lib_tgetent,[
cf_save_LIBS="$LIBS"
cf_cv_lib_tgetent=no
if test "$cf_full_tgetent" = yes ; then
cf_TERMLIB="otermcap termcap termlib ncurses curses"
cf_TERMTST="buffer[[0]] == 0"
else
cf_TERMLIB="termlib ncurses curses"
cf_TERMTST="0"
fi
for cf_termlib in '' $cf_TERMLIB ; do
LIBS="$cf_save_LIBS"
test -n "$cf_termlib" && CF_ADD_LIB($cf_termlib)
AC_TRY_RUN([
/* terminfo implementations ignore the buffer argument, making it useless for
* the xterm application, which uses this information to make a new TERMCAP
* environment variable.
*/
int main()
{
char buffer[1024];
buffer[0] = 0;
tgetent(buffer, "$cf_TERMVAR");
${cf_cv_main_return:-return} ($cf_TERMTST); }],
[echo "yes, there is a termcap/tgetent in $cf_termlib" 1>&AC_FD_CC
if test -n "$cf_termlib" ; then
cf_cv_lib_tgetent="-l$cf_termlib"
else
cf_cv_lib_tgetent=yes
fi
break],
[echo "no, there is no termcap/tgetent in $cf_termlib" 1>&AC_FD_CC],
[echo "cross-compiling, cannot verify if a termcap/tgetent is present in $cf_termlib" 1>&AC_FD_CC])
done
LIBS="$cf_save_LIBS"
])
# If we found a working tgetent(), set LIBS and check for termcap.h.
# (LIBS cannot be set inside AC_CACHE_CHECK; the commands there should
# not have side effects other than setting the cache variable, because
# they are not executed when a cached value exists.)
if test "x$cf_cv_lib_tgetent" != xno ; then
test "x$cf_cv_lib_tgetent" != xyes && CF_ADD_LIBS($cf_cv_lib_tgetent)
AC_DEFINE(USE_TERMCAP,1,[Define 1 to indicate that working tgetent is found])
if test "$cf_full_tgetent" = no ; then
AC_TRY_COMPILE([
#include ],[
#ifdef NCURSES_VERSION
make an error
#endif],[AC_DEFINE(HAVE_TERMCAP_H)])
else
AC_CHECK_HEADERS(termcap.h)
fi
else
# If we didn't find a tgetent() that supports the buffer
# argument, look again to see whether we can find even
# a crippled one. A crippled tgetent() is still useful to
# validate values for the TERM environment variable given to
# child processes.
AC_CACHE_CHECK(for partial tgetent function,cf_cv_lib_part_tgetent,[
cf_cv_lib_part_tgetent=no
for cf_termlib in $cf_TERMLIB ; do
LIBS="$cf_save_LIBS -l$cf_termlib"
AC_TRY_LINK([],[tgetent(0, "$cf_TERMVAR")],
[echo "there is a terminfo/tgetent in $cf_termlib" 1>&AC_FD_CC
cf_cv_lib_part_tgetent="-l$cf_termlib"
break])
done
LIBS="$cf_save_LIBS"
])
if test "$cf_cv_lib_part_tgetent" != no ; then
CF_ADD_LIBS($cf_cv_lib_part_tgetent)
AC_CHECK_HEADERS(termcap.h)
# If this is linking against ncurses, we'll trigger the
# ifdef in resize.c that turns the termcap stuff back off.
AC_DEFINE(USE_TERMINFO,1,[Define to 1 to indicate that terminfo provides the tgetent interface])
fi
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_ATTRIBUTES version: 16 updated: 2012/10/02 20:55:03
dnl -----------------
dnl Test for availability of useful gcc __attribute__ directives to quiet
dnl compiler warnings. Though useful, not all are supported -- and contrary
dnl to documentation, unrecognized directives cause older compilers to barf.
AC_DEFUN([CF_GCC_ATTRIBUTES],
[
if test "$GCC" = yes
then
cat > conftest.i < conftest.$ac_ext <&AC_FD_CC
case $cf_attribute in #(vi
printf) #(vi
cf_printf_attribute=yes
cat >conftest.h <conftest.h <conftest.h <>confdefs.h
case $cf_attribute in #(vi
noreturn) #(vi
AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
;;
printf) #(vi
cf_value='/* nothing */'
if test "$cf_printf_attribute" != no ; then
cf_value='__attribute__((format(printf,fmt,var)))'
AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
;;
scanf) #(vi
cf_value='/* nothing */'
if test "$cf_scanf_attribute" != no ; then
cf_value='__attribute__((format(scanf,fmt,var)))'
AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
fi
AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
;;
unused) #(vi
AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
;;
esac
fi
done
else
fgrep define conftest.i >>confdefs.h
fi
rm -rf conftest*
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
AC_REQUIRE([AC_PROG_CC])
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39
dnl ---------------
dnl Check if the compiler supports useful warning options. There's a few that
dnl we don't use, simply because they're too noisy:
dnl
dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
dnl -Wredundant-decls (system headers make this too noisy)
dnl -Wtraditional (combines too many unrelated messages, only a few useful)
dnl -Wwrite-strings (too noisy, but should review occasionally). This
dnl is enabled for ncurses using "--enable-const".
dnl -pedantic
dnl
dnl Parameter:
dnl $1 is an optional list of gcc warning flags that a particular
dnl application might want to use, e.g., "no-unused" for
dnl -Wno-unused
dnl Special:
dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
dnl
AC_DEFUN([CF_GCC_WARNINGS],
[
AC_REQUIRE([CF_GCC_VERSION])
CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
cat > conftest.$ac_ext <],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_gnu_source=no],
[cf_save="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
AC_TRY_COMPILE([#include ],[
#ifdef _XOPEN_SOURCE
make an error
#endif],
[cf_cv_gnu_source=no],
[cf_cv_gnu_source=yes])
CPPFLAGS="$cf_save"
])
])
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
dnl ---------------
dnl Insert text into the help-message, for readability, from AC_ARG_WITH.
AC_DEFUN([CF_HELP_MESSAGE],
[AC_DIVERT_HELP([$1])dnl
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_IMAKE_CFLAGS version: 31 updated: 2010/05/26 05:38:42
dnl ---------------
dnl Use imake to obtain compiler flags. We could, in principle, write tests to
dnl get these, but if imake is properly configured there is no point in doing
dnl this.
dnl
dnl Parameters (used in constructing a sample Imakefile):
dnl $1 = optional value to append to $IMAKE_CFLAGS
dnl $2 = optional value to append to $IMAKE_LOADFLAGS
AC_DEFUN([CF_IMAKE_CFLAGS],
[
AC_PATH_PROGS(IMAKE,xmkmf imake)
if test -n "$IMAKE" ; then
case $IMAKE in # (vi
*/imake)
cf_imake_opts="-DUseInstalled=YES" # (vi
;;
*/util/xmkmf)
# A single parameter tells xmkmf where the config-files are:
cf_imake_opts="`echo $IMAKE|sed -e s,/config/util/xmkmf,,`" # (vi
;;
*)
cf_imake_opts=
;;
esac
# If it's installed properly, imake (or its wrapper, xmkmf) will point to the
# config directory.
if mkdir conftestdir; then
CDPATH=; export CDPATH
cf_makefile=`cd $srcdir;pwd`/Imakefile
cd conftestdir
cat >fix_cflags.sed <<'CF_EOF'
s/\\//g
s/[[ ]][[ ]]*/ /g
s/"//g
:pack
s/\(=[[^ ]][[^ ]]*\) \([[^-]]\)/\1 \2/g
t pack
s/\(-D[[a-zA-Z0-9_]][[a-zA-Z0-9_]]*\)=\([[^\'0-9 ]][[^ ]]*\)/\1='\\"\2\\"'/g
s/^IMAKE[[ ]]/IMAKE_CFLAGS="/
s/ / /g
s/$/"/
CF_EOF
cat >fix_lflags.sed <<'CF_EOF'
s/^IMAKE[[ ]]*/IMAKE_LOADFLAGS="/
s/$/"/
CF_EOF
echo >./Imakefile
test -f $cf_makefile && cat $cf_makefile >>./Imakefile
cat >> ./Imakefile <<'CF_EOF'
findstddefs:
@echo IMAKE ${ALLDEFINES}ifelse([$1],,,[ $1]) | sed -f fix_cflags.sed
@echo IMAKE ${EXTRA_LOAD_FLAGS}ifelse([$2],,,[ $2]) | sed -f fix_lflags.sed
CF_EOF
if ( $IMAKE $cf_imake_opts 1>/dev/null 2>&AC_FD_CC && test -f Makefile)
then
CF_VERBOSE(Using $IMAKE $cf_imake_opts)
else
# sometimes imake doesn't have the config path compiled in. Find it.
cf_config=
for cf_libpath in $X_LIBS $LIBS ; do
case $cf_libpath in # (vi
-L*)
cf_libpath=`echo .$cf_libpath | sed -e 's/^...//'`
cf_libpath=$cf_libpath/X11/config
if test -d $cf_libpath ; then
cf_config=$cf_libpath
break
fi
;;
esac
done
if test -z "$cf_config" ; then
AC_MSG_WARN(Could not find imake config-directory)
else
cf_imake_opts="$cf_imake_opts -I$cf_config"
if ( $IMAKE -v $cf_imake_opts 2>&AC_FD_CC)
then
CF_VERBOSE(Using $IMAKE $cf_config)
else
AC_MSG_WARN(Cannot run $IMAKE)
fi
fi
fi
# GNU make sometimes prints "make[1]: Entering...", which
# would confuse us.
eval `make findstddefs 2>/dev/null | grep -v make`
cd ..
rm -rf conftestdir
# We use ${ALLDEFINES} rather than ${STD_DEFINES} because the former
# declares XTFUNCPROTO there. However, some vendors (e.g., SGI) have
# modified it to support site.cf, adding a kludge for the /usr/include
# directory. Try to filter that out, otherwise gcc won't find its
# headers.
if test -n "$GCC" ; then
if test -n "$IMAKE_CFLAGS" ; then
cf_nostdinc=""
cf_std_incl=""
cf_cpp_opts=""
for cf_opt in $IMAKE_CFLAGS
do
case "$cf_opt" in
-nostdinc) #(vi
cf_nostdinc="$cf_opt"
;;
-I/usr/include) #(vi
cf_std_incl="$cf_opt"
;;
*) #(vi
cf_cpp_opts="$cf_cpp_opts $cf_opt"
;;
esac
done
if test -z "$cf_nostdinc" ; then
IMAKE_CFLAGS="$cf_cpp_opts $cf_std_incl"
elif test -z "$cf_std_incl" ; then
IMAKE_CFLAGS="$cf_cpp_opts $cf_nostdinc"
else
CF_VERBOSE(suppressed \"$cf_nostdinc\" and \"$cf_std_incl\")
IMAKE_CFLAGS="$cf_cpp_opts"
fi
fi
fi
fi
# Some imake configurations define PROJECTROOT with an empty value. Remove
# the empty definition.
case $IMAKE_CFLAGS in
*-DPROJECTROOT=/*)
;;
*)
IMAKE_CFLAGS=`echo "$IMAKE_CFLAGS" |sed -e "s,-DPROJECTROOT=[[ ]], ,"`
;;
esac
fi
CF_VERBOSE(IMAKE_CFLAGS $IMAKE_CFLAGS)
CF_VERBOSE(IMAKE_LOADFLAGS $IMAKE_LOADFLAGS)
AC_SUBST(IMAKE_CFLAGS)
AC_SUBST(IMAKE_LOADFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_INPUT_METHOD version: 3 updated: 2000/04/11 23:46:57
dnl ---------------
dnl Check if the X libraries support input-method
AC_DEFUN([CF_INPUT_METHOD],
[
AC_CACHE_CHECK([if X libraries support input-method],cf_cv_input_method,[
AC_TRY_LINK([
#include
#include