-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
process.stdout.isTTY is undefined when git-bash (on Windows) invokes node via a shell script #39673
Comments
You'll need to run node using |
@devsnek Right - I know that works-around the issue, but I feel that The documentation for
...yet I've demonstrated that it can sometimes be So either:
|
If stdout is not a tty, it won't be an instance of tty.WriteStream, it will just be a normal socket stream, which has no |
My mistake - I realise that the I was thinking that |
For reference, and for anyone else encountering the same issue, it's the same as these issues/problems: |
Adds documentation for the following `WriteStream` instance methods: - `WriteStream.clearLine()` - `WriteStream.clearScreenDown()` - `WriteStream.cursorTo()` - `WriteStream.getWindowSize()` - `WriteStream.moveCursor()` PR-URL: #22893 Fixes: #9853 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Vse Mozhet Byt <vsemozhetbyt@gmail.com>
Related issue with the Definitely Typed TypeScript types definitions: DefinitelyTyped/DefinitelyTyped#68299 |
Version
14.17.4 (also reproduces on 16.4)
Platform
Microsoft Windows NT 10.0.19042.0 x64
Subsystem
No response
What steps will reproduce the bug?
This was discovered while investigating this issue: angular/angular-cli#21512
Save this script (
ttytest.js
) somewhere:Open a Windows cmd prompt (with
node
in thePATH
) and run the script:So far, so good.
Open a git-bash prompt and run the script:
Also good.
Run the script via a cmd batch file:
Save this to
indirect-cmd.cmd
This also works fine:
However, do the same for bash and it fails
Save this to
indirect-bash.sh
And run it:
It is also
undefined
whennode
is invoked usingexec
:Save this to
indirect-exec-bash.sh
exec node ttytest.js
And run it:
How often does it reproduce? Is there a required condition?
Always.
What is the expected behavior?
I expect
isTTY
to never beundefined
.What do you see instead?
No response
Additional information
No response
The text was updated successfully, but these errors were encountered: