{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/11914","labels_url":"https://api.github.com/repos/golang/go/issues/11914/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/11914/comments","events_url":"https://api.github.com/repos/golang/go/issues/11914/events","html_url":"https://github.com/golang/go/issues/11914","id":97827536,"number":11914,"title":"x/crypto/ssh/terminal: ReadPassword broken on windows","user":{"login":"Joshua-Anderson","id":3526404,"avatar_url":"https://avatars.githubusercontent.com/u/3526404?v=3","gravatar_id":"","url":"https://api.github.com/users/Joshua-Anderson","html_url":"https://github.com/Joshua-Anderson","followers_url":"https://api.github.com/users/Joshua-Anderson/followers","following_url":"https://api.github.com/users/Joshua-Anderson/following{/other_user}","gists_url":"https://api.github.com/users/Joshua-Anderson/gists{/gist_id}","starred_url":"https://api.github.com/users/Joshua-Anderson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Joshua-Anderson/subscriptions","organizations_url":"https://api.github.com/users/Joshua-Anderson/orgs","repos_url":"https://api.github.com/users/Joshua-Anderson/repos","events_url":"https://api.github.com/users/Joshua-Anderson/events{/privacy}","received_events_url":"https://api.github.com/users/Joshua-Anderson/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/OS-Windows","name":"OS-Windows","color":"ededed"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/22","html_url":"https://github.com/golang/go/milestones/Unreleased","labels_url":"https://api.github.com/repos/golang/go/milestones/22/labels","id":1067491,"number":22,"title":"Unreleased","description":"Issues that do not affect released Go code and binaries.\r\n","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars.githubusercontent.com/u/104030?v=3","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":343,"closed_issues":101,"state":"open","created_at":"2015-04-14T18:48:22Z","updated_at":"2015-07-29T19:49:40Z","due_on":"2099-12-31T05:00:00Z","closed_at":null},"comments":1,"created_at":"2015-07-29T00:11:02Z","updated_at":"2015-07-29T19:53:52Z","closed_at":null,"body":"On `go1.4.2 windows/amd64` with `golang.org/x/crypto/ssh/terminal` revision `56474dfd625f18739b46f075b138fd0133717491`.\r\n\r\nReadPassword seems to be broken.\r\n\r\nReproduction Case:\r\n\r\n```go\r\npackage main\r\n\r\nimport (\r\n  \"fmt\"\r\n  \"golang.org/x/crypto/ssh/terminal\"\r\n)\r\n\r\nfunc main() {\r\n  fmt.Print(\"password: \")\r\n  password, err := terminal.ReadPassword(0)\r\n\r\n  if err != nil {\r\n    fmt.Println(err)\r\n  }\r\n\r\n  fmt.Println(string(password))\r\n}\r\n```\r\n\r\nWhen I run this code on Windows 10, `ReadPassword()` throws the following error: `The handle is invalid.`\r\n\r\nThe same code works on `linux` and `osx`."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/126077032","html_url":"https://github.com/golang/go/issues/11914#issuecomment-126077032","issue_url":"https://api.github.com/repos/golang/go/issues/11914","id":126077032,"user":{"login":"ianlancetaylor","id":3194333,"avatar_url":"https://avatars.githubusercontent.com/u/3194333?v=3","gravatar_id":"","url":"https://api.github.com/users/ianlancetaylor","html_url":"https://github.com/ianlancetaylor","followers_url":"https://api.github.com/users/ianlancetaylor/followers","following_url":"https://api.github.com/users/ianlancetaylor/following{/other_user}","gists_url":"https://api.github.com/users/ianlancetaylor/gists{/gist_id}","starred_url":"https://api.github.com/users/ianlancetaylor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ianlancetaylor/subscriptions","organizations_url":"https://api.github.com/users/ianlancetaylor/orgs","repos_url":"https://api.github.com/users/ianlancetaylor/repos","events_url":"https://api.github.com/users/ianlancetaylor/events{/privacy}","received_events_url":"https://api.github.com/users/ianlancetaylor/received_events","type":"User","site_admin":false},"created_at":"2015-07-29T19:53:52Z","updated_at":"2015-07-29T19:53:52Z","body":"Does it work if you use terminal.ReadPassword(syscall.Stdin) ?\r\n\r\nThe fact that 0 == syscall.Stdin on Unix system does not mean that that holds true on Windows."}}