DMARC-Filter: OpenDMARC Filter v1.4.2 delorie.com 5BECmqh91268657 Authentication-Results: delorie.com; dmarc=pass (p=none dis=none) header.from=cygwin.com Authentication-Results: delorie.com; spf=pass smtp.mailfrom=cygwin.com DKIM-Filter: OpenDKIM Filter v2.11.0 delorie.com 5BECmqh91268657 Authentication-Results: delorie.com; dkim=pass (1024-bit key, unprotected) header.d=cygwin.com header.i=@cygwin.com header.a=rsa-sha256 header.s=default header.b=fBYF7fRJ X-Recipient: archive-cygwin AT delorie DOT com DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7D1204BA2E1C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com; s=default; t=1765716531; bh=kReRMePFCfIkfAjmHfVCYiT9CJS7v56Gfq0rEj/jry8=; h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=fBYF7fRJVTwgqNGof2L4js3ti/mcUFwiNacZBUIeZGFh6m4Jw+cP4L5PO+yCwMF6P 0b+lPsb0VXMDMoEMljN1tdyxN/aZha86EoVHMLpiRowuKHqdb8OQyD9IWcxkq1IIWu q7fa0BoJ59uVfkUMwfGmR1JtCyT8S3Yl/kwvDSHc= X-Original-To: cygwin AT cygwin DOT com Delivered-To: cygwin AT cygwin DOT com DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 2EF294BA2E1D ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 2EF294BA2E1D ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765716513; cv=none; b=GDXwygPOGUU5rhghsWKaAgnzSHONk0Aiwajjked2KFYP9dzcIDc7BBCz8VEOAHWe0yy+BdEBoBQo4SPUNksHWpkY211JgeD9VFPEk1fp+BZ/A6k8MBaGeqPHCcYU1wWKGSgjqb3GsfX81JysCZ9SQ0UBXebQcX0h0jcaJIMi3RQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1765716513; c=relaxed/simple; bh=jX9KR4LqnsX7QdnN5CewZEZTskut+lzBrDlOUcw5dz0=; h=Subject:To:From:Message-ID:Date:MIME-Version; b=cpwnXWIPBP9AJ2pXlhCllo/lmEnrySe1wnDlc307UK6jlrXZygSOwtSUNSrXe6W1pR1CLIEx0aOHFzO+6xvYDsDQ7cgALUk33H8jmpD39BlxSPq6fqQyOS95OzMpGrskMpV/DMaRbxkQ8QA5YgOuX8PTh/hkSAVEqxoA5J4hnGM= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2EF294BA2E1D Subject: Re: Something wrong with cygstart To: cygwin AT cygwin DOT com References: <5010206948 DOT 20251214121509 AT yandex DOT ru> Message-ID: <4d8b5ba9-ee94-9ca2-4eac-8f0aaab16ef3@t-online.de> Date: Sun, 14 Dec 2025 13:48:30 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:128.0) Gecko/20100101 SeaMonkey/2.53.22 MIME-Version: 1.0 In-Reply-To: <5010206948.20251214121509@yandex.ru> X-TOI-EXPURGATEID: 150726::1765716510-DFFFD4EE-9A09995E/0/0 CLEAN NORMAL X-TOI-MSGID: ad196928-3bbd-42fa-bf98-345ffb91748d X-BeenThere: cygwin AT cygwin DOT com X-Mailman-Version: 2.1.30 Precedence: list List-Id: General Cygwin discussions and problem reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Christian Franke via Cygwin Reply-To: cygwin AT cygwin DOT com Cc: Christian Franke Content-Type: text/plain; charset="utf-8"; Format="flowed" Errors-To: cygwin-bounces~archive-cygwin=delorie DOT com AT cygwin DOT com Sender: "Cygwin" Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by delorie.com id 5BECmqh91268657 Andrey Repin via Cygwin wrote: > I'm using a wrapper script to comfortably start VS Code from file manager. > > The last line of it is > > cygstart --hide -- "/proc/cygdrive/c/Program Files/Microsoft VS Code/bin/code.cmd" "$(cygpath -alw "$_arg")" > > It works well up to the point where there are no spaces in the $_arg. But on > the first seen space it break the arguments list into pieces. > I have to double-quote the argument to maintain the consistency, like > > cygstart --hide -- "/proc/cygdrive/c/Program Files/Microsoft VS Code/bin/code.cmd" "\"$(cygpath -alw "$_arg")\"" > > but that's a questionable solution at best. This is as expected. Unlike Cygwin's exec() emulation, cygstart does not add any quoting during conversion of the argv[] array to the plain argument string required for Windows process creation API. Example: $ cat test.cmd @echo off echo %%1 = '%1'>test.txt echo %%2 = '%2'>>test.txt echo %%3 = '%3'>>test.txt echo %%4 = '%4'>>test.txt echo %%5 = '%5'>>test.txt $ ./test.cmd ArgOne 'Arg Two' 'Arg    Three'; cat test.txt %1 = 'ArgOne' %2 = '"Arg Two"' %3 = '"Arg    Three"' %4 = '' %5 = '' $ cygstart ./test.cmd ArgOne 'Arg Two' 'Arg    Three';\   sleep 1; cat test.txt %1 = 'ArgOne' %2 = 'arg' %3 = 'Two' %4 = 'Arg' %5 = 'Three' $ cygstart ./test.cmd ArgOne '"Arg Two"' '"Arg    Three"' ;\   sleep 1; cat test.txt %1 = 'ArgOne' %2 = '"Arg Two"' %3 = '"Arg    Three"' %4 = '' %5 = '' $ cygstart ./test.cmd 'ArgOne "Arg Two" "Arg    Three"' ;\   sleep 1; cat test.txt %1 = 'ArgOne' %2 = '"Arg Two"' %3 = '"Arg    Three"' %4 = '' %5 = '' -- Regards, Christian -- Problem reports: https://cygwin.com/problems.html FAQ: https://cygwin.com/faq/ Documentation: https://cygwin.com/docs.html Unsubscribe info: https://cygwin.com/ml/#unsubscribe-simple