deno
deno copied to clipboard
🐛Unable to connect sub-process standard input/output to a terminal with `Deno.Command`
Version: Deno 1.40.0
With Deno.run(), the subprocess could be connected to a terminal (or any file) with this code...
const isWinOS = Deno.build.os === 'windows';
const devTTY = Deno.openSync(isWinOS ? 'CONIN$' : '/dev/tty');
const process = Deno.run({
cmd: ['stty', 'size'],
stdin: devTTY.rid,
stderr: 'piped',
stdout: 'piped',
});
//...
With the deprecation of Deno.run() and rids (replaced with Deno.Command), this doesn't seem possible anymore.
NodeJS allows more flexibility, allowing the use of Stream objects and connection of extra streams beyond the basic three (STDIN, STDERR, and STDOUT), opaquely using their underlying file descriptors.
Could Deno.Command have more flexibility to use FsFiles in a similar manner (while keeping rids internal and opaque)?