{"action":"created","issue":{"url":"https://api.github.com/repos/fusesource/jansi-native/issues/11","repository_url":"https://api.github.com/repos/fusesource/jansi-native","labels_url":"https://api.github.com/repos/fusesource/jansi-native/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/fusesource/jansi-native/issues/11/comments","events_url":"https://api.github.com/repos/fusesource/jansi-native/issues/11/events","html_url":"https://github.com/fusesource/jansi-native/issues/11","id":260412995,"number":11,"title":"Improve isatty() Windows implementation with Cygwin/Mingw pseudo terminals","user":{"login":"hboutemy","id":237462,"avatar_url":"https://avatars0.githubusercontent.com/u/237462?v=4","gravatar_id":"","url":"https://api.github.com/users/hboutemy","html_url":"https://github.com/hboutemy","followers_url":"https://api.github.com/users/hboutemy/followers","following_url":"https://api.github.com/users/hboutemy/following{/other_user}","gists_url":"https://api.github.com/users/hboutemy/gists{/gist_id}","starred_url":"https://api.github.com/users/hboutemy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hboutemy/subscriptions","organizations_url":"https://api.github.com/users/hboutemy/orgs","repos_url":"https://api.github.com/users/hboutemy/repos","events_url":"https://api.github.com/users/hboutemy/events{/privacy}","received_events_url":"https://api.github.com/users/hboutemy/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-09-25T20:58:38Z","updated_at":"2018-02-01T22:17:57Z","closed_at":null,"author_association":"COLLABORATOR","body":"as seen in Jansi issue https://github.com/fusesource/jansi/issues/94, Cygwin and Mingw use pseudo terminals, not real terminals\r\nThen isatty() does not detect the pseudo-terminal\r\nGit has a workaround: https://github.com/git/git/commit/86924838e3d881cda2192fd79ac3a58aad75efd3\r\n```\r\n        /* get pipe name */\r\n \tif (!NT_SUCCESS(NtQueryObject(h, ObjectNameInformation,\r\n \t\t\tbuffer, sizeof(buffer) - 2, &result)))\r\n \t\treturn;\r\n \tname = nameinfo->Name.Buffer;\r\n \tname[nameinfo->Name.Length] = 0;\r\n \r\n\t/*\r\n\t * Check if this could be a MSYS2 pty pipe ('msys-XXXX-ptyN-XX')\r\n\t * or a cygwin pty pipe ('cygwin-XXXX-ptyN-XX')\r\n\t */\r\n\tif ((!wcsstr(name, L\"msys-\") && !wcsstr(name, L\"cygwin-\")) ||\r\n\t\t\t!wcsstr(name, L\"-pty\"))\r\n\t\treturn;\r\n```\r\n\r\nThis code should be added to Jansi native isatty() implementation for Windows to properly detect (pseudo)terminal with Cygwin and Mingw"},"comment":{"url":"https://api.github.com/repos/fusesource/jansi-native/issues/comments/362420977","html_url":"https://github.com/fusesource/jansi-native/issues/11#issuecomment-362420977","issue_url":"https://api.github.com/repos/fusesource/jansi-native/issues/11","id":362420977,"user":{"login":"hboutemy","id":237462,"avatar_url":"https://avatars0.githubusercontent.com/u/237462?v=4","gravatar_id":"","url":"https://api.github.com/users/hboutemy","html_url":"https://github.com/hboutemy","followers_url":"https://api.github.com/users/hboutemy/followers","following_url":"https://api.github.com/users/hboutemy/following{/other_user}","gists_url":"https://api.github.com/users/hboutemy/gists{/gist_id}","starred_url":"https://api.github.com/users/hboutemy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hboutemy/subscriptions","organizations_url":"https://api.github.com/users/hboutemy/orgs","repos_url":"https://api.github.com/users/hboutemy/repos","events_url":"https://api.github.com/users/hboutemy/events{/privacy}","received_events_url":"https://api.github.com/users/hboutemy/received_events","type":"User","site_admin":false},"created_at":"2018-02-01T22:17:57Z","updated_at":"2018-02-01T22:17:57Z","author_association":"COLLABORATOR","body":"did you try to get the value of the terminal name?\r\nthis is really the current code in git: https://github.com/git/git/blob/master/compat/winansi.c#L537"}}
{"actor":{"display_login":"hboutemy"}}