<p dir="auto">I'm suggesting some sort of interface to incorporate the functionality of Node's <code class="notranslate">tty</code> module, which would solve <a class="issue-link js-issue-link" data-error-text="Failed to load title" data-id="656331265" data-permission-text="Title is private" data-url="https://github.com/denoland/deno/issues/6738" data-hovercard-type="issue" data-hovercard-url="/denoland/deno/issues/6738/hovercard" href="https://github.com/denoland/deno/issues/6738">#6738</a>, as well as setting all sort of terminal configurations, such as enabling/disabling input echo, and getting the terminal size.</p>
<p dir="auto">In some cases, such as a <a href="https://git-scm.com/docs/gitcredentials#_custom_helpers" rel="nofollow">Git Credential Helper</a>, a script needs to get both program arguments through stdin, and prompt the user for data.</p>
<p dir="auto">In Linux, this is done by opening <a href="https://linux.die.net/man/4/tty" rel="nofollow">/dev/tty</a> which is, according to the manpage, a handle to the process' <em>controlling terminal</em>, which is a separate stream from stdin.</p>
<p dir="auto">I have also noticed that Deno currently has no handle in its API for such a stream, so for now there's no cross-platform/native solution to this.</p>
<p dir="auto">My suggestion is adding a <code class="notranslate">Deno.tty</code> handle to Deno's API, similar to the <code class="notranslate">Deno.stdin</code> handle, to allow for cross-platform usage of this feature.</p>
<p dir="auto">Edit: On further research, according to <a href="http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/146259" rel="nofollow">this page</a> from the bottom of the internet, something like this could work easily for mac, linux and windows.<br>
Edit2: On even <a href="https://en.wikipedia.org/wiki/Device_file#PC_DOS,_TOS,_OS/2,_and_Windows" rel="nofollow">further research</a>, i got the wrong Windows device name. Edited in the code snippet.</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="//Within the Deno namespace:
export const tty = Deno.build.os === &quot;windows&quot;?await Deno.open(&quot;CON:&quot;):await Deno.open(&quot;/dev/tty&quot;);"><pre class="notranslate"><code class="notranslate">//Within the Deno namespace:
export const tty = Deno.build.os === "windows"?await Deno.open("CON:"):await Deno.open("/dev/tty");
</code></pre></div>