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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No color in printstyled when pipe is used #30703

Closed
ronisbr opened this issue Jan 12, 2019 · 1 comment · Fixed by #36689
Closed

No color in printstyled when pipe is used #30703

ronisbr opened this issue Jan 12, 2019 · 1 comment · Fixed by #36689

Comments

@ronisbr
Copy link
Member

ronisbr commented Jan 12, 2019

Hi guys!

I am trying to save a text file with the output of a Julia script but with the escape sequences so that I can render the colors. However, when I call Julia using pipe, I get no colors. Even if I have --color=yes. You can test by starting Julia as:

julia --color=yes | tee

The logo will be gray (but julia> will be colored). Is there a way to provide another option, like --color=force so that printstyled always use the escape sequences?

@ronisbr
Copy link
Member Author

ronisbr commented Jan 12, 2019

As a workaround, one can use:

screen -dm -L sh -c 'julia --color=yes teste.jl' && mv screenlog.0 output.txt

and then output.txt will have the colored output (with escape sequences).

JeffBezanson added a commit that referenced this issue Jul 16, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
JeffBezanson added a commit that referenced this issue Jul 16, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
JeffBezanson added a commit that referenced this issue Jul 17, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
JeffBezanson added a commit that referenced this issue Jul 19, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
JeffBezanson added a commit that referenced this issue Jul 22, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
JeffBezanson added a commit that referenced this issue Jul 23, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes #30703)
simeonschaub pushed a commit to simeonschaub/julia that referenced this issue Aug 11, 2020
- `--color=no` did not remove all color in the REPL
- color was not fully disabled by default when stdout was a pipe
- `--color=yes` did not enable color when stdout was a pipe (fixes JuliaLang#30703)
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

Successfully merging a pull request may close this issue.

1 participant