-
-
Notifications
You must be signed in to change notification settings - Fork 232
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
Separate stderr and stdout #194
Comments
Trying to split stdout and stderr would result in ioctl error as it doesn't make sense for the driver. I believe you may not need a TTY though, displaying colors is something up to the terminal emulator, the tty only passes through the ascii escape sequences which are in turn interpreted by your terminal emulator to display a color. Some color libraries use the presence of a TTY to automatically toggle colors on/off, but that can be manually changed. |
Thanks @creack. How do you suggest passing in "mock tty" for the libraries to print with color? For some reason the tool I'm using won't allow me to force color output even with the |
Well, you can use this library, but if you need a valid tty, you can't split stdout/stderr, otherwise, you will face 'invalid ioctl for device' errors. |
Hey all, I am using pty in my project to get some CLI tools to print with color.
Is it possible to get back 3 files here, one as it is now where stdout & stderr are combined, and one where it is just stdout and the other stderr? This would really help with some string/file manipulation I want to do afterwards. Currently this is the only way I found to separate out stdout and stderr:
However this means that I can't keep the original output ordering, if for example a CLI tool prints to stdout then stderr then back to stdout this ordering is lost.
Thanks for the project, would appreciate some insight here!
The text was updated successfully, but these errors were encountered: