{"action":"created","comment":{"url":"https://api.github.com/repos/libuv/libuv/pulls/comments/62973113","id":62973113,"diff_hunk":"@@ -112,6 +112,7 @@\n               '-liphlpapi',\n               '-lpsapi',\n               '-lshell32',\n+              '-luser32',","path":"uv.gyp","position":4,"original_position":4,"commit_id":"81a5ce34bffba23e287ae6f02440df81dd2d63ad","original_commit_id":"81a5ce34bffba23e287ae6f02440df81dd2d63ad","user":{"login":"saghul","id":317464,"avatar_url":"https://avatars.githubusercontent.com/u/317464?v=3","gravatar_id":"","url":"https://api.github.com/users/saghul","html_url":"https://github.com/saghul","followers_url":"https://api.github.com/users/saghul/followers","following_url":"https://api.github.com/users/saghul/following{/other_user}","gists_url":"https://api.github.com/users/saghul/gists{/gist_id}","starred_url":"https://api.github.com/users/saghul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saghul/subscriptions","organizations_url":"https://api.github.com/users/saghul/orgs","repos_url":"https://api.github.com/users/saghul/repos","events_url":"https://api.github.com/users/saghul/events{/privacy}","received_events_url":"https://api.github.com/users/saghul/received_events","type":"User","site_admin":false},"body":"You also need to add this [here](https://github.com/libuv/libuv/blob/v1.x/configure.ac#L62) for MinGW.","created_at":"2016-05-12T07:07:44Z","updated_at":"2016-05-12T07:07:45Z","html_url":"https://github.com/libuv/libuv/pull/866#discussion_r62973113","pull_request_url":"https://api.github.com/repos/libuv/libuv/pulls/866","_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments/62973113"},"html":{"href":"https://github.com/libuv/libuv/pull/866#discussion_r62973113"},"pull_request":{"href":"https://api.github.com/repos/libuv/libuv/pulls/866"}}},"pull_request":{"url":"https://api.github.com/repos/libuv/libuv/pulls/866","id":69752042,"html_url":"https://github.com/libuv/libuv/pull/866","diff_url":"https://github.com/libuv/libuv/pull/866.diff","patch_url":"https://github.com/libuv/libuv/pull/866.patch","issue_url":"https://api.github.com/repos/libuv/libuv/issues/866","number":866,"state":"open","locked":false,"title":"win,tty: fix read stop in line mode","user":{"login":"orangemocha","id":1625870,"avatar_url":"https://avatars.githubusercontent.com/u/1625870?v=3","gravatar_id":"","url":"https://api.github.com/users/orangemocha","html_url":"https://github.com/orangemocha","followers_url":"https://api.github.com/users/orangemocha/followers","following_url":"https://api.github.com/users/orangemocha/following{/other_user}","gists_url":"https://api.github.com/users/orangemocha/gists{/gist_id}","starred_url":"https://api.github.com/users/orangemocha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orangemocha/subscriptions","organizations_url":"https://api.github.com/users/orangemocha/orgs","repos_url":"https://api.github.com/users/orangemocha/repos","events_url":"https://api.github.com/users/orangemocha/events{/privacy}","received_events_url":"https://api.github.com/users/orangemocha/received_events","type":"User","site_admin":false},"body":"Closing the handle does not make `ReadConsoleW` exit reliably on Windows 7 and above. Thus, after switching from line to raw mode, keypresses were held until enter was pressed. This has caused a number of issues in node: https://github.com/nodejs/node/issues/2504 , https://github.com/nodejs/node/issues/2996, https://github.com/nodejs/node/issues/5384 , https://github.com/nodejs/node/issues/5821 , https://github.com/nodejs/node/issues/5940 .\r\n\r\nThis fix makes `ReadConsoleW` exit by writing a return keypress to its input buffer, similar to what was already done for raw mode. The second commit removes the duplicate handle that was used to close the console before. The third commit restores the cursor position to where it was before writing the enter, because `ReadConsoleW` echoes the newline in the screen.\r\n\r\nThis PR includes a test that switches the console to raw mode and uses `WriteConsoleInputW` to test reading in raw mode. I do not know of a unix equivalent to `WriteConsoleInputW`, so the test is for Windows only. In this test, switching to raw mode is done after a 100 ms sleep, to allow `uv_tty_line_read_thread` to reach [`ReadConsoleW`](https://github.com/libuv/libuv/blob/e397caa3a6a139fff2fed06e0223ee92582fa2d2/src/win/tty.c#L422).\r\n\r\nThe added `User32` library is necessary for [`MapVirtualKeyW`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646306).\r\n\r\nFixes: libuv/libuv#852\r\n\r\ncc @saghul @piscisaureus \r\n","created_at":"2016-05-11T22:20:50Z","updated_at":"2016-05-12T07:07:45Z","closed_at":null,"merged_at":null,"merge_commit_sha":"873290b6db49a909afdb22599e9bb95a7a7133a3","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/libuv/libuv/pulls/866/commits","review_comments_url":"https://api.github.com/repos/libuv/libuv/pulls/866/comments","review_comment_url":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}","comments_url":"https://api.github.com/repos/libuv/libuv/issues/866/comments","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/81a5ce34bffba23e287ae6f02440df81dd2d63ad","head":{"label":"janeasystems:joaocgreis-G54-raw-tty-fix","ref":"joaocgreis-G54-raw-tty-fix","sha":"81a5ce34bffba23e287ae6f02440df81dd2d63ad","user":{"login":"janeasystems","id":9194778,"avatar_url":"https://avatars.githubusercontent.com/u/9194778?v=3","gravatar_id":"","url":"https://api.github.com/users/janeasystems","html_url":"https://github.com/janeasystems","followers_url":"https://api.github.com/users/janeasystems/followers","following_url":"https://api.github.com/users/janeasystems/following{/other_user}","gists_url":"https://api.github.com/users/janeasystems/gists{/gist_id}","starred_url":"https://api.github.com/users/janeasystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janeasystems/subscriptions","organizations_url":"https://api.github.com/users/janeasystems/orgs","repos_url":"https://api.github.com/users/janeasystems/repos","events_url":"https://api.github.com/users/janeasystems/events{/privacy}","received_events_url":"https://api.github.com/users/janeasystems/received_events","type":"Organization","site_admin":false},"repo":{"id":34132480,"name":"libuv","full_name":"janeasystems/libuv","owner":{"login":"janeasystems","id":9194778,"avatar_url":"https://avatars.githubusercontent.com/u/9194778?v=3","gravatar_id":"","url":"https://api.github.com/users/janeasystems","html_url":"https://github.com/janeasystems","followers_url":"https://api.github.com/users/janeasystems/followers","following_url":"https://api.github.com/users/janeasystems/following{/other_user}","gists_url":"https://api.github.com/users/janeasystems/gists{/gist_id}","starred_url":"https://api.github.com/users/janeasystems/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janeasystems/subscriptions","organizations_url":"https://api.github.com/users/janeasystems/orgs","repos_url":"https://api.github.com/users/janeasystems/repos","events_url":"https://api.github.com/users/janeasystems/events{/privacy}","received_events_url":"https://api.github.com/users/janeasystems/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/janeasystems/libuv","description":"Cross-platform asychronous I/O","fork":true,"url":"https://api.github.com/repos/janeasystems/libuv","forks_url":"https://api.github.com/repos/janeasystems/libuv/forks","keys_url":"https://api.github.com/repos/janeasystems/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/janeasystems/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/janeasystems/libuv/teams","hooks_url":"https://api.github.com/repos/janeasystems/libuv/hooks","issue_events_url":"https://api.github.com/repos/janeasystems/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/janeasystems/libuv/events","assignees_url":"https://api.github.com/repos/janeasystems/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/janeasystems/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/janeasystems/libuv/tags","blobs_url":"https://api.github.com/repos/janeasystems/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/janeasystems/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/janeasystems/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/janeasystems/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/janeasystems/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/janeasystems/libuv/languages","stargazers_url":"https://api.github.com/repos/janeasystems/libuv/stargazers","contributors_url":"https://api.github.com/repos/janeasystems/libuv/contributors","subscribers_url":"https://api.github.com/repos/janeasystems/libuv/subscribers","subscription_url":"https://api.github.com/repos/janeasystems/libuv/subscription","commits_url":"https://api.github.com/repos/janeasystems/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/janeasystems/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/janeasystems/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/janeasystems/libuv/issues/comments{/number}","contents_url":"https://api.github.com/repos/janeasystems/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/janeasystems/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/janeasystems/libuv/merges","archive_url":"https://api.github.com/repos/janeasystems/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/janeasystems/libuv/downloads","issues_url":"https://api.github.com/repos/janeasystems/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/janeasystems/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/janeasystems/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/janeasystems/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/janeasystems/libuv/labels{/name}","releases_url":"https://api.github.com/repos/janeasystems/libuv/releases{/id}","deployments_url":"https://api.github.com/repos/janeasystems/libuv/deployments","created_at":"2015-04-17T18:13:23Z","updated_at":"2016-01-14T16:23:37Z","pushed_at":"2016-05-11T22:18:32Z","git_url":"git://github.com/janeasystems/libuv.git","ssh_url":"git@github.com:janeasystems/libuv.git","clone_url":"https://github.com/janeasystems/libuv.git","svn_url":"https://github.com/janeasystems/libuv","homepage":"http://libuv.org/","size":10728,"stargazers_count":0,"watchers_count":0,"language":"C","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"v1.x"}},"base":{"label":"libuv:v1.x","ref":"v1.x","sha":"28d160f3dea256b198b7df887162e432a75cac4e","user":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"repo":{"id":14812739,"name":"libuv","full_name":"libuv/libuv","owner":{"login":"libuv","id":4030929,"avatar_url":"https://avatars.githubusercontent.com/u/4030929?v=3","gravatar_id":"","url":"https://api.github.com/users/libuv","html_url":"https://github.com/libuv","followers_url":"https://api.github.com/users/libuv/followers","following_url":"https://api.github.com/users/libuv/following{/other_user}","gists_url":"https://api.github.com/users/libuv/gists{/gist_id}","starred_url":"https://api.github.com/users/libuv/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/libuv/subscriptions","organizations_url":"https://api.github.com/users/libuv/orgs","repos_url":"https://api.github.com/users/libuv/repos","events_url":"https://api.github.com/users/libuv/events{/privacy}","received_events_url":"https://api.github.com/users/libuv/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/libuv/libuv","description":"Cross-platform asynchronous I/O","fork":false,"url":"https://api.github.com/repos/libuv/libuv","forks_url":"https://api.github.com/repos/libuv/libuv/forks","keys_url":"https://api.github.com/repos/libuv/libuv/keys{/key_id}","collaborators_url":"https://api.github.com/repos/libuv/libuv/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/libuv/libuv/teams","hooks_url":"https://api.github.com/repos/libuv/libuv/hooks","issue_events_url":"https://api.github.com/repos/libuv/libuv/issues/events{/number}","events_url":"https://api.github.com/repos/libuv/libuv/events","assignees_url":"https://api.github.com/repos/libuv/libuv/assignees{/user}","branches_url":"https://api.github.com/repos/libuv/libuv/branches{/branch}","tags_url":"https://api.github.com/repos/libuv/libuv/tags","blobs_url":"https://api.github.com/repos/libuv/libuv/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/libuv/libuv/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/libuv/libuv/git/refs{/sha}","trees_url":"https://api.github.com/repos/libuv/libuv/git/trees{/sha}","statuses_url":"https://api.github.com/repos/libuv/libuv/statuses/{sha}","languages_url":"https://api.github.com/repos/libuv/libuv/languages","stargazers_url":"https://api.github.com/repos/libuv/libuv/stargazers","contributors_url":"https://api.github.com/repos/libuv/libuv/contributors","subscribers_url":"https://api.github.com/repos/libuv/libuv/subscribers","subscription_url":"https://api.github.com/repos/libuv/libuv/subscription","commits_url":"https://api.github.com/repos/libuv/libuv/commits{/sha}","git_commits_url":"https://api.github.com/repos/libuv/libuv/git/commits{/sha}","comments_url":"https://api.github.com/repos/libuv/libuv/comments{/number}","issue_comment_url":"https://api.github.com/repos/libuv/libuv/issues/comments{/number}","contents_url":"https://api.github.com/repos/libuv/libuv/contents/{+path}","compare_url":"https://api.github.com/repos/libuv/libuv/compare/{base}...{head}","merges_url":"https://api.github.com/repos/libuv/libuv/merges","archive_url":"https://api.github.com/repos/libuv/libuv/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/libuv/libuv/downloads","issues_url":"https://api.github.com/repos/libuv/libuv/issues{/number}","pulls_url":"https://api.github.com/repos/libuv/libuv/pulls{/number}","milestones_url":"https://api.github.com/repos/libuv/libuv/milestones{/number}","notifications_url":"https://api.github.com/repos/libuv/libuv/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/libuv/libuv/labels{/name}","releases_url":"https://api.github.com/repos/libuv/libuv/releases{/id}","deployments_url":"https://api.github.com/repos/libuv/libuv/deployments","created_at":"2013-11-30T00:29:56Z","updated_at":"2016-05-12T06:01:31Z","pushed_at":"2016-05-11T22:20:51Z","git_url":"git://github.com/libuv/libuv.git","ssh_url":"git@github.com:libuv/libuv.git","clone_url":"https://github.com/libuv/libuv.git","svn_url":"https://github.com/libuv/libuv","homepage":"http://libuv.org/","size":17254,"stargazers_count":3942,"watchers_count":3942,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":650,"mirror_url":null,"open_issues_count":112,"forks":650,"open_issues":112,"watchers":3942,"default_branch":"v1.x"}},"_links":{"self":{"href":"https://api.github.com/repos/libuv/libuv/pulls/866"},"html":{"href":"https://github.com/libuv/libuv/pull/866"},"issue":{"href":"https://api.github.com/repos/libuv/libuv/issues/866"},"comments":{"href":"https://api.github.com/repos/libuv/libuv/issues/866/comments"},"review_comments":{"href":"https://api.github.com/repos/libuv/libuv/pulls/866/comments"},"review_comment":{"href":"https://api.github.com/repos/libuv/libuv/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/libuv/libuv/pulls/866/commits"},"statuses":{"href":"https://api.github.com/repos/libuv/libuv/statuses/81a5ce34bffba23e287ae6f02440df81dd2d63ad"}}}}