<p>Hi Eliot and Vincent,</p>
<p>(I only have phone access, so apologies for typos, formatting, etc.)</p>
<p>Unless I'm misunderstanding the situation, we can't easily add support<br>
for both cygwin terminals and windows consoles.</p>
<p>We're compiling and linking with mingw, which means we have access to<br>
the windows consoles directly (through ReadConsole() and<br>
WriteConsole()).  If we want to access the cygwin terminals properly we<br>
need to use the posix io functions in cygwin1.dll (not the MS supplied<br>
versions of the posix io functions).</p>
<p>I guess it would be possible to write a wrapper DLL around the posix io<br>
functions in cygwin1.dll and load that if we recognise that we are in a<br>
cygwin terminal.  But that is obviously a fair bit of effort (not<br>
something that I'm interested in doing in the short or medium term).</p>
<p>Given your acceptance of not recognising EOF correctly in a cygwin<br>
terminal I would extend my previous suggestion that we modify Vincent's<br>
primitiveIsFileDescriptorATTY to return an enumerated value:</p>
<p>0 - no console (windows only)<br>
1 - normal terminal (unix terminal / windows console)<br>
2 - pipe<br>
3 - file<br>
4 - cygwin terminal (windows only)</p>
<p>What do you think?</p>
<p>Cheers,<br>
Alistair</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/254#issuecomment-387842377">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AhLyW01gn0YKs75VUnvgzg1sZy8AxDLmks5twz1DgaJpZM4Tg0qx">mute the thread</a>.<img src="https://github.com/notifications/beacon/AhLyWx7mR5SM-9yBLceSgFAPSJ80xYWwks5twz1DgaJpZM4Tg0qx.gif" height="1" width="1" alt="" /></p>
<div itemscope itemtype="http://schema.org/EmailMessage">
<div itemprop="action" itemscope itemtype="http://schema.org/ViewAction">
  <link itemprop="url" href="https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/254#issuecomment-387842377"></link>
  <meta itemprop="name" content="View Pull Request"></meta>
</div>
<meta itemprop="description" content="View this Pull Request on GitHub"></meta>
</div>

<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/OpenSmalltalk/opensmalltalk-vm","title":"OpenSmalltalk/opensmalltalk-vm","subtitle":"GitHub repository","main_image_url":"https://cloud.githubusercontent.com/assets/143418/17495839/a5054eac-5d88-11e6-95fc-7290892c7bb5.png","avatar_image_url":"https://cloud.githubusercontent.com/assets/143418/15842166/7c72db34-2c0b-11e6-9aed-b52498112777.png","action":{"name":"Open in GitHub","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm"}},"updates":{"snippets":[{"icon":"PERSON","message":"@akgrant43 in #254: Hi Eliot and Vincent,\r\n\r\n(I only have phone access, so apologies for typos, formatting, etc.)\r\n\r\nUnless I'm misunderstanding the situation, we can't easily add support \r\nfor both cygwin terminals and windows consoles.\r\n\r\nWe're compiling and linking with mingw, which means we have access to \r\nthe windows consoles directly (through ReadConsole() and \r\nWriteConsole()).  If we want to access the cygwin terminals properly we \r\nneed to use the posix io functions in cygwin1.dll (not the MS supplied \r\nversions of the posix io functions).\r\n\r\nI guess it would be possible to write a wrapper DLL around the posix io \r\nfunctions in cygwin1.dll and load that if we recognise that we are in a \r\ncygwin terminal.  But that is obviously a fair bit of effort (not \r\nsomething that I'm interested in doing in the short or medium term).\r\n\r\nGiven your acceptance of not recognising EOF correctly in a cygwin \r\nterminal I would extend my previous suggestion that we modify Vincent's \r\nprimitiveIsFileDescriptorATTY to return an enumerated value:\r\n\r\n0 - no console (windows only)\r\n1 - normal terminal (unix terminal / windows console)\r\n2 - pipe\r\n3 - file\r\n4 - cygwin terminal (windows only)\r\n\r\nWhat do you think?\r\n\r\nCheers,\r\nAlistair\r\n"}],"action":{"name":"View Pull Request","url":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/254#issuecomment-387842377"}}}</script>
<script type="application/ld+json">{"@type":"MessageCard","@context":"http://schema.org/extensions","hideOriginalBody":"false","originator":"37567f93-e2a7-4e2a-ad37-a9160fc62647","title":"Re: [OpenSmalltalk/opensmalltalk-vm] Add accurate check for console stdio + add associated primitive  (#254)","sections":[{"text":"","activityTitle":"**akgrant43**","activityImage":"https://avatars1.githubusercontent.com/u/2062166?s=160\u0026v=4","activitySubtitle":"@akgrant43","facts":[]}],"potentialAction":[{"name":"Add a comment","@type":"ActionCard","inputs":[{"isMultiLine":true,"@type":"TextInput","id":"IssueComment","isRequired":false}],"actions":[{"name":"Comment","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"IssueComment\",\"repositoryFullName\":\"OpenSmalltalk/opensmalltalk-vm\",\"issueId\":254,\"IssueComment\":\"{{IssueComment.value}}\"}"}]},{"name":"Close pull request","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"PullRequestClose\",\"repositoryFullName\":\"OpenSmalltalk/opensmalltalk-vm\",\"pullRequestId\":254}"},{"targets":[{"os":"default","uri":"https://github.com/OpenSmalltalk/opensmalltalk-vm/pull/254#issuecomment-387842377"}],"@type":"OpenUri","name":"View on GitHub"},{"name":"Unsubscribe","@type":"HttpPOST","target":"https://api.github.com","body":"{\"commandName\":\"MuteNotification\",\"threadId\":327371441}"}],"themeColor":"26292E"}</script>