From unknown Sat Jun 21 12:11:31 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#51501 <51501@debbugs.gnu.org> To: bug#51501 <51501@debbugs.gnu.org> Subject: Status: 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-Windows Reply-To: bug#51501 <51501@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:11:31 +0000 retitle 51501 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-W= indows reassign 51501 emacs submitter 51501 Eli Zaretskii severity 51501 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 04:47:57 2021 Received: (at submit) by debbugs.gnu.org; 30 Oct 2021 08:47:57 +0000 Received: from localhost ([127.0.0.1]:56610 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgk1s-0007kx-RF for submit@debbugs.gnu.org; Sat, 30 Oct 2021 04:47:57 -0400 Received: from lists.gnu.org ([209.51.188.17]:54826) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgk1q-0007kb-Bd for submit@debbugs.gnu.org; Sat, 30 Oct 2021 04:47:55 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37262) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgk1q-0000qP-1t for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 04:47:54 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48484) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgk1p-0000D6-QV for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 04:47:53 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=Subject:To:From:Date:mime-version:in-reply-to: references; bh=Am6kae3R8ROPxyRgutlGgqdHlPXKiy6lGbo6A9KWUL8=; b=cVjsxhkZ9c9nVu bLZQhIsce35ouuSy8XGOFlrH96yBvcLIqooQj6KhiFkhE1Svacv/LwBsTyqkFNhM3s76r2K7cwaUI sG9nv/fiMca7X+odNEvK3s5vQO9PssbZGLsmldVQFnM7ZIhqwbVdwWI/7SrCGYhVmlfpU1ADiOS3c y10/tLSaZr3DherXqO3I71pBgW7AN/xVWhhlq4RdWJYhUFF9+C6fJCawoe8HxRyASk8HIuStols01 7p6Iaa5tygtMk9pp0f/iToCZdmy1G7vXcgc9j4AbvSNXwybcPQzGDDyt0YQGKZ82UX95Q4xSjKU4M ZWonazsDSzfBae9GrXRQ==; Received: from [87.69.77.57] (port=2034 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgk1p-00058W-AL for bug-gnu-emacs@gnu.org; Sat, 30 Oct 2021 04:47:53 -0400 Date: Sat, 30 Oct 2021 11:47:41 +0300 Message-Id: <83h7cyq4pe.fsf@gnu.org> From: Eli Zaretskii To: bug-gnu-emacs@gnu.org Subject: 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-Windows X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit 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 (---) Observe: (shell-quote-argument "foo") => "\"foo\"" This is OK. (shell-quote-argument "foo^") => "\"foo^\"" Also OK. (shell-quote-argument "foo^!") => "^\"foo^^^!^\"" This is definitely NOT okay. This problem gets in the way when invoking Git from Emacs, where "abcdef^!" has special meaning. I'd prefer shell-quote-argument not to handle the tricky issue of "^" at all on MS-Windows. It is basically impossible to get that right, especially if the command invoked with the quoted string is a batch file, or a batch file that calls another batch file, because each invocation of a batch file removes one level of "^" quoting, and there's nothing Emacs can do with this. In GNU Emacs 28.0.60 (build 106, i686-pc-mingw32) of 2021-10-30 built on HOME-C4E4A596F7 Repository revision: 3f998a3fc823df6117cfc286a557d495bc8ee11e Repository branch: emacs-28 Windowing system distributor 'Microsoft Corp.', version 5.1.2600 System Description: Microsoft Windows XP Service Pack 3 (v5.1.0.2600) Configured using: 'configure -C --prefix=/d/usr --with-wide-int --with-modules --enable-checking=yes,glyphs 'CFLAGS=-O0 -gdwarf-4 -g3'' Configured features: ACL GIF GMP GNUTLS HARFBUZZ JPEG JSON LCMS2 LIBXML2 MODULES NOTIFY W32NOTIFY PDUMPER PNG RSVG SOUND THREADS TIFF TOOLKIT_SCROLL_BARS XPM ZLIB Important settings: value of $LANG: ENU locale-coding-system: cp1255 Major mode: Lisp Interaction Minor modes in effect: tooltip-mode: t global-eldoc-mode: t 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 font-lock-mode: t blink-cursor-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t line-number-mode: t indent-tabs-mode: t transient-mark-mode: t Load-path shadows: None found. Features: (shadow sort mail-extr emacsbug message rmc puny dired dired-loaddefs rfc822 mml mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs auth-source cl-seq eieio eieio-core cl-macs eieio-loaddefs password-cache json map text-property-search time-date subr-x seq byte-opt gv bytecomp byte-compile cconv 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 iso-transl tooltip eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel dos-w32 ls-lisp disp-table term/w32-win w32-win w32-vars term/common-win 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 cl-generic 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 simple abbrev obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget hashtable-print-readable backquote threads w32notify w32 lcms2 multi-tty make-network-process emacs) Memory information: ((conses 16 56990 12610) (symbols 48 7804 1) (strings 16 21660 3099) (string-bytes 1 632817) (vectors 16 13635) (vector-slots 8 180238 12742) (floats 8 23 261) (intervals 40 294 222) (buffers 888 11)) From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 04:51:20 2021 Received: (at 51501) by debbugs.gnu.org; 30 Oct 2021 08:51:21 +0000 Received: from localhost ([127.0.0.1]:56619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgk5A-0007qw-Oc for submit@debbugs.gnu.org; Sat, 30 Oct 2021 04:51:20 -0400 Received: from heytings.org ([95.142.160.155]:41712) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgk59-0007qp-GL for 51501@debbugs.gnu.org; Sat, 30 Oct 2021 04:51:19 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1635583878; bh=5xvc8lw1VgZw+t9eiF4Kc10jWBOvWMVS8RF4UTGuOm0=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=YzGOeROOh7oOXIuMoXfOzUXoNXtEyk3iHjX9BCWmUVZv3E+SinwbARFWNUA4xhygB 84spkNEqNaEvLhQFTyRec/5lWquZSehIb46HgP4cKSIGcoMyQ9EXhJiyLsuVf+YvNA 8L0hRLOtG0zjF4BmJAElTG5yeD5+1H4y18AZv0TzPu8kx/zCznVN2TOUL/mKL+NVzA A/oD3ghv8m4OsUU1zrB3eWf+Lzo3R4ptZar3ZWyIu0u12YeOkkH8n3NtMeocwJAKFM SWAe+pXslOu/+GCnB7yUdNWT8m7fTrOYh/z1YPfAJ+oih9yRGmPO/dbBwk52zmWSiN 6X412CYfgqrqg== Date: Sat, 30 Oct 2021 08:51:18 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#51501: 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-Windows In-Reply-To: <83h7cyq4pe.fsf@gnu.org> Message-ID: <04203f39462b1d1585ed@heytings.org> References: <83h7cyq4pe.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51501 Cc: 51501@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 (-) > > (shell-quote-argument "foo^!") => "^\"foo^^^!^\"" > > This is definitely NOT okay. > Is this with emacs -Q? I get "foo\\^\\!". From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 05:08:34 2021 Received: (at 51501) by debbugs.gnu.org; 30 Oct 2021 09:08:34 +0000 Received: from localhost ([127.0.0.1]:56628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgkLp-0008Io-Pd for submit@debbugs.gnu.org; Sat, 30 Oct 2021 05:08:33 -0400 Received: from heytings.org ([95.142.160.155]:41740) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgkLn-0008If-PH for 51501@debbugs.gnu.org; Sat, 30 Oct 2021 05:08:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20210101; t=1635584910; bh=8zZWz4banhEUR9GuKaLKewdrGWXMPnJifeU9oKdm61c=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=SqnK4Gi2Hjj+sMbdLnkvcwy6yW6s7TCGxnAa8zUY8DRb50RfOoQo3r+9janFqmUq6 UaPUItqyBsmDqa+r+Dk7q9SNpfzz5Hp2Fn4/cVNhnA8HSYiE4t3H6ckDnLFi6VmZq0 HOKj8WQgfwrz4fQlfcwWpClqW53LA8Gih+GUWm6zPBARFVXuIsl5/evty6ch8cnGmv TQZLzbqb2z6KDM4OY+ihuXeljNVP1TLi4t+fwKGHsg7PNhniDcJYkzYaBiuwu41Zvc 7hNDEsRHpSaK8aLIBCpHmJPHXXXriJUY3A7oXhYvpZ/uCNXedk2SVbfZfn89zwwdOC OTVTYq/udIEGA== Date: Sat, 30 Oct 2021 09:08:29 +0000 From: Gregory Heytings To: Eli Zaretskii Subject: Re: bug#51501: 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-Windows In-Reply-To: <04203f39462b1d1585ed@heytings.org> Message-ID: <04203f3946d0c9544d35@heytings.org> References: <83h7cyq4pe.fsf@gnu.org> <04203f39462b1d1585ed@heytings.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 51501 Cc: 51501@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 (-) >> (shell-quote-argument "foo^!") => "^\"foo^^^!^\"" >> >> This is definitely NOT okay. > > Is this with emacs -Q? I get "foo\\^\\!". > Whoops, I did not see you said "on MS-Windows". Sorry for the noise. From debbugs-submit-bounces@debbugs.gnu.org Sat Oct 30 05:36:57 2021 Received: (at 51501) by debbugs.gnu.org; 30 Oct 2021 09:36:57 +0000 Received: from localhost ([127.0.0.1]:56649 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgknJ-0000ah-FM for submit@debbugs.gnu.org; Sat, 30 Oct 2021 05:36:57 -0400 Received: from eggs.gnu.org ([209.51.188.92]:45254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mgknF-0000aO-Tn for 51501@debbugs.gnu.org; Sat, 30 Oct 2021 05:36:56 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]:48996) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgknA-000548-EE; Sat, 30 Oct 2021 05:36:48 -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=lgqt2BhA/FFlRUua7SHTaZd2i5gbgxOcAtYYnAL1voc=; b=Rf91fhlSVgwc 2Isqh1xgzLWedAwRx6vul93HLxjIXWxNqVmZv5ZDnewvaTBw2KTMtgf8kRDnaM5JyT5zWmTW3FiGV KolJeYq+Z45HxaqXAd58TbfzvNvlyKbn+9I2gFKiM0tCOp6XKaPjKJiAl8to68D1rfjPHsjmK8+09 VzKzga9268MyH+uBaO8p0jPvjwfo5Lcd2YzCMe83fr9r54WGoToqMsTzSeOiCd1N5xPx/4edgwqZq PCvgobnE95DbF6MJTf92wYBMxDlcIj7UrbvXGCTzhzFf+wWjr+3H/KKPdKhr2lrsiVeq77Z8Onkfe V5Ug2OTCwD4aYbLX5OmaZQ==; Received: from [87.69.77.57] (port=1159 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mgkn3-0004MM-P0; Sat, 30 Oct 2021 05:36:45 -0400 Date: Sat, 30 Oct 2021 12:36:30 +0300 Message-Id: <83cznmq2g1.fsf@gnu.org> From: Eli Zaretskii To: Gregory Heytings In-Reply-To: <04203f39462b1d1585ed@heytings.org> (message from Gregory Heytings on Sat, 30 Oct 2021 08:51:18 +0000) Subject: Re: bug#51501: 28.0.60; shell-quote-argument quotes "^!" incorrectly on MS-Windows References: <83h7cyq4pe.fsf@gnu.org> <04203f39462b1d1585ed@heytings.org> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 51501 Cc: 51501@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 (---) > Date: Sat, 30 Oct 2021 08:51:18 +0000 > From: Gregory Heytings > cc: 51501@debbugs.gnu.org > > > (shell-quote-argument "foo^!") => "^\"foo^^^!^\"" > > > > This is definitely NOT okay. > > Is this with emacs -Q? Yes. > I get "foo\\^\\!". You are not on MS-Windows, I presume? The quoting is specific to the underlying OS, and the bug report is about what happens on MS-Windows.