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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
execArgv option to force TTY #31409
Comments
|
Have you already tried something like |
It might help if you could be more specific here – you can’t create TTYs without using native modules like @mscdex mentioned at the moment, and while a libuv feature along those lines might be possible, is there a chance that it might help more to control Node.js’s behaviour in these situations? For example, I’ve recently had a conversation in which the idea of forcing Node.js core to enable color mode for its output was brought up. I think that would be a reasonable request, and something that developers right now might try to solve by manually creating TTYs. |
Is this something other than setting the |
Specifically for a test framework, if you want to test a TTY program you might need a TTY. I suppose Requiring a module which overwrites some modules to fake the TTY is conceptually easier, even if it's more liable to break. If there was a flag to expose the TTY APIs on |
|
It sounds like what you're asking for is a quick fix, expose e.g. Proper built-in pty support however might be so I've opened libuv/libuv#2640 to discuss. |
To be fair, I'm approaching this from a user's perspective, like " why can't I get this API in my child process". Built-in pseudo-TTY support would also be great, and I can see how that's more "correct" for Node.js itself. |
|
I ran into a similar scenario where I tried to run my own script with lint-staged (which, in turn, relies on execa to execute my script in a spawned child process). Since my script decides the input source based on |
novemberborn commentedJan 18, 2020
Is your feature request related to a problem? Please describe.
Developer tools may run user code in a child process. When invoked in in a terminal,
process.stdoutandprocess.stderrwill be TTY streams. This will not be the case in the child process.Describe the solution you'd like
It'd be great if the developer tool could force TTY to be available in the child process.
Describe alternatives you've considered
I've tried faking TTY support in the child processes. This is somewhat doable but breaks when Node.js adds new features. With AVA we've now removed this behavior, hoping for somebody to provide the functionality in a separately loadable package.
It'd be much better if we could make Node.js provide its own implementation.
The text was updated successfully, but these errors were encountered: