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
Add ability to detect if stdout is a terminal #1299
Comments
Another alternative is using |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is your feature request related to a problem? Please describe.
I was excited by the new jet features that revealed it was possible from Graalvm to detect if stdout is a terminal. I immediately thought this same feature would allow babashka scripts that emit colored output to remove the colors if their output was not directly to the terminal.
Describe the solution you'd like
Perhaps a function called
isatty
that you can call like this:I don't know which namespace this function should belong to. Perhaps
babashka.process
.Describe alternatives you've considered
I was able to achieve a similar detection by shelling out to bash:
The text was updated successfully, but these errors were encountered: