{"action":"created","issue":{"url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/110","labels_url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/110/labels{/name}","comments_url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/110/comments","events_url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/110/events","html_url":"https://github.com/timdouglas/sublime-less2css/issues/110","id":60445291,"number":110,"title":"A simple patch to prevent a console window from popping up on Windows","user":{"login":"iliyang","id":802594,"avatar_url":"https://avatars.githubusercontent.com/u/802594?v=3","gravatar_id":"","url":"https://api.github.com/users/iliyang","html_url":"https://github.com/iliyang","followers_url":"https://api.github.com/users/iliyang/followers","following_url":"https://api.github.com/users/iliyang/following{/other_user}","gists_url":"https://api.github.com/users/iliyang/gists{/gist_id}","starred_url":"https://api.github.com/users/iliyang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/iliyang/subscriptions","organizations_url":"https://api.github.com/users/iliyang/orgs","repos_url":"https://api.github.com/users/iliyang/repos","events_url":"https://api.github.com/users/iliyang/events{/privacy}","received_events_url":"https://api.github.com/users/iliyang/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-03-10T03:18:20Z","updated_at":"2015-08-24T19:21:46Z","closed_at":null,"body":"I love the **less2css** integration in Sublime Test 3, but there's a little glitch on Windows -- a console window pops up every time I save my LESS file and gets compiled with `lessc`. I found a simple solution that only requires changing a few lines of code in:\r\n\r\nReplace this code in `compiler.py`:\r\n```\r\n# not sure if node outputs on stderr or stdout so capture both\r\np = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)\r\n```\r\n\r\nwith this:\r\n```\r\nstartupinfo=None\r\nif platform_name == 'Windows':\r\n  # this startupinfo structure prevents a console window from popping up on Windows\r\n  startupinfo = subprocess.STARTUPINFO()\r\n  startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW\r\n# not sure if node outputs on stderr or stdout so capture both\r\np = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, startupinfo=startupinfo)\r\n```\r\n\r\nPassing the so-formed structure to `subprocess.Popen` prevents a window for the process from being created, and so the compilation runs silently. If `lessc` yields an error, it will still be properly reported and everything.\r\n\r\nI got this tip from the indispensable StackOverflow:\r\nhttp://stackoverflow.com/questions/1016384/cross-platform-subprocess-with-hidden-window\r\n\r\nI really hope the plugin author will add this small change to the code, so Windows users can install the package properly and keep it up-do-date. Thanks!"},"comment":{"url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/comments/134346417","html_url":"https://github.com/timdouglas/sublime-less2css/issues/110#issuecomment-134346417","issue_url":"https://api.github.com/repos/timdouglas/sublime-less2css/issues/110","id":134346417,"user":{"login":"mattseymour","id":1328442,"avatar_url":"https://avatars.githubusercontent.com/u/1328442?v=3","gravatar_id":"","url":"https://api.github.com/users/mattseymour","html_url":"https://github.com/mattseymour","followers_url":"https://api.github.com/users/mattseymour/followers","following_url":"https://api.github.com/users/mattseymour/following{/other_user}","gists_url":"https://api.github.com/users/mattseymour/gists{/gist_id}","starred_url":"https://api.github.com/users/mattseymour/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattseymour/subscriptions","organizations_url":"https://api.github.com/users/mattseymour/orgs","repos_url":"https://api.github.com/users/mattseymour/repos","events_url":"https://api.github.com/users/mattseymour/events{/privacy}","received_events_url":"https://api.github.com/users/mattseymour/received_events","type":"User","site_admin":false},"created_at":"2015-08-24T19:21:46Z","updated_at":"2015-08-24T19:21:46Z","body":"@thecotne @iliyang  whilst the original maintainer is not longer accepting pull request I have taken it upon myself to get the project backup and working (I have been granted write privileges to the project). If a pull request can be created I can get around to merging this request into the main repo sooner rather than later. Else I will add it to my todo list which might take some time to get around to."}}