From unknown Sat Jun 21 10:27:20 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#77994 <77994@debbugs.gnu.org> To: bug#77994 <77994@debbugs.gnu.org> Subject: Status: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 Reply-To: bug#77994 <77994@debbugs.gnu.org> Date: Sat, 21 Jun 2025 17:27:20 +0000 retitle 77994 30.1; Yanking paths or Kanji from Windows produces incorrect = behaviour for pgtk build on WSL2 reassign 77994 emacs submitter 77994 Tim Jim severity 77994 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Tue Apr 22 13:25:18 2025 Received: (at submit) by debbugs.gnu.org; 22 Apr 2025 17:25:18 +0000 Received: from localhost ([127.0.0.1]:49721 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7HMz-0006cT-J4 for submit@debbugs.gnu.org; Tue, 22 Apr 2025 13:25:18 -0400 Received: from lists.gnu.org ([2001:470:142::17]:34446) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7GEq-0003Eh-8U for submit@debbugs.gnu.org; Tue, 22 Apr 2025 12:12:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7GEb-0006LQ-4U for bug-gnu-emacs@gnu.org; Tue, 22 Apr 2025 12:12:35 -0400 Received: from mail-qt1-x833.google.com ([2607:f8b0:4864:20::833]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1u7GEX-000659-3z for bug-gnu-emacs@gnu.org; Tue, 22 Apr 2025 12:12:31 -0400 Received: by mail-qt1-x833.google.com with SMTP id d75a77b69052e-4766cb762b6so289381cf.0 for ; Tue, 22 Apr 2025 09:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745338347; x=1745943147; darn=gnu.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=o+8B50UMG6n2dUbZOwEo0k8XFtz/rOgNG+0O2y+MTis=; b=a7giUqFv5luu8CH00a4iRSLcZbu5O8pV89c55XwmavVaRltBbWW9RCIuGzH5t/f8yW JzjB3CUM6kdaMYSdCteZaOFYmnlW0UhXhry/ZnLtB2kA4hnHsjvpq73hNaKSPpEgdmO7 CK66ndR5UNC4VH7QSHed/OFr1rS/+3RmZ74THqXz+LTMbwqnEJe8CpxqASDNEMCPkIIB K6OAuFf3Asndcb2YCcQXkLrqx1T3/xyNzbufbKIICD16eB47vtq91UgRDnuaFV9ZTYbF K6Ua9K5XhZCy0Hja7bZa1nKQbV4YKC5gv5ZZbmG5bJTrn6f+6SA/AboW+fl/3QAdpJkg bSYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745338347; x=1745943147; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=o+8B50UMG6n2dUbZOwEo0k8XFtz/rOgNG+0O2y+MTis=; b=V7BnyFVux+MgNyFAgp3FqDCkUfR1GIHHKSc+t7S+rlBH6c1h1q7sabG40mFs8/S5kN dnQcMqJuJmoSMry/slWkWjphjqVdvIXeSXOQHEOw7bpAg3pXDDqEF5jbpV3tTzRYnZ9P xBSnN8uLenCFw3n5R4MutWy7Fo3FvEYx53ypSmtfytl0y+Jm++Kn2N3OHv6cJVc74LKo 51rx5Dl/8eNp24qmaJjxRWB99SqYQuCpmMzFBSkOHCPuod93VG9nDndN7rrsQcDLx8CL FkdYjOzUOBSTo+0Vg2hk5mSM1k9L2LpdmURUOp5ONQlXn9C0pm8tTjPOd71tiegt3XYm qo/A== X-Gm-Message-State: AOJu0YxLQp+XpcGukwb8GCL3UH2dInjLo4wLPluyiQ6iCICzBsWAjF5/ k8tfUUJmNuAgprQp9MY6TmGdqgeep2LIwR8NofXNPFW7ZNk8JRcDi0S7xunKcyl48tODPD9xfMU Ji+Kb5sQjzgR7sHQY1KlWbgRE6qcvaA== X-Gm-Gg: ASbGncuKAzWY+VJu7L73uau4RqFtVqkBkJjeeH08hRIqTvvExHY7O6wtBttkf+3KbYm 0QW5AAGUAL0bmJ1/GreYWZv5EllQfWL9Py5H61y1sPo4qCXhpviTE+KjseSeTsRRgd4nwt8E7Td s9JJc33E8yMbonfX7659PfyLerl/Cx7ebRZw== X-Google-Smtp-Source: AGHT+IHGZ8u71erHVZ8VHxWkKaIUS+SRqMdG1frdyli5m5T12jq6fPwFJ0C3VouN2Bh4r/C1RYKXGW2K3irZVWAzerA= X-Received: by 2002:a05:622a:110:b0:476:ae71:eabf with SMTP id d75a77b69052e-47aec50cec8mr304193051cf.21.1745338347092; Tue, 22 Apr 2025 09:12:27 -0700 (PDT) MIME-Version: 1.0 From: Tim Jim Date: Wed, 23 Apr 2025 01:12:15 +0900 X-Gm-Features: ATxdqUEQIowyrLZuaDLVdDFNlM-6rtwscAaOH3MB6xQmMM0ES51Xx97X84kLj8Q Message-ID: Subject: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 To: bug-gnu-emacs@gnu.org Content-Type: multipart/alternative; boundary="000000000000310d3c0633604054" Received-SPF: pass client-ip=2607:f8b0:4864:20::833; envelope-from=redemptiontea@gmail.com; helo=mail-qt1-x833.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 22 Apr 2025 13:25:13 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.0 (/) --000000000000310d3c0633604054 Content-Type: text/plain; charset="UTF-8" Dear Dev Team, I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing two separate bugs(?), I think. I ran a quick comparison using `emacs -Q`, for Emacs compiled with and without `--with-pgtk`. 1. When pasting a path copied from the address bar from Windows Explorer into an Emacs buffer, the path is usually followed by a bunch of null characters, such as ^@ and ^A. Based on my searching, this could be an encoding issue, but I could not find an encoding setting which solves this. 2. Pasting in any Kanji will result in ???? appearing instead of the characters. I can confirm that if I type in Japanese directly into the buffer, it shows up fine. Just to check it wasn't a GTK on WSL problem, I also fired up a gedit session and could successfully paste in the Kanji there. Both problems went away when I compiled without `--with-pgtk`. I.e. I could paste in paths without extra null characters appearing and could paste in Kanji successfully. I'm unsure if this is a bug, or if it's a difference in how system environmental variables are handled. Please could you give me some pointers on how/if this can be resolved? Thanks for all your efforts supporting and developing Emacs! P.S. as a quick addendum to point 1, I had also posted an earlier variation of the question that also included an issue that did turn out to be an encoding issue (trying to paste a degree symbol). That part was solved using `(setq selection-coding-system nil)`, but the path issue remained, so I suspected it might be a different problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU If there is anything else I can add to help debug this please let me know. Also, apologies if this is something obvious that I've missed in the manual. I tried searching the bug tracker too for anything WSL-specific, but I didn't see anything immediately relevant. Regards, Tim Here's the build info: In GNU Emacs 30.1 (build 2, x86_64-pc-linux-gnu, GTK+ Version 3.24.31, cairo version 1.17.4) of 2025-04-14 built on alma-1 Repository revision: 8ac894e2246f25d2a2a97d866b10e6e0b0fede5a Repository branch: HEAD System Description: AlmaLinux 9.5 (Teal Serval) Configured using: 'configure --prefix=/opt/emacs/emacs-30.1 'CFLAGS=-O0 -g3 -march=native' --with-native-compilation --with-imagemagick --with-libsystemd --with-tree-sitter --with-pgtk' Configured features: ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ IMAGEMAGICK JPEG LIBSELINUX LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM GTK3 ZLIB Important settings: value of $LANG: en_GB.UTF-8 locale-coding-system: utf-8-unix Major mode: Fundamental Minor modes in effect: tooltip-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t tool-bar-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t blink-cursor-mode: t minibuffer-regexp-mode: t buffer-read-only: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068 epg-config gnus-util text-property-search time-date subr-x mm-decode mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader cl-loaddefs cl-lib sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win term/common-win touch-screen pgtk-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind inotify dynamic-setting system-font-setting font-render-setting cairo gtk pgtk multi-tty move-toolbar make-network-process native-compile emacs) Memory information: ((conses 16 49099 9416) (symbols 48 5333 0) (strings 32 13223 2649) (string-bytes 1 386103) (vectors 16 8669) (vector-slots 8 123257 9667) (floats 8 23 1) (intervals 56 373 21) (buffers 992 11)) --000000000000310d3c0633604054 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Dear Dev Team,=C2=A0

I've compiled Emacs 30.1 on= AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing = two separate bugs(?), I think.=C2=A0

I ran a quick comparison using `emacs -Q`, for Emacs compiled = with and without `--with-pgtk`.

1. When pasting a path copied from the address bar from Windows E= xplorer into an Emacs buffer, the path is usually followed by a bunch of nu= ll characters, such as ^@ and ^A. Based on my searching, this could be an e= ncoding issue, but I could not find an encoding setting which solves this.= =C2=A0

2. Pasting in any= Kanji will result in ???? appearing instead of the characters. I can confi= rm that if I type in Japanese directly into the buffer, it shows up fine. J= ust to check it wasn't a GTK on WSL problem, I also fired up a gedit se= ssion and could successfully paste in the Kanji there.

Both problems went away when I compiled with= out `--with-pgtk`. I.e. I could paste in paths without extra null character= s appearing and could paste in Kanji successfully.
<= br>
I'm unsure if this is a bug, or if it's = a difference in how system environmental variables are handled. Please coul= d you give me some pointers on how/if this can be resolved?=C2=A0

Thanks for all your efforts suppo= rting and developing Emacs!

P.S. as a quick addendum to point 1, I had also posted an earlier varia= tion of the question that also included an issue that did turn out to be an= encoding issue (trying to paste a degree symbol). That part was solved usi= ng=C2=A0`(setq selection-coding-system nil)`, but the path issue remained, = so I suspected it might be a different problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU





<= div dir=3D"auto">IMAGEMAGICK JPEG LIBSELINUX LIBXML2 MODULES NATIVE_COMP NO= TIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQL= ITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WE= BP XIM GTK3 ZLIB

Importa= nt settings:
=C2=A0 value of $LANG: en_GB.UTF-8
=C2=A0 locale-coding-system: utf-8-unix

Major mode: Fundamental

Minor modes in effect:
=C2=A0 tooltip-mode: t
=C2=A0 global-eldoc-mod= e: t
=C2=A0 show-paren-mode: t
=C2=A0 electric-indent-mode: t
=C2=A0 mouse-wheel-= mode: t
=C2=A0 tool-bar-mode: t
=C2=A0 menu-bar-mode: t
=C2=A0 file-name-shadow-m= ode: t
=C2=A0 global-font-lock-mode: t
=C2=A0 blink-cursor-mode: t
=C2=A0 minibuf= fer-regexp-mode: t
=C2=A0 buffer-read-only: t
<= div dir=3D"auto">=C2=A0 line-number-mode: t
=C2=A0 i= ndent-tabs-mode: t
=C2=A0 transient-mark-mode: t
=C2=A0 auto-composition-mode: t
= =C2=A0 auto-encryption-mode: t
=C2=A0 auto-compressi= on-mode: t

Load-path sha= dows:
None found.

<= div dir=3D"auto">Features:
(shadow sort mail-extr em= acsbug message mailcap yank-media puny dired
dired-l= oaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search time-date subr-x mm= -decode
mm-bodies mm-encode mail-parse rfc2231 maila= bbrev gmm-utils mailheader
cl-loaddefs cl-lib sendma= il rfc2047 rfc2045 ietf-drums mm-util
mail-prsvr mai= l-utils rmc iso-transl tooltip cconv eldoc paren electric
uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel
<= div dir=3D"auto">term/pgtk-win pgtk-win term/common-win touch-screen pgtk-d= nd tool-bar
dnd fontset image regexp-opt fringe tabu= lated-list replace newcomment
text-mode lisp-mode pr= og-mode register page tab-bar menu-bar rfn-eshadow
i= search easymenu timer select scroll-bar mouse jit-lock font-lock syntax
font-core term/tty-colors frame minibuffer nadvice seq = simple cl-generic
indonesian philippine cham georgia= n utf-8-lang misc-lang vietnamese
tibetan thai tai-v= iet lao korean japanese eucjp-ms cp51932 hebrew greek
romanian slovak czech european ethiopic indian cyrillic chinese
composite emoji-zwj charscript charprop case-table epa-hook
jka-cmpr-hook help abbrev obarray oclosure cl-preload= ed button loaddefs
theme-loaddefs faces cus-face mac= roexp files window text-properties
overlay sha1 md5 = base64 format env code-pages mule custom widget keymap
hashtable-print-readable backquote threads dbusbind inotify
dynamic-setting system-font-setting font-render-setting cairo gt= k pgtk
multi-tty move-toolbar make-network-process n= ative-compile emacs)

Mem= ory information:
((conses 16 49099 9416) (symbols 48= 5333 0) (strings 32 13223 2649)
=C2=A0(string-bytes= 1 386103) (vectors 16 8669)
=C2=A0(vector-slots 8 1= 23257 9667) (floats 8 23 1) (intervals 56 373 21)
= =C2=A0(buffers 992 11))

=
--000000000000310d3c0633604054-- From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 23 07:39:48 2025 Received: (at 77994) by debbugs.gnu.org; 23 Apr 2025 11:39:48 +0000 Received: from localhost ([127.0.0.1]:54896 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7YSB-0006t8-NQ for submit@debbugs.gnu.org; Wed, 23 Apr 2025 07:39:48 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58398) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1u7YS6-0006re-DB for 77994@debbugs.gnu.org; Wed, 23 Apr 2025 07:39:44 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1u7YS1-00048e-04; Wed, 23 Apr 2025 07:39:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=lUZUFv3PGSrT7f1xOfbOp07F4VIbbFnTBpn51+FXyg8=; b=fO3lgqXm6v2q 666XiOo7yPt/bY5++PEpofl7z8+9KwS8Gzx7+c8ya3qcRQl4k2uzsdKyKuOq+ShnFYCAXvYns5xZr yIT7JVLTk9laP43e3E6T2613tCOoXrStVZZoDIati2i1YzCndDR/dpPj/wXZJSkZ+9QNYOJTh/p7T N0YjOOt5hacVVKTwN0U1naWxeFri+5IIeCryz7S37tEPS2qWvzaUhFqNn/wEk2phtEqS+crZxwccr ZN1B+ve3tKMHnO+KQwXsHtAVDvRtCBnUNrfRsYCR0qylfn+cRICqiANt2CR9BiF/yV9S5j1inIjOr C87WbP1TToXCu8wn0nT+Zw==; Date: Wed, 23 Apr 2025 14:39:31 +0300 Message-Id: <86selz14zw.fsf@gnu.org> From: Eli Zaretskii To: Tim Jim , Po Lu In-Reply-To: (message from Tim Jim on Wed, 23 Apr 2025 01:12:15 +0900) Subject: Re: bug#77994: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 References: X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77994 Cc: 77994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Tim Jim > Date: Wed, 23 Apr 2025 01:12:15 +0900 > > I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing two > separate bugs(?), I think. > > I ran a quick comparison using `emacs -Q`, for Emacs compiled with and without `--with-pgtk`. > > 1. When pasting a path copied from the address bar from Windows Explorer into an Emacs buffer, the path > is usually followed by a bunch of null characters, such as ^@ and ^A. Based on my searching, this could be > an encoding issue, but I could not find an encoding setting which solves this. > > 2. Pasting in any Kanji will result in ???? appearing instead of the characters. I can confirm that if I type in > Japanese directly into the buffer, it shows up fine. Just to check it wasn't a GTK on WSL problem, I also fired > up a gedit session and could successfully paste in the Kanji there. > > Both problems went away when I compiled without `--with-pgtk`. I.e. I could paste in paths without extra null > characters appearing and could paste in Kanji successfully. > > I'm unsure if this is a bug, or if it's a difference in how system environmental variables are handled. Please > could you give me some pointers on how/if this can be resolved? > > Thanks for all your efforts supporting and developing Emacs! > > P.S. as a quick addendum to point 1, I had also posted an earlier variation of the question that also included > an issue that did turn out to be an encoding issue (trying to paste a degree symbol). That part was solved > using `(setq selection-coding-system nil)`, but the path issue remained, so I suspected it might be a different > problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU > > If there is anything else I can add to help debug this please let me know. Also, apologies if this is something > obvious that I've missed in the manual. I tried searching the bug tracker too for anything WSL-specific, but I > didn't see anything immediately relevant. Thanks. We don't have experts on board who know how WSL2 works wrt interoperability between Windows and Ubuntu, so what GTK does in that case is a mystery to us, I think. I've added Po Lu to the discussion in the hope that he might have some suggestions. I personally have only one idea: try C-x RET x utf-16-le RET and see if this fixes the problems you see. I suspect that WSL2 has some customization options which control how the Windows clipboard is presented to GNU/Linux programs running in Ubuntu. Or maybe you need something to be installed, like xclip or wl-clipboard. From debbugs-submit-bounces@debbugs.gnu.org Wed Apr 23 11:25:47 2025 Received: (at 77994) by debbugs.gnu.org; 23 Apr 2025 15:25:47 +0000 Received: from localhost ([127.0.0.1]:58338 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1u7byp-0003NC-3D for submit@debbugs.gnu.org; Wed, 23 Apr 2025 11:25:47 -0400 Received: from mail-qv1-xf33.google.com ([2607:f8b0:4864:20::f33]:47235) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.84_2) (envelope-from ) id 1u7b3j-0001Vb-0C for 77994@debbugs.gnu.org; Wed, 23 Apr 2025 10:26:48 -0400 Received: by mail-qv1-xf33.google.com with SMTP id 6a1803df08f44-6eaf1b6ce9aso74230886d6.2 for <77994@debbugs.gnu.org>; Wed, 23 Apr 2025 07:26:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1745418397; x=1746023197; darn=debbugs.gnu.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=uNV9oi4obpZwjnvIbjWN74eD1kwCSJEsjMqkrooLm2o=; b=TLcZOn40fQNYckmGz4dD4JimQkbB5ZK0aD3UOntywn+on3KXhijnVd16IYjWMAg7/v DATd23i4OXgp8h/1wkcO/PTIaIwmVdsDeFlrbbsWVijJh2YZZ5Ro14YQ8fgbG8Dmn6Cx 4AluyZMB3wlHsVAqlijJvEhDdv4UqUIycW95kZKFyZKfwHSQ5c4FbaqVaqSrpFN4PzDV LbmMsPUNmVmVg+x7h68zJIVDf6y0S4j1nSyzcVTqilK7blhPIiL0vCJQxZQb+K6ffDnd g2Fzjlmwf+Px78tSyk/2HIvXpkJ5VOnJXuSK6wE5J2CnZWaLwzMXiIqYybcnB29d071J p6Qg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1745418397; x=1746023197; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=uNV9oi4obpZwjnvIbjWN74eD1kwCSJEsjMqkrooLm2o=; b=FZ5VAkFZNxrabBdPbAWoa+6d8/8r07yiIbu4HGZtS5wXFxYawveZpQUnLYXT/H7GJv fttvf2pPhJqW4q7pjV3vpH8p9iSmZh//bb/W5xnXfgeg4NMu4iggnN9AkWxcehDg97Uy 4R3z4T924J1pSaRNd7zGS7VkkIKzOEjpSFQJfpMoREXtPPJTPgzrlotaNiL6niddIwHp t7uxS/ZCpbzJYCyOl4++vTxzlvSl6Z+bhn5+KaY4MC3tqfvxA6K2QTCfr7503psjJrfh sH1ccPSjl7xKzq8ScCxVYUJpkK7aT0m0Vj3X8NsfbqCXPoxxiGhzKFVa/LSDKH5EO3B/ LN1Q== X-Forwarded-Encrypted: i=1; AJvYcCWMTVx86EKeNw7SysJPb+bcdFZ+qFYnfKrf9S12nNpcct/iZ4rhVrQ3vG9REOzkW4cm1XA8qQ==@debbugs.gnu.org X-Gm-Message-State: AOJu0YyudQdtUNDjHyrHKYuZ5rua3ox3nKPKEz+rU+FDxZp0rImy3iA6 KrLtgued/edOsV+rBt9SLlOjjemKlj4I1wlkWQ2NDJJnjdnbhh1YSzDB8XjGBL0QIrpq3nV+1HS DToDnWU7F95TAFUPC1tsrvo49jdA= X-Gm-Gg: ASbGncv3IXD4aw/7y4tFPteu6oRk3mn3hAWuHwRZQa6ClcWWdCZeDCtlQNh6XU1l425 ot9TflW3B3S+SKnCV+fZx/3VF7kUSCA2oL9yIFlWsDJpRqxILCeNYL997ARvcpD8tqziNwdgXBS KW9MflfZM6VT8cLxmaAJc4zOA= X-Google-Smtp-Source: AGHT+IERIfD27sHC00kczar+l4Ga6OoBP7CHbb6MIr06y0JGVFtgIu8qqxsydBbKnyuvuDPRdC4d8Q1AnpCewrjOAqQ= X-Received: by 2002:a05:6214:5292:b0:6e8:fbb7:6764 with SMTP id 6a1803df08f44-6f2c46992f3mr334143376d6.45.1745418396968; Wed, 23 Apr 2025 07:26:36 -0700 (PDT) MIME-Version: 1.0 References: <86selz14zw.fsf@gnu.org> In-Reply-To: <86selz14zw.fsf@gnu.org> From: Tim Jim Date: Wed, 23 Apr 2025 23:26:25 +0900 X-Gm-Features: ATxdqUEP-AYHUrASxnSgzrpdNPMXpQl5dvqj7f1SbC2O-cDaWg7Suqv6PUJM0fw Message-ID: Subject: Re: bug#77994: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 To: Eli Zaretskii Content-Type: multipart/alternative; boundary="000000000000892a69063372e361" X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 77994 X-Mailman-Approved-At: Wed, 23 Apr 2025 11:25:41 -0400 Cc: Po Lu , 77994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --000000000000892a69063372e361 Content-Type: text/plain; charset="UTF-8" Dear Eli, Thank you for the tips! I did try setting the encoding to utf-16-le (and a few others for testing) but it just resulted in even more of the pasted path becoming even more garbled. I'm not sure why, but when running Emacs compiled without pgtk, the default recording seems to handle the paste with no issues. Does the pgtk version handle clipboard contents differently? Also just to clarify, I want running Ubuntu but AlmaLinux (so closer to Fedora/RHEL) - I think you might still be right though; it's probably something missing rather than the exact distro causing issues. Thank you for the ideas so far! On Wed, 23 Apr 2025, 20:39 Eli Zaretskii, wrote: > > From: Tim Jim > > Date: Wed, 23 Apr 2025 01:12:15 +0900 > > > > I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as > per the subject, I'm seeing two > > separate bugs(?), I think. > > > > I ran a quick comparison using `emacs -Q`, for Emacs compiled with and > without `--with-pgtk`. > > > > 1. When pasting a path copied from the address bar from Windows Explorer > into an Emacs buffer, the path > > is usually followed by a bunch of null characters, such as ^@ and ^A. > Based on my searching, this could be > > an encoding issue, but I could not find an encoding setting which solves > this. > > > > 2. Pasting in any Kanji will result in ???? appearing instead of the > characters. I can confirm that if I type in > > Japanese directly into the buffer, it shows up fine. Just to check it > wasn't a GTK on WSL problem, I also fired > > up a gedit session and could successfully paste in the Kanji there. > > > > Both problems went away when I compiled without `--with-pgtk`. I.e. I > could paste in paths without extra null > > characters appearing and could paste in Kanji successfully. > > > > I'm unsure if this is a bug, or if it's a difference in how system > environmental variables are handled. Please > > could you give me some pointers on how/if this can be resolved? > > > > Thanks for all your efforts supporting and developing Emacs! > > > > P.S. as a quick addendum to point 1, I had also posted an earlier > variation of the question that also included > > an issue that did turn out to be an encoding issue (trying to paste a > degree symbol). That part was solved > > using `(setq selection-coding-system nil)`, but the path issue remained, > so I suspected it might be a different > > problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU > > > > If there is anything else I can add to help debug this please let me > know. Also, apologies if this is something > > obvious that I've missed in the manual. I tried searching the bug > tracker too for anything WSL-specific, but I > > didn't see anything immediately relevant. > > Thanks. > > We don't have experts on board who know how WSL2 works wrt > interoperability between Windows and Ubuntu, so what GTK does in that > case is a mystery to us, I think. I've added Po Lu to the discussion > in the hope that he might have some suggestions. > > I personally have only one idea: try > > C-x RET x utf-16-le RET > > and see if this fixes the problems you see. > > I suspect that WSL2 has some customization options which control how > the Windows clipboard is presented to GNU/Linux programs running in > Ubuntu. > > Or maybe you need something to be installed, like xclip or > wl-clipboard. > --000000000000892a69063372e361 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Dear Eli,

Thank you for the tips! I did try setting the encoding to ut= f-16-le (and a few others for testing) but it just resulted in even more of= the pasted path becoming even more garbled.

I'm not sure why, but when running Emacs compiled withou= t pgtk, the default recording seems to handle the paste with no issues. Doe= s the pgtk version handle clipboard contents differently?

Also just to clarify, I want running Ubuntu but AlmaLinux (s= o closer to Fedora/RHEL) - I think you might still be right though; it'= s probably something missing rather than the exact distro causing issues.

Thank you for the ideas so far!


> From: Tim Jim <redemptiontea@gmail.com> > Date: Wed, 23 Apr 2025 01:12:15 +0900
>
> I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk;= as per the subject, I'm seeing two
> separate bugs(?), I think.
>
> I ran a quick comparison using `emacs -Q`, for Emacs compiled with and= without `--with-pgtk`.
>
> 1. When pasting a path copied from the address bar from Windows Explor= er into an Emacs buffer, the path
> is usually followed by a bunch of null characters, such as ^@ and ^A. = Based on my searching, this could be
> an encoding issue, but I could not find an encoding setting which solv= es this.
>
> 2. Pasting in any Kanji will result in ???? appearing instead of the c= haracters. I can confirm that if I type in
> Japanese directly into the buffer, it shows up fine. Just to check it = wasn't a GTK on WSL problem, I also fired
> up a gedit session and could successfully paste in the Kanji there. >
> Both problems went away when I compiled without `--with-pgtk`. I.e. I = could paste in paths without extra null
> characters appearing and could paste in Kanji successfully.
>
> I'm unsure if this is a bug, or if it's a difference in how sy= stem environmental variables are handled. Please
> could you give me some pointers on how/if this can be resolved?
>
> Thanks for all your efforts supporting and developing Emacs!
>
> P.S. as a quick addendum to point 1, I had also posted an earlier vari= ation of the question that also included
> an issue that did turn out to be an encoding issue (trying to paste a = degree symbol). That part was solved
> using `(setq selection-coding-system nil)`, but the path issue remaine= d, so I suspected it might be a different
> problem. https://www.reddit.com/r/emacs= /s/6w1L3CiyAU
>
> If there is anything else I can add to help debug this please let me k= now. Also, apologies if this is something
> obvious that I've missed in the manual. I tried searching the bug = tracker too for anything WSL-specific, but I
> didn't see anything immediately relevant.

Thanks.

We don't have experts on board who know how WSL2 works wrt
interoperability between Windows and Ubuntu, so what GTK does in that
case is a mystery to us, I think.=C2=A0 I've added Po Lu to the discuss= ion
in the hope that he might have some suggestions.

I personally have only one idea: try

=C2=A0 C-x RET x utf-16-le RET

and see if this fixes the problems you see.

I suspect that WSL2 has some customization options which control how
the Windows clipboard is presented to GNU/Linux programs running in
Ubuntu.

Or maybe you need something to be installed, like xclip or
wl-clipboard.
--000000000000892a69063372e361-- From debbugs-submit-bounces@debbugs.gnu.org Sat May 10 05:18:21 2025 Received: (at 77994) by debbugs.gnu.org; 10 May 2025 09:18:21 +0000 Received: from localhost ([127.0.0.1]:43765 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uDgLc-0004WI-HM for submit@debbugs.gnu.org; Sat, 10 May 2025 05:18:21 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:39532) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uDgLZ-0004W2-To for 77994@debbugs.gnu.org; Sat, 10 May 2025 05:18:18 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uDgLU-0008IO-J6; Sat, 10 May 2025 05:18:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rCwhq/00NF82gTN2zaDJdrgG1cUSiwEGYv8Z4uVWQ3s=; b=AqHOM0ecSkOy Q05ySwfQrHJjVxwNzUrJy2vyuTKtLTqeQpg9YdwODKPxa0K+nS/7fB5UJ/Fr/86Nsw+scnLELmrdE gBe49M7vTinN5znRIQJAknB40ihrVRCavFnMCGYZ7D5PWCBu402tqg88CLx3K/L4GSLr1Ey5XGBGN cQ1Z++waXUdj8S+6RcXI6l02DneVLwj+yoeaBuxy0EIh/IcvWUPdofg6ofWM+lNKvLo8Y3JXjY9uC QVkoDFmRIbnbvIAboJNC7L6gKFkx/pi15ePqJ5t8SkXUvI8/BDqiStRV6HsW0dNuebYi0qxxEH6WH 1l1AVPFXlZFoxBK15eoY4w==; Date: Sat, 10 May 2025 12:18:10 +0300 Message-Id: <86plggbz8t.fsf@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com, Tim Jim In-Reply-To: (message from Tim Jim on Wed, 23 Apr 2025 23:26:25 +0900) Subject: Re: bug#77994: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 References: <86selz14zw.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77994 Cc: 77994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Po Lu, any further comments or suggestions? > From: Tim Jim > Date: Wed, 23 Apr 2025 23:26:25 +0900 > Cc: Po Lu , 77994@debbugs.gnu.org > > > Dear Eli, > > Thank you for the tips! I did try setting the encoding to utf-16-le (and a few others for testing) but it just > resulted in even more of the pasted path becoming even more garbled. > > I'm not sure why, but when running Emacs compiled without pgtk, the default recording seems to handle the > paste with no issues. Does the pgtk version handle clipboard contents differently? > > Also just to clarify, I want running Ubuntu but AlmaLinux (so closer to Fedora/RHEL) - I think you might still be > right though; it's probably something missing rather than the exact distro causing issues. > > Thank you for the ideas so far! > > On Wed, 23 Apr 2025, 20:39 Eli Zaretskii, wrote: > > > From: Tim Jim > > Date: Wed, 23 Apr 2025 01:12:15 +0900 > > > > I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing > two > > separate bugs(?), I think. > > > > I ran a quick comparison using `emacs -Q`, for Emacs compiled with and without `--with-pgtk`. > > > > 1. When pasting a path copied from the address bar from Windows Explorer into an Emacs buffer, > the path > > is usually followed by a bunch of null characters, such as ^@ and ^A. Based on my searching, this > could be > > an encoding issue, but I could not find an encoding setting which solves this. > > > > 2. Pasting in any Kanji will result in ???? appearing instead of the characters. I can confirm that if I > type in > > Japanese directly into the buffer, it shows up fine. Just to check it wasn't a GTK on WSL problem, I > also fired > > up a gedit session and could successfully paste in the Kanji there. > > > > Both problems went away when I compiled without `--with-pgtk`. I.e. I could paste in paths without > extra null > > characters appearing and could paste in Kanji successfully. > > > > I'm unsure if this is a bug, or if it's a difference in how system environmental variables are handled. > Please > > could you give me some pointers on how/if this can be resolved? > > > > Thanks for all your efforts supporting and developing Emacs! > > > > P.S. as a quick addendum to point 1, I had also posted an earlier variation of the question that also > included > > an issue that did turn out to be an encoding issue (trying to paste a degree symbol). That part was > solved > > using `(setq selection-coding-system nil)`, but the path issue remained, so I suspected it might be a > different > > problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU > > > > If there is anything else I can add to help debug this please let me know. Also, apologies if this is > something > > obvious that I've missed in the manual. I tried searching the bug tracker too for anything > WSL-specific, but I > > didn't see anything immediately relevant. > > Thanks. > > We don't have experts on board who know how WSL2 works wrt > interoperability between Windows and Ubuntu, so what GTK does in that > case is a mystery to us, I think. I've added Po Lu to the discussion > in the hope that he might have some suggestions. > > I personally have only one idea: try > > C-x RET x utf-16-le RET > > and see if this fixes the problems you see. > > I suspect that WSL2 has some customization options which control how > the Windows clipboard is presented to GNU/Linux programs running in > Ubuntu. > > Or maybe you need something to be installed, like xclip or > wl-clipboard. From debbugs-submit-bounces@debbugs.gnu.org Sat May 24 04:49:45 2025 Received: (at 77994) by debbugs.gnu.org; 24 May 2025 08:49:45 +0000 Received: from localhost ([127.0.0.1]:56778 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uIkZc-0006Cx-FH for submit@debbugs.gnu.org; Sat, 24 May 2025 04:49:45 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:48496) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uIkZZ-0006C8-I0 for 77994@debbugs.gnu.org; Sat, 24 May 2025 04:49:42 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uIkZT-0006o4-O0; Sat, 24 May 2025 04:49:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=UG7R7NNAr3gLhpaZFCqrqfB8cGs94yuQxLSDbs9O8qQ=; b=HBsKJqSsogOp IqA7XRXzieku7i6KBihfhc708ENMjpjXwCsSXKZIsPnRhIcQquc4BCKBB7Ek+/6mHHa9UIRl8KhRJ 3T6jOd89JjKO9cE8fDO5APtvQ72wXHeKcui3d39IiZL+4jlVeUxfIG3xBsHHV94bOPdkqs7+OMCyu Mj+dHaUBm1T8dfFEL64tuqMfCQhgJVFcb6ijOdOfee4muRwaz+ik+mpYXEN8WF5zthQI1SFbqxgMW MF5BnyS/jLlzWFXFSAYMtFclkmAuudlhmF36eg/XJXeKG71xJLycmythzXHEIRtGQBtrORBr91sjW 5/szGh8qWy8R1WYQxp0sqA==; Date: Sat, 24 May 2025 11:49:33 +0300 Message-Id: <86jz662y1u.fsf@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <86plggbz8t.fsf@gnu.org> (message from Eli Zaretskii on Sat, 10 May 2025 12:18:10 +0300) Subject: Re: bug#77994: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 References: <86selz14zw.fsf@gnu.org> <86plggbz8t.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77994 Cc: redemptiontea@gmail.com, 77994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Po Lu, please respond. > Cc: 77994@debbugs.gnu.org > Date: Sat, 10 May 2025 12:18:10 +0300 > From: Eli Zaretskii > > Po Lu, any further comments or suggestions? > > > From: Tim Jim > > Date: Wed, 23 Apr 2025 23:26:25 +0900 > > Cc: Po Lu , 77994@debbugs.gnu.org > > > > > > Dear Eli, > > > > Thank you for the tips! I did try setting the encoding to utf-16-le (and a few others for testing) but it just > > resulted in even more of the pasted path becoming even more garbled. > > > > I'm not sure why, but when running Emacs compiled without pgtk, the default recording seems to handle the > > paste with no issues. Does the pgtk version handle clipboard contents differently? > > > > Also just to clarify, I want running Ubuntu but AlmaLinux (so closer to Fedora/RHEL) - I think you might still be > > right though; it's probably something missing rather than the exact distro causing issues. > > > > Thank you for the ideas so far! > > > > On Wed, 23 Apr 2025, 20:39 Eli Zaretskii, wrote: > > > > > From: Tim Jim > > > Date: Wed, 23 Apr 2025 01:12:15 +0900 > > > > > > I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing > > two > > > separate bugs(?), I think. > > > > > > I ran a quick comparison using `emacs -Q`, for Emacs compiled with and without `--with-pgtk`. > > > > > > 1. When pasting a path copied from the address bar from Windows Explorer into an Emacs buffer, > > the path > > > is usually followed by a bunch of null characters, such as ^@ and ^A. Based on my searching, this > > could be > > > an encoding issue, but I could not find an encoding setting which solves this. > > > > > > 2. Pasting in any Kanji will result in ???? appearing instead of the characters. I can confirm that if I > > type in > > > Japanese directly into the buffer, it shows up fine. Just to check it wasn't a GTK on WSL problem, I > > also fired > > > up a gedit session and could successfully paste in the Kanji there. > > > > > > Both problems went away when I compiled without `--with-pgtk`. I.e. I could paste in paths without > > extra null > > > characters appearing and could paste in Kanji successfully. > > > > > > I'm unsure if this is a bug, or if it's a difference in how system environmental variables are handled. > > Please > > > could you give me some pointers on how/if this can be resolved? > > > > > > Thanks for all your efforts supporting and developing Emacs! > > > > > > P.S. as a quick addendum to point 1, I had also posted an earlier variation of the question that also > > included > > > an issue that did turn out to be an encoding issue (trying to paste a degree symbol). That part was > > solved > > > using `(setq selection-coding-system nil)`, but the path issue remained, so I suspected it might be a > > different > > > problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU > > > > > > If there is anything else I can add to help debug this please let me know. Also, apologies if this is > > something > > > obvious that I've missed in the manual. I tried searching the bug tracker too for anything > > WSL-specific, but I > > > didn't see anything immediately relevant. > > > > Thanks. > > > > We don't have experts on board who know how WSL2 works wrt > > interoperability between Windows and Ubuntu, so what GTK does in that > > case is a mystery to us, I think. I've added Po Lu to the discussion > > in the hope that he might have some suggestions. > > > > I personally have only one idea: try > > > > C-x RET x utf-16-le RET > > > > and see if this fixes the problems you see. > > > > I suspect that WSL2 has some customization options which control how > > the Windows clipboard is presented to GNU/Linux programs running in > > Ubuntu. > > > > Or maybe you need something to be installed, like xclip or > > wl-clipboard. > > > > From debbugs-submit-bounces@debbugs.gnu.org Sat Jun 07 04:13:47 2025 Received: (at 77994) by debbugs.gnu.org; 7 Jun 2025 08:13:47 +0000 Received: from localhost ([127.0.0.1]:46676 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1uNogU-0004BX-OG for submit@debbugs.gnu.org; Sat, 07 Jun 2025 04:13:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:38374) by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1uNogS-0004BF-4d for 77994@debbugs.gnu.org; Sat, 07 Jun 2025 04:13:45 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1uNogL-0002dc-TK; Sat, 07 Jun 2025 04:13:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=+fobJEcSno7xVUVAjwM4GvW9GyRCxC4V29IVQ/dh1fk=; b=In3wK5F+4RkP 3UMJLvjrgoHn80f4o39DpsOG1IFfi22HRG5McVpS6zeIegZWgZ5WeA2zz5S2u79PMypg6jO9ShkvZ B5fmnlHuUOHGvRtHOrwkUplW99QEeoNCOHuIfiE9QSH4uxKfR4l4e6A4EE3mZ4NpA3hCTInWuYhUw jeyEyRxh/vDxtvJC9C0OmObfNN+VHGYMdZlFhfsRbFB7HzzCb2XFcR/gJOVQT6k6LNCE3Ot16m4yD 7qbHZXqw1JW7c8EujPUv3+4EHe+461+Ua7x1lDuA4EW0bqF72BmzBeL5Kl0shEGuX+ZjYsmZfWSO6 XOOWSmhFZw6SnHboYC32LQ==; Date: Sat, 07 Jun 2025 11:13:33 +0300 Message-Id: <86ldq4j7f6.fsf@gnu.org> From: Eli Zaretskii To: luangruo@yahoo.com In-Reply-To: <86jz662y1u.fsf@gnu.org> (message from Eli Zaretskii on Sat, 24 May 2025 11:49:33 +0300) Subject: Re: bug#77994: 30.1; Yanking paths or Kanji from Windows produces incorrect behaviour for pgtk build on WSL2 References: <86selz14zw.fsf@gnu.org> <86plggbz8t.fsf@gnu.org> <86jz662y1u.fsf@gnu.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 77994 Cc: redemptiontea@gmail.com, 77994@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) Ping! Ping! Po Lu, would you please respond? > Cc: redemptiontea@gmail.com, 77994@debbugs.gnu.org > Date: Sat, 24 May 2025 11:49:33 +0300 > From: Eli Zaretskii > > Ping! Po Lu, please respond. > > > Cc: 77994@debbugs.gnu.org > > Date: Sat, 10 May 2025 12:18:10 +0300 > > From: Eli Zaretskii > > > > Po Lu, any further comments or suggestions? > > > > > From: Tim Jim > > > Date: Wed, 23 Apr 2025 23:26:25 +0900 > > > Cc: Po Lu , 77994@debbugs.gnu.org > > > > > > > > > Dear Eli, > > > > > > Thank you for the tips! I did try setting the encoding to utf-16-le (and a few others for testing) but it just > > > resulted in even more of the pasted path becoming even more garbled. > > > > > > I'm not sure why, but when running Emacs compiled without pgtk, the default recording seems to handle the > > > paste with no issues. Does the pgtk version handle clipboard contents differently? > > > > > > Also just to clarify, I want running Ubuntu but AlmaLinux (so closer to Fedora/RHEL) - I think you might still be > > > right though; it's probably something missing rather than the exact distro causing issues. > > > > > > Thank you for the ideas so far! > > > > > > On Wed, 23 Apr 2025, 20:39 Eli Zaretskii, wrote: > > > > > > > From: Tim Jim > > > > Date: Wed, 23 Apr 2025 01:12:15 +0900 > > > > > > > > I've compiled Emacs 30.1 on AlmaLinux 9 running in WSL2 with pgtk; as per the subject, I'm seeing > > > two > > > > separate bugs(?), I think. > > > > > > > > I ran a quick comparison using `emacs -Q`, for Emacs compiled with and without `--with-pgtk`. > > > > > > > > 1. When pasting a path copied from the address bar from Windows Explorer into an Emacs buffer, > > > the path > > > > is usually followed by a bunch of null characters, such as ^@ and ^A. Based on my searching, this > > > could be > > > > an encoding issue, but I could not find an encoding setting which solves this. > > > > > > > > 2. Pasting in any Kanji will result in ???? appearing instead of the characters. I can confirm that if I > > > type in > > > > Japanese directly into the buffer, it shows up fine. Just to check it wasn't a GTK on WSL problem, I > > > also fired > > > > up a gedit session and could successfully paste in the Kanji there. > > > > > > > > Both problems went away when I compiled without `--with-pgtk`. I.e. I could paste in paths without > > > extra null > > > > characters appearing and could paste in Kanji successfully. > > > > > > > > I'm unsure if this is a bug, or if it's a difference in how system environmental variables are handled. > > > Please > > > > could you give me some pointers on how/if this can be resolved? > > > > > > > > Thanks for all your efforts supporting and developing Emacs! > > > > > > > > P.S. as a quick addendum to point 1, I had also posted an earlier variation of the question that also > > > included > > > > an issue that did turn out to be an encoding issue (trying to paste a degree symbol). That part was > > > solved > > > > using `(setq selection-coding-system nil)`, but the path issue remained, so I suspected it might be a > > > different > > > > problem. https://www.reddit.com/r/emacs/s/6w1L3CiyAU > > > > > > > > If there is anything else I can add to help debug this please let me know. Also, apologies if this is > > > something > > > > obvious that I've missed in the manual. I tried searching the bug tracker too for anything > > > WSL-specific, but I > > > > didn't see anything immediately relevant. > > > > > > Thanks. > > > > > > We don't have experts on board who know how WSL2 works wrt > > > interoperability between Windows and Ubuntu, so what GTK does in that > > > case is a mystery to us, I think. I've added Po Lu to the discussion > > > in the hope that he might have some suggestions. > > > > > > I personally have only one idea: try > > > > > > C-x RET x utf-16-le RET > > > > > > and see if this fixes the problems you see. > > > > > > I suspect that WSL2 has some customization options which control how > > > the Windows clipboard is presented to GNU/Linux programs running in > > > Ubuntu. > > > > > > Or maybe you need something to be installed, like xclip or > > > wl-clipboard. > > > > > > > > > > > >