[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1110771: xterm: allowC1Printable (-k8) does the opposite of what it says



On Mon, Aug 11, 2025 at 03:41:05AM -0400, Thomas Dickey wrote:
> On Mon, Aug 11, 2025 at 02:56:55AM +0200, Vincent Lefevre wrote:
> ....
> given all of the above, I'll probably improve the documentation and close
> this one.  both are good examples of "soapboxing", elevating the severity
> of garden-variety bugs.

I reviewed the examples given (and your comments), and don't see any issues
with #399 and later.  The comments indicate some confusion on your part about
how select/paste work, so I'll expand the manpage to try to address that.

The specific fix made for #399 was in xterm-398d, in case you find someone
willing to make a backport, since it does address a regression since the
previous stable version of Debian.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
# https://invisible-island.net/archives/xterm/patches/temp/xterm-398d.patch.gz
# patch by Thomas E. Dickey <dickey@invisible-island.net>
# created  Tue Aug 12 08:20:23 UTC 2025
# ------------------------------------------------------------------------------
# Tekproc.c           |    6 +++---
# charproc.c          |   23 ++++++++++++++---------
# vttests/palettes.pl |   14 +++++++++-----
# xterm.log.html      |    5 ++++-
# 4 files changed, 30 insertions(+), 18 deletions(-)
# ------------------------------------------------------------------------------
Index: Tekproc.c
--- xterm-398c/Tekproc.c	2024-12-01 20:21:19.000000000 +0000
+++ xterm-398d/Tekproc.c	2025-05-18 20:50:21.000000000 +0000
@@ -1,7 +1,7 @@
-/* $XTermId: Tekproc.c,v 1.254 2024/12/01 20:21:19 tom Exp $ */
+/* $XTermId: Tekproc.c,v 1.255 2025/05/18 20:50:21 tom Exp $ */
 
 /*
- * Copyright 2001-2022,2024 by Thomas E. Dickey
+ * Copyright 2001-2024,2025 by Thomas E. Dickey
  *
  *                         All Rights Reserved
  *
@@ -1628,7 +1628,7 @@
 		      tw->core.width, tw->core.height,
 		      BorderWidth(tw),
 		      (int) tw->core.depth,
-		      InputOutput, CopyFromParent,
+		      InputOutput, (void *) CopyFromParent,
 		      ((*valuemaskp) | CWBackPixel | CWWinGravity),
 		      values);
 
Index: charproc.c
--- xterm-398c/charproc.c	2025-04-20 22:08:07.000000000 +0000
+++ xterm-398d/charproc.c	2025-05-18 20:50:21.000000000 +0000
@@ -1,4 +1,4 @@
-/* $XTermId: charproc.c,v 1.2071 2025/04/20 22:08:07 tom Exp $ */
+/* $XTermId: charproc.c,v 1.2073 2025/05/18 20:50:21 tom Exp $ */
 
 /*
  * Copyright 1999-2024,2025 by Thomas E. Dickey
@@ -3323,14 +3323,19 @@
 	 * ignore it when it was translated from UTF-8, unless the parse-state
 	 * tells us that a C1 would be legal.
 	 */
+	if (screen->wide_chars
+	    && (c >= 128 && c < 160)) {
 #if OPT_C1_PRINT
-	if (!screen->c1_printable)
+	    if (screen->c1_printable) {
+		sp->nextstate = CASE_PRINT;
+		TRACE(("allowC1Printable %04X %s ->%s\n",
+		       c, which_table(sp->parsestate),
+		       visibleVTparse(sp->nextstate)));
+	    } else
 #endif
-	    if (screen->wide_chars
-		&& (c >= 128 && c < 160)) {
-		if (sp->parsestate != ansi_table)
-		    sp->nextstate = CASE_IGNORE;
-	    }
+	    if (sp->parsestate != ansi_table)
+		sp->nextstate = CASE_IGNORE;
+	}
 
 	/*
 	 * If this character is a different width than the last one, put the
@@ -12714,7 +12719,7 @@
 		      xw->core.x, xw->core.y,
 		      xw->core.width, xw->core.height, BorderWidth(xw),
 		      (int) xw->core.depth,
-		      InputOutput, CopyFromParent,
+		      InputOutput, (void *) CopyFromParent,
 		      *valuemask | CWBitGravity, values);
 #if USE_DOUBLE_BUFFER
     if (allocateDbe(xw, &(screen->fullVwin))) {
@@ -12797,7 +12802,7 @@
 			  screen->iconVwin.fullheight,
 			  xw->misc.icon_border_width,
 			  (int) xw->core.depth,
-			  InputOutput, CopyFromParent,
+			  InputOutput, (void *) CopyFromParent,
 			  *valuemask | CWBitGravity | CWBorderPixel,
 			  values);
 #if USE_DOUBLE_BUFFER
Index: vttests/palettes.pl
--- xterm-398c/vttests/palettes.pl	2020-07-01 20:13:58.000000000 +0000
+++ xterm-398d/vttests/palettes.pl	2023-08-28 19:56:54.000000000 +0000
@@ -1,9 +1,9 @@
 #!/usr/bin/env perl
-# $XTermId: palettes.pl,v 1.26 2020/07/01 20:13:58 tom Exp $
+# $XTermId: palettes.pl,v 1.27 2023/08/28 19:56:54 tom Exp $
 # -----------------------------------------------------------------------------
 # this file is part of xterm
 #
-# Copyright 2020 by Thomas E. Dickey
+# Copyright 2020,2023 by Thomas E. Dickey
 #
 #                         All Rights Reserved
 #
@@ -49,7 +49,7 @@
 $| = 1;
 
 our (
-    $opt_a, $opt_b, $opt_d, $opt_g, $opt_i,
+    $opt_a, $opt_b, $opt_d, $opt_g, $opt_i, $opt_p,
     $opt_s, $opt_T, $opt_v, $opt_x, $opt_8
 );
 
@@ -1003,7 +1003,10 @@
     my @themes = @{ $_[0] };
     for my $n ( 0 .. $#themes ) {
         &show_colors( $themes[$n] );
-        sleep $opt_s if ( ( $n != $#themes ) and &isatty );
+        printf STDERR "\033[11i" if ( &isatty and $opt_p );
+        if ( ( $n != $#themes ) and &isatty ) {
+            sleep $opt_s;
+        }
     }
 }
 
@@ -1018,6 +1021,7 @@
   -d FILE dump palette to file after setting colors
   -g      ask terminal for its default background color
   -i      assume terminal colors are reversed, i.e., white-on-black
+  -p      print screen to SVG after each update
   -s SECS sleep this long between changes
   -T TERM override "xterm-256color" for TPUT
   -x TPUT use TPUT program rather than hardcoded escapes
@@ -1034,7 +1038,7 @@
 }
 
 $Getopt::Std::STANDARD_HELP_VERSION = 1;
-&getopts('abd:gis:T:x:v8') || &main::HELP_MESSAGE;
+&getopts('abd:gips:T:x:v8') || &main::HELP_MESSAGE;
 
 &main::HELP_MESSAGE if ( $opt_a and ( $#ARGV >= 0 ) );
 
Index: xterm.log.html
--- xterm-398c/xterm.log.html	2025-05-17 00:58:05.000000000 +0000
+++ xterm-398d/xterm.log.html	2025-05-18 20:24:00.000000000 +0000
@@ -30,7 +30,7 @@
  * sale, use or other dealings in this Software without prior written        *
  * authorization.                                                            *
  *****************************************************************************
-  $XTermId: xterm.log.html,v 1.2693 2025/05/17 00:58:05 tom Exp $
+  $XTermId: xterm.log.html,v 1.2694 2025/05/18 20:24:00 tom Exp $
   -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <html>
@@ -1079,6 +1079,9 @@
   <h1><a name="xterm_dev" id="xterm_dev">Development</a></h1>
 
   <ul>
+    <li>further improve integration between UTF-8 and
+    <tt>allowC1Printable</tt> (report by Matthieu Herrb).</li>
+
     <li>modify one of the missing-character checks to prefer Xft's
     check over the check for missing line-drawing characters
     (Debian #1084794).</li>

Attachment: signature.asc
Description: PGP signature


Reply to: