diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-03-25 22:03:52 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2010-03-25 22:03:52 +0000 |
commit | e16a08ded404b24025fc0707bfb3f6c3c76fd9b8 (patch) | |
tree | f25c0c31ae03d777014c4f64479de8c7f4c7f639 /app/xterm/vttests | |
parent | cea3749b11718d3b585f653d4acbb6c5287794cb (diff) |
Update to xterm-255. Tested by stsp@, oga@.
Diffstat (limited to 'app/xterm/vttests')
-rw-r--r-- | app/xterm/vttests/256colors.pl | 40 | ||||
-rw-r--r-- | app/xterm/vttests/256colors2.pl | 37 | ||||
-rw-r--r-- | app/xterm/vttests/88colors.pl | 33 | ||||
-rw-r--r-- | app/xterm/vttests/88colors2.pl | 36 | ||||
-rw-r--r-- | app/xterm/vttests/paste64.pl | 34 | ||||
-rw-r--r-- | app/xterm/vttests/resize.pl | 33 | ||||
-rw-r--r-- | app/xterm/vttests/tcapquery.pl | 112 |
7 files changed, 291 insertions, 34 deletions
diff --git a/app/xterm/vttests/256colors.pl b/app/xterm/vttests/256colors.pl index b053b94fc..57976f7cf 100644 --- a/app/xterm/vttests/256colors.pl +++ b/app/xterm/vttests/256colors.pl @@ -1,12 +1,46 @@ #!/usr/bin/perl -# $XFree86: xc/programs/xterm/vttests/256colors.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ +# $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"; + # 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; } - sleep 1; print "\n"; + sleep 1; } diff --git a/app/xterm/vttests/256colors2.pl b/app/xterm/vttests/256colors2.pl index 0aecc551d..2a880bdc8 100644 --- a/app/xterm/vttests/256colors2.pl +++ b/app/xterm/vttests/256colors2.pl @@ -1,7 +1,38 @@ #!/usr/bin/perl -# $XTermId: 256colors2.pl,v 1.9 2009/10/10 14:45:26 tom Exp $ -# Authors: Todd Larason <jtl@molehill.org> -# Thomas E Dickey +# $XTermId: 256colors2.pl,v 1.10 2009/10/10 14:45:26 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 1999-2007,2009 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 diff --git a/app/xterm/vttests/88colors.pl b/app/xterm/vttests/88colors.pl index a645fc3d4..3db178c3f 100644 --- a/app/xterm/vttests/88colors.pl +++ b/app/xterm/vttests/88colors.pl @@ -1,5 +1,36 @@ #!/usr/bin/perl -# $XFree86: xc/programs/xterm/vttests/88colors.pl,v 1.1 1999/09/25 14:38:51 dawes Exp $ +# $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++) { diff --git a/app/xterm/vttests/88colors2.pl b/app/xterm/vttests/88colors2.pl index 63d3f3a87..9c63b8cac 100644 --- a/app/xterm/vttests/88colors2.pl +++ b/app/xterm/vttests/88colors2.pl @@ -1,7 +1,37 @@ #!/usr/bin/perl -# $XTermId: 88colors2.pl,v 1.6 2009/10/10 14:57:12 tom Exp $ -# Authors: Steve Wall <swall@redcom.com> -# Thomas E Dickey +# $XTermId: 88colors2.pl,v 1.7 2009/10/10 14:57:12 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm +# +# Copyright 1999-2007,2009 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 diff --git a/app/xterm/vttests/paste64.pl b/app/xterm/vttests/paste64.pl index 301c31b17..619a2225c 100644 --- a/app/xterm/vttests/paste64.pl +++ b/app/xterm/vttests/paste64.pl @@ -1,8 +1,36 @@ #!/usr/bin/perl -w -# $XTermId: paste64.pl,v 1.9 2006/03/13 01:28:02 tom Exp $ -# $XFree86: xc/programs/xterm/vttests/paste64.pl,v 1.1 2006/03/13 01:28:02 dickey Exp $ +# $XTermId: paste64.pl,v 1.10 2006/03/13 01:28:02 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm # -# -- Thomas Dickey (2006/3/7) +# 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; diff --git a/app/xterm/vttests/resize.pl b/app/xterm/vttests/resize.pl index 21a18beea..29d0d9b8e 100644 --- a/app/xterm/vttests/resize.pl +++ b/app/xterm/vttests/resize.pl @@ -1,7 +1,36 @@ #!/usr/bin/perl -# $XFree86: xc/programs/xterm/vttests/resize.pl,v 1.1 2004/03/04 02:21:58 dickey Exp $ +# $XTermId: resize.pl,v 1.3 2004/03/04 02:21:58 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm # -# -- Thomas Dickey (2004/3/3) +# 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. diff --git a/app/xterm/vttests/tcapquery.pl b/app/xterm/vttests/tcapquery.pl index 54de5d08d..068cb2219 100644 --- a/app/xterm/vttests/tcapquery.pl +++ b/app/xterm/vttests/tcapquery.pl @@ -1,7 +1,36 @@ #!/usr/bin/perl -w -# $XTermId: tcapquery.pl,v 1.13 2008/10/05 16:20:14 tom Exp $ +# $XTermId: tcapquery.pl,v 1.18 2010/01/04 09:43:46 tom Exp $ +# ----------------------------------------------------------------------------- +# this file is part of xterm # -# -- Thomas Dickey (2004/3/3) +# 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; @@ -9,18 +38,20 @@ 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_x); -&getopts('abcefikmx:') || die("Usage: $0 [options]\n +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) - -x KEY extended cursor/editing key (terminfo only) + -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) @@ -32,6 +63,17 @@ if ( not ( defined($opt_c) $opt_a=1; } +sub no_reply($) { + open TTY, "+</dev/tty" or die("Cannot open /dev/tty\n"); + autoflush TTY 1; + my $old=`stty -g`; + system "stty raw -echo min 0 time 5"; + + print TTY @_; + close TTY; + system "stty $old"; +} + sub get_reply($) { open TTY, "+</dev/tty" or die("Cannot open /dev/tty\n"); autoflush TTY 1; @@ -59,6 +101,12 @@ sub hexified($) { 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]; @@ -114,6 +162,7 @@ sub query_tcap($$) { } } +# extended-keys are a feature of ncurses 5.0 and later sub query_extended($) { my $name = $_[0]; my $n; @@ -127,18 +176,23 @@ sub query_extended($) { } } +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( "kl", "kcub1"); -query_tcap( "kd", "kcud1"); query_tcap( "ku", "kcuu1"); +query_tcap( "kd", "kcud1"); query_tcap( "kr", "kcuf1"); +query_tcap( "kl", "kcub1"); -query_tcap( "#4", "kLFT"); -query_tcap( "%c", "kNXT"); -query_tcap( "%e", "kPRV"); +query_tcap( "kF", "kind"); +query_tcap( "kR", "kri"); query_tcap( "%i", "kRIT"); - +query_tcap( "#4", "kLFT"); } if ( defined($opt_a) || defined($opt_e) ) { @@ -157,6 +211,9 @@ 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) ) { @@ -248,3 +305,20 @@ 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"); + } +} |