{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/WSL/issues/2745","repository_url":"https://api.github.com/repos/Microsoft/WSL","labels_url":"https://api.github.com/repos/Microsoft/WSL/issues/2745/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/WSL/issues/2745/comments","events_url":"https://api.github.com/repos/Microsoft/WSL/issues/2745/events","html_url":"https://github.com/Microsoft/WSL/issues/2745","id":280847526,"number":2745,"title":"Cannot open a file with a space in it's filename using `cmd.exe \\C start \"file name.txt\"`","user":{"login":"dalyIsaac","id":17995621,"avatar_url":"https://avatars0.githubusercontent.com/u/17995621?v=4","gravatar_id":"","url":"https://api.github.com/users/dalyIsaac","html_url":"https://github.com/dalyIsaac","followers_url":"https://api.github.com/users/dalyIsaac/followers","following_url":"https://api.github.com/users/dalyIsaac/following{/other_user}","gists_url":"https://api.github.com/users/dalyIsaac/gists{/gist_id}","starred_url":"https://api.github.com/users/dalyIsaac/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dalyIsaac/subscriptions","organizations_url":"https://api.github.com/users/dalyIsaac/orgs","repos_url":"https://api.github.com/users/dalyIsaac/repos","events_url":"https://api.github.com/users/dalyIsaac/events{/privacy}","received_events_url":"https://api.github.com/users/dalyIsaac/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-10T21:36:09Z","updated_at":"2017-12-11T09:21:58Z","closed_at":null,"author_association":"NONE","body":"Version: `Windows 10 build 17046.1000`  \r\nDistribution: `Ubuntu 16.04 xenial`  \r\nKernel: `x86_64 Linux 4.4.0-43-Microsoft`\r\n\r\n# Repro:  \r\n1. Create a file named \"test-no-spaces.txt\" in a Windows directory\r\n2. Create a file named \"test spaces.txt\" in the same directory\r\n3. Open \"test-no-spaces.txt\" with the default Windows application using  \r\n`cmd.exe /C start test-no-spaces.txt`\r\n4. Attempt to open \"test spaces.txt\" with the default Windows application using  \r\n`cmd.exe /C start \"test spaces.txt`\r\n\r\n# Expected Results\r\n1. \"test-no-spaces.txt\" opens with the default Windows application\r\n2. \"test spaces.txt\" opens with the default Windows application\r\n\r\n# Actual Results\r\n1. \"test-no-spaces.txt\" successfully opens with the default Windows application\r\n2. `cmd.exe /C start \"test spaces.txt\"` opens `cmd.exe` in a new window in the directory of \"test spaces.txt\"\r\n\r\nThis only occurs with the `cmd.exe /C start \"test spaces.txt\"` command. If I directly specify the Windows application, like `code \"test spaces.txt\"` this works fine. \r\n\r\n# `strace`\r\nhttps://gist.github.com/dalyIsaac/d1ed323b39601405e1fbbf9aee2ed879\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/WSL/issues/comments/350666731","html_url":"https://github.com/Microsoft/WSL/issues/2745#issuecomment-350666731","issue_url":"https://api.github.com/repos/Microsoft/WSL/issues/2745","id":350666731,"user":{"login":"0xbadfca11","id":7390559,"avatar_url":"https://avatars1.githubusercontent.com/u/7390559?v=4","gravatar_id":"","url":"https://api.github.com/users/0xbadfca11","html_url":"https://github.com/0xbadfca11","followers_url":"https://api.github.com/users/0xbadfca11/followers","following_url":"https://api.github.com/users/0xbadfca11/following{/other_user}","gists_url":"https://api.github.com/users/0xbadfca11/gists{/gist_id}","starred_url":"https://api.github.com/users/0xbadfca11/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/0xbadfca11/subscriptions","organizations_url":"https://api.github.com/users/0xbadfca11/orgs","repos_url":"https://api.github.com/users/0xbadfca11/repos","events_url":"https://api.github.com/users/0xbadfca11/events{/privacy}","received_events_url":"https://api.github.com/users/0xbadfca11/received_events","type":"User","site_admin":false},"created_at":"2017-12-11T09:21:58Z","updated_at":"2017-12-11T09:21:58Z","author_association":"NONE","body":"Reason 1:\r\nFirst double quoted string is specification of console window title. (See ```start /?```)\r\nThe command that needs to be quoted must be second.\r\n```cmd\r\nC:\\>start \"<title>\" \"a b.txt\"\r\n```\r\n\r\nReason 2:\r\nQuotation marks are not passed to execve(), and WSL interop re-add **if necessary**.\r\n`$ cmd.exe /C start test-no-spaces.txt` will work. Does not specify a title.\r\n`$ cmd.exe /C start \"test-no-spaces.txt\"` will work unexpectedly. \"\" has gone. Interpreted as title not specified.\r\n`$ cmd.exe /C start \"test spaces.txt\"` will interpreted as specify a title.\r\n**`$ cmd.exe /C start \"\" \"test spaces.txt\"` will work. Title specified to \"\". Empty string have to enclosed in \"\".**\r\n`$ cmd.exe /C start \"abc\" test-no-spaces.txt` will not work. \"\" has gone. Interpreted as `start abc test-no-spaces.txt`"}}
{"actor":{"display_login":"0xbadfca11"}}