Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃悰Unable to connect sub-process standard input/output to a terminal with Deno.Command #23587

Open
rivy opened this issue Apr 28, 2024 · 0 comments

Comments

@rivy
Copy link
Contributor

rivy commented Apr 28, 2024

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)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant