<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="❯ deno run does-not-exist.ts
Cannot resolve module &quot;file:///&lt;redacted&gt;/does-not-exist.ts&quot; from &quot;.&quot;
Cannot resolve module &quot;file:///&lt;redacted&gt;/does-not-exist.ts&quot; from &quot;.&quot;"><pre class="notranslate"><code class="notranslate">❯ deno run does-not-exist.ts
Cannot resolve module "file:///&lt;redacted&gt;/does-not-exist.ts" from "."
Cannot resolve module "file:///&lt;redacted&gt;/does-not-exist.ts" from "."
</code></pre></div>
<p dir="auto">I might be missing something, but Deno doesn't appear to expose the number of rows and columns of a controlling terminal:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="// Node
[width, height] = [process.stdout.columns, process.stdout.rows];

// QuickJS
[width, height] = os.ttyGetWinSize(1);

// Deno
[width, height] = ???;"><pre class="notranslate"><span class="pl-c">// Node</span>
<span class="pl-kos">[</span><span class="pl-s1">width</span><span class="pl-kos">,</span> <span class="pl-s1">height</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-kos">[</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stdout</span><span class="pl-kos">.</span><span class="pl-c1">columns</span><span class="pl-kos">,</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stdout</span><span class="pl-kos">.</span><span class="pl-c1">rows</span><span class="pl-kos">]</span><span class="pl-kos">;</span>

<span class="pl-c">// QuickJS</span>
<span class="pl-kos">[</span><span class="pl-s1">width</span><span class="pl-kos">,</span> <span class="pl-s1">height</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-s1">os</span><span class="pl-kos">.</span><span class="pl-en">ttyGetWinSize</span><span class="pl-kos">(</span><span class="pl-c1">1</span><span class="pl-kos">)</span><span class="pl-kos">;</span>

<span class="pl-c">// Deno</span>
<span class="pl-kos">[</span><span class="pl-s1">width</span><span class="pl-kos">,</span> <span class="pl-s1">height</span><span class="pl-kos">]</span> <span class="pl-c1">=</span> <span class="pl-c1">??</span>?<span class="pl-kos">;</span></pre></div>
<p dir="auto">Also, it'd be nice if we could configure a TTY stream to operate as a "raw" device (so that keystrokes like <code class="notranslate">^C</code> could copy-to-clipboard in a terminal-based editing app). For example:</p>
<div class="highlight highlight-source-js notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="export function setRawTTY(fd = 0){
	if(isQuickJS &amp;&amp; &quot;object&quot; === typeof os)
		os.ttySetRaw(fd);
	else if(isNode)
		[process.stdin, process.stdout, process.stderr][fd].setRawMode(true);
	else unsupported(setRawTTY, fd);
}"><pre class="notranslate"><span class="pl-k">export</span> <span class="pl-k">function</span> <span class="pl-en">setRawTTY</span><span class="pl-kos">(</span><span class="pl-s1">fd</span> <span class="pl-c1">=</span> <span class="pl-c1">0</span><span class="pl-kos">)</span><span class="pl-kos">{</span>
	<span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">isQuickJS</span> <span class="pl-c1">&amp;&amp;</span> <span class="pl-s">"object"</span> <span class="pl-c1">===</span> <span class="pl-k">typeof</span> <span class="pl-s1">os</span><span class="pl-kos">)</span>
		<span class="pl-s1">os</span><span class="pl-kos">.</span><span class="pl-en">ttySetRaw</span><span class="pl-kos">(</span><span class="pl-s1">fd</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
	<span class="pl-k">else</span> <span class="pl-k">if</span><span class="pl-kos">(</span><span class="pl-s1">isNode</span><span class="pl-kos">)</span>
		<span class="pl-kos">[</span><span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stdin</span><span class="pl-kos">,</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stdout</span><span class="pl-kos">,</span> <span class="pl-s1">process</span><span class="pl-kos">.</span><span class="pl-c1">stderr</span><span class="pl-kos">]</span><span class="pl-kos">[</span><span class="pl-s1">fd</span><span class="pl-kos">]</span><span class="pl-kos">.</span><span class="pl-en">setRawMode</span><span class="pl-kos">(</span><span class="pl-c1">true</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
	<span class="pl-k">else</span> <span class="pl-en">unsupported</span><span class="pl-kos">(</span><span class="pl-s1">setRawTTY</span><span class="pl-kos">,</span> <span class="pl-s1">fd</span><span class="pl-kos">)</span><span class="pl-kos">;</span>
<span class="pl-kos">}</span></pre></div>