From 41efc9a37a505029066dfb960888572f8143dda4 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Tue, 16 Jun 2026 08:11:22 +0200 Subject: [PATCH] Demonstrate that Quote produces invalid Windows quoting MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, Quote wraps arguments in bash-style `\"…\"` and rewrites embedded double quotes as `"'"'"`. Neither convention is understood by cmd.exe or CommandLineToArgvW, so commands built from quoted arguments are mis-parsed once they contain quotes or spaces (#5560). Co-Authored-By: Claude Opus 4.8 (1M context) --- pkg/commands/oscommands/os_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/commands/oscommands/os_test.go b/pkg/commands/oscommands/os_test.go index 54d9f3a80..33bb9a6db 100644 --- a/pkg/commands/oscommands/os_test.go +++ b/pkg/commands/oscommands/os_test.go @@ -75,6 +75,9 @@ func TestOSCommandQuoteWindows(t *testing.T) { actual := osCommand.Quote(`hello "test" 'test2'`) + /* EXPECTED: + expected := `"hello \"test\" 'test2'"` + ACTUAL: */ expected := `\"hello "'"'"test"'"'" 'test2'\"` assert.EqualValues(t, expected, actual)