{"action":"created","comment":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/31378458","id":31378458,"diff_hunk":"@@ -71,6 +71,18 @@ function repl_cmd(cmd, out)\n         ENV[\"OLDPWD\"] = new_oldpwd\n         println(out, pwd())\n     else\n+        @windows_only begin\n+            # build correctly quoted string for cmd.exe\n+            special = r\".*[ &()[\\]{}\\^=;!'+,`~]+.*\"","path":"base/client.jl","position":6,"original_position":6,"commit_id":"1f19262daf0c38d1afe23d61729a93cd7f5ee397","original_commit_id":"1f19262daf0c38d1afe23d61729a93cd7f5ee397","user":{"login":"ncnc","id":2505082,"avatar_url":"https://avatars.githubusercontent.com/u/2505082?v=3","gravatar_id":"","url":"https://api.github.com/users/ncnc","html_url":"https://github.com/ncnc","followers_url":"https://api.github.com/users/ncnc/followers","following_url":"https://api.github.com/users/ncnc/following{/other_user}","gists_url":"https://api.github.com/users/ncnc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncnc/subscriptions","organizations_url":"https://api.github.com/users/ncnc/orgs","repos_url":"https://api.github.com/users/ncnc/repos","events_url":"https://api.github.com/users/ncnc/events{/privacy}","received_events_url":"https://api.github.com/users/ncnc/received_events","type":"User","site_admin":false},"body":"- I used the list of characters that need to be quoted in filenames according to `cmd /?`, i.e.\r\n```\r\nThe special characters that require quotes are:\r\n     <space>\r\n     &()[]{}^=;!'+,`~\r\n```\r\n`\"` is missing because it's not allowed in filenames.\r\n\r\nThe current code looks for special characters and surrounds the corresponding arguments by `\"`. This works well for filenames, but not necessarily for switches containing special characters.\r\n\r\nI think one root problem is that `shell_parse` swallows unquoted `\"`s \r\n```\r\njulia> `foo --bar=\"my option\" \"my file\"`\r\n`foo '--bar=my option' 'my file'`\r\n\r\njulia> ans.exec\r\n3-element Array{Union(UTF8String,ASCIIString),1}:\r\n \"foo\"\r\n \"--bar=my option\"\r\n \"my file\"\r\n```\r\nso we can't just pass the command verbatim to spawn without messing with the `\"`s. And of course we don't really know which arguments are files and which ones are options.\r\n\r\n- What do you mean by `single linear pass` in this context?\r\n","created_at":"2015-05-30T06:42:54Z","updated_at":"2015-05-30T06:42:54Z","html_url":"https://github.com/JuliaLang/julia/pull/11478#discussion_r31378458","pull_request_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11478","_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments/31378458"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11478#discussion_r31378458"},"pull_request":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11478"}}},"pull_request":{"url":"https://api.github.com/repos/JuliaLang/julia/pulls/11478","id":36457171,"html_url":"https://github.com/JuliaLang/julia/pull/11478","diff_url":"https://github.com/JuliaLang/julia/pull/11478.diff","patch_url":"https://github.com/JuliaLang/julia/pull/11478.patch","issue_url":"https://api.github.com/repos/JuliaLang/julia/issues/11478","number":11478,"state":"open","locked":false,"title":"Allow built-in commands in shell mode for Windows","user":{"login":"ncnc","id":2505082,"avatar_url":"https://avatars.githubusercontent.com/u/2505082?v=3","gravatar_id":"","url":"https://api.github.com/users/ncnc","html_url":"https://github.com/ncnc","followers_url":"https://api.github.com/users/ncnc/followers","following_url":"https://api.github.com/users/ncnc/following{/other_user}","gists_url":"https://api.github.com/users/ncnc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncnc/subscriptions","organizations_url":"https://api.github.com/users/ncnc/orgs","repos_url":"https://api.github.com/users/ncnc/repos","events_url":"https://api.github.com/users/ncnc/events{/privacy}","received_events_url":"https://api.github.com/users/ncnc/received_events","type":"User","site_admin":false},"body":"This was originally part of #7108 by @quinnj  but appears to have fallen between the cracks. It allows using built-in dos commands from the Julia shell-mode. `edit()` already works the same way.\r\n","created_at":"2015-05-28T22:21:24Z","updated_at":"2015-05-30T06:42:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":"583400d89efb246d1e3dace713c32cf0dc7bcf21","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11478/commits","review_comments_url":"https://api.github.com/repos/JuliaLang/julia/pulls/11478/comments","review_comment_url":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}","comments_url":"https://api.github.com/repos/JuliaLang/julia/issues/11478/comments","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/1f19262daf0c38d1afe23d61729a93cd7f5ee397","head":{"label":"ncnc:nc/shell","ref":"nc/shell","sha":"1f19262daf0c38d1afe23d61729a93cd7f5ee397","user":{"login":"ncnc","id":2505082,"avatar_url":"https://avatars.githubusercontent.com/u/2505082?v=3","gravatar_id":"","url":"https://api.github.com/users/ncnc","html_url":"https://github.com/ncnc","followers_url":"https://api.github.com/users/ncnc/followers","following_url":"https://api.github.com/users/ncnc/following{/other_user}","gists_url":"https://api.github.com/users/ncnc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncnc/subscriptions","organizations_url":"https://api.github.com/users/ncnc/orgs","repos_url":"https://api.github.com/users/ncnc/repos","events_url":"https://api.github.com/users/ncnc/events{/privacy}","received_events_url":"https://api.github.com/users/ncnc/received_events","type":"User","site_admin":false},"repo":{"id":19712112,"name":"julia","full_name":"ncnc/julia","owner":{"login":"ncnc","id":2505082,"avatar_url":"https://avatars.githubusercontent.com/u/2505082?v=3","gravatar_id":"","url":"https://api.github.com/users/ncnc","html_url":"https://github.com/ncnc","followers_url":"https://api.github.com/users/ncnc/followers","following_url":"https://api.github.com/users/ncnc/following{/other_user}","gists_url":"https://api.github.com/users/ncnc/gists{/gist_id}","starred_url":"https://api.github.com/users/ncnc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncnc/subscriptions","organizations_url":"https://api.github.com/users/ncnc/orgs","repos_url":"https://api.github.com/users/ncnc/repos","events_url":"https://api.github.com/users/ncnc/events{/privacy}","received_events_url":"https://api.github.com/users/ncnc/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ncnc/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":true,"url":"https://api.github.com/repos/ncnc/julia","forks_url":"https://api.github.com/repos/ncnc/julia/forks","keys_url":"https://api.github.com/repos/ncnc/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ncnc/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ncnc/julia/teams","hooks_url":"https://api.github.com/repos/ncnc/julia/hooks","issue_events_url":"https://api.github.com/repos/ncnc/julia/issues/events{/number}","events_url":"https://api.github.com/repos/ncnc/julia/events","assignees_url":"https://api.github.com/repos/ncnc/julia/assignees{/user}","branches_url":"https://api.github.com/repos/ncnc/julia/branches{/branch}","tags_url":"https://api.github.com/repos/ncnc/julia/tags","blobs_url":"https://api.github.com/repos/ncnc/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ncnc/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ncnc/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/ncnc/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ncnc/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/ncnc/julia/languages","stargazers_url":"https://api.github.com/repos/ncnc/julia/stargazers","contributors_url":"https://api.github.com/repos/ncnc/julia/contributors","subscribers_url":"https://api.github.com/repos/ncnc/julia/subscribers","subscription_url":"https://api.github.com/repos/ncnc/julia/subscription","commits_url":"https://api.github.com/repos/ncnc/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/ncnc/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/ncnc/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/ncnc/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/ncnc/julia/contents/{+path}","compare_url":"https://api.github.com/repos/ncnc/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ncnc/julia/merges","archive_url":"https://api.github.com/repos/ncnc/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ncnc/julia/downloads","issues_url":"https://api.github.com/repos/ncnc/julia/issues{/number}","pulls_url":"https://api.github.com/repos/ncnc/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/ncnc/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/ncnc/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ncnc/julia/labels{/name}","releases_url":"https://api.github.com/repos/ncnc/julia/releases{/id}","created_at":"2014-05-12T19:25:55Z","updated_at":"2015-05-05T22:28:35Z","pushed_at":"2015-05-29T21:03:41Z","git_url":"git://github.com/ncnc/julia.git","ssh_url":"git@github.com:ncnc/julia.git","clone_url":"https://github.com/ncnc/julia.git","svn_url":"https://github.com/ncnc/julia","homepage":"http://julialang.org/","size":67840,"stargazers_count":0,"watchers_count":0,"language":"Julia","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"JuliaLang:master","ref":"master","sha":"6b4c275b339c34ca938f4232c37672c7219d23d0","user":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"repo":{"id":1644196,"name":"julia","full_name":"JuliaLang/julia","owner":{"login":"JuliaLang","id":743164,"avatar_url":"https://avatars.githubusercontent.com/u/743164?v=3","gravatar_id":"","url":"https://api.github.com/users/JuliaLang","html_url":"https://github.com/JuliaLang","followers_url":"https://api.github.com/users/JuliaLang/followers","following_url":"https://api.github.com/users/JuliaLang/following{/other_user}","gists_url":"https://api.github.com/users/JuliaLang/gists{/gist_id}","starred_url":"https://api.github.com/users/JuliaLang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JuliaLang/subscriptions","organizations_url":"https://api.github.com/users/JuliaLang/orgs","repos_url":"https://api.github.com/users/JuliaLang/repos","events_url":"https://api.github.com/users/JuliaLang/events{/privacy}","received_events_url":"https://api.github.com/users/JuliaLang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/JuliaLang/julia","description":"The Julia Language: A fresh approach to technical computing.","fork":false,"url":"https://api.github.com/repos/JuliaLang/julia","forks_url":"https://api.github.com/repos/JuliaLang/julia/forks","keys_url":"https://api.github.com/repos/JuliaLang/julia/keys{/key_id}","collaborators_url":"https://api.github.com/repos/JuliaLang/julia/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/JuliaLang/julia/teams","hooks_url":"https://api.github.com/repos/JuliaLang/julia/hooks","issue_events_url":"https://api.github.com/repos/JuliaLang/julia/issues/events{/number}","events_url":"https://api.github.com/repos/JuliaLang/julia/events","assignees_url":"https://api.github.com/repos/JuliaLang/julia/assignees{/user}","branches_url":"https://api.github.com/repos/JuliaLang/julia/branches{/branch}","tags_url":"https://api.github.com/repos/JuliaLang/julia/tags","blobs_url":"https://api.github.com/repos/JuliaLang/julia/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/JuliaLang/julia/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/JuliaLang/julia/git/refs{/sha}","trees_url":"https://api.github.com/repos/JuliaLang/julia/git/trees{/sha}","statuses_url":"https://api.github.com/repos/JuliaLang/julia/statuses/{sha}","languages_url":"https://api.github.com/repos/JuliaLang/julia/languages","stargazers_url":"https://api.github.com/repos/JuliaLang/julia/stargazers","contributors_url":"https://api.github.com/repos/JuliaLang/julia/contributors","subscribers_url":"https://api.github.com/repos/JuliaLang/julia/subscribers","subscription_url":"https://api.github.com/repos/JuliaLang/julia/subscription","commits_url":"https://api.github.com/repos/JuliaLang/julia/commits{/sha}","git_commits_url":"https://api.github.com/repos/JuliaLang/julia/git/commits{/sha}","comments_url":"https://api.github.com/repos/JuliaLang/julia/comments{/number}","issue_comment_url":"https://api.github.com/repos/JuliaLang/julia/issues/comments{/number}","contents_url":"https://api.github.com/repos/JuliaLang/julia/contents/{+path}","compare_url":"https://api.github.com/repos/JuliaLang/julia/compare/{base}...{head}","merges_url":"https://api.github.com/repos/JuliaLang/julia/merges","archive_url":"https://api.github.com/repos/JuliaLang/julia/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/JuliaLang/julia/downloads","issues_url":"https://api.github.com/repos/JuliaLang/julia/issues{/number}","pulls_url":"https://api.github.com/repos/JuliaLang/julia/pulls{/number}","milestones_url":"https://api.github.com/repos/JuliaLang/julia/milestones{/number}","notifications_url":"https://api.github.com/repos/JuliaLang/julia/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/JuliaLang/julia/labels{/name}","releases_url":"https://api.github.com/repos/JuliaLang/julia/releases{/id}","created_at":"2011-04-21T07:01:50Z","updated_at":"2015-05-29T19:50:15Z","pushed_at":"2015-05-30T03:57:32Z","git_url":"git://github.com/JuliaLang/julia.git","ssh_url":"git@github.com:JuliaLang/julia.git","clone_url":"https://github.com/JuliaLang/julia.git","svn_url":"https://github.com/JuliaLang/julia","homepage":"http://julialang.org/","size":215062,"stargazers_count":5602,"watchers_count":5602,"language":"Julia","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1174,"mirror_url":null,"open_issues_count":1277,"forks":1174,"open_issues":1277,"watchers":5602,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11478"},"html":{"href":"https://github.com/JuliaLang/julia/pull/11478"},"issue":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11478"},"comments":{"href":"https://api.github.com/repos/JuliaLang/julia/issues/11478/comments"},"review_comments":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11478/comments"},"review_comment":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/JuliaLang/julia/pulls/11478/commits"},"statuses":{"href":"https://api.github.com/repos/JuliaLang/julia/statuses/1f19262daf0c38d1afe23d61729a93cd7f5ee397"}}}}