Re: xsrc/60398 (Line drawing in xterm does not work as expected)

"Michael van Elst via gnats" <[email protected]>
Newsgroups gmane.os.netbsd.bugs
Message-ID <[email protected]>
The following reply was made to PR xsrc/60398; it has been noted by GNATS.

From: [email protected] (Michael van Elst)
To: [email protected]
Cc: 
Subject: Re: xsrc/60398 (Line drawing in xterm does not work as expected)
Date: Sat, 4 Jul 2026 06:17:21 -0000 (UTC)

 [email protected] ("Michael van Elst via gnats") writes:
 
 >The following reply was made to PR xsrc/60398; it has been noted by GNATS.
 
 >From: [email protected] (Michael van Elst)
 >To: [email protected]
 >Cc: 
 >Subject: Re: xsrc/60398 (Line drawing in xterm does not work as expected)
 >Date: Fri, 3 Jul 2026 22:52:15 -0000 (UTC)
 
 > [email protected] ("Valery Ushakov via gnats") writes:
 > 
 > >   https://xterm.dev/changelog-xterm/#xterm_407
 > >   https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1124802
 > 
 > 
 > Yes,
 > 
 > | improve switching to/from UTF-8 mode by saving, restoring and resetting the G0-G3 array (Debian #1124802).
 > 
 > that's it.
 > 
 
 
 Here is a point fix with only that change:
 
 
 Index: external/mit/xterm/dist/ptydata.c
 ===================================================================
 RCS file: /cvsroot/xsrc/external/mit/xterm/dist/ptydata.c,v
 retrieving revision 1.1.1.12
 diff -p -u -r1.1.1.12 ptydata.c
 --- external/mit/xterm/dist/ptydata.c	9 Mar 2025 23:17:11 -0000	1.1.1.12
 +++ external/mit/xterm/dist/ptydata.c	4 Jul 2026 06:13:12 -0000
 @@ -345,6 +345,12 @@ switchPtyData(TScreen *screen, int flag)
  	mk_wcwidth_init(screen->utf8_mode);
  
  	TRACE(("turning UTF-8 mode %s\n", BtoS(flag)));
 +	if (flag) {
 +	    saveCharsets(screen, screen->ansi_save_gsets);
 +	    resetCharsets(screen);
 +	} else {
 +	    restoreCharsets(screen, screen->ansi_save_gsets);
 +	}
  	update_font_utf8_mode();
      }
  }
 @@ -654,6 +660,25 @@ Panic(const char *s, int a)
  }
  
  #if OPT_WIDE_CHARS
 +void
 +saveCharsets(TScreen *screen, DECNRCM_codes * target)
 +{
 +    (void) screen;
 +    (void) target;
 +}
 + 
 +void
 +restoreCharsets(TScreen *screen, const DECNRCM_codes * target)
 +{
 +    (void) screen;
 +    (void) target;
 +}
 +
 +void
 +resetCharsets(TScreen *screen)
 +{
 +    (void) screen;
 +}
  
  #ifdef ALLOWLOGGING
  void
 Index: external/mit/xterm/dist/ptyx.h
 ===================================================================
 RCS file: /cvsroot/xsrc/external/mit/xterm/dist/ptyx.h,v
 retrieving revision 1.22
 diff -p -u -r1.22 ptyx.h
 --- external/mit/xterm/dist/ptyx.h	9 Mar 2025 23:18:48 -0000	1.22
 +++ external/mit/xterm/dist/ptyx.h	4 Jul 2026 06:13:12 -0000
 @@ -2917,6 +2917,9 @@ typedef struct {
  	Char		vt52_save_curss;
  	DECNRCM_codes	vt52_save_gsets[NUM_GSETS2];
  #endif
 +#if OPT_WIDE_CHARS
 +	DECNRCM_codes	ansi_save_gsets[NUM_GSETS2];
 +#endif
  	/* Testing */
  #if OPT_XMC_GLITCH
  	unsigned	xmc_glitch;	/* # of spaces to pad on SGR's	*/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.