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

IOContext not properly set for stdout, disables ANSI colors #2823

Open
danielwe opened this issue Feb 21, 2024 · 0 comments · May be fixed by #2824
Open

IOContext not properly set for stdout, disables ANSI colors #2823

danielwe opened this issue Feb 21, 2024 · 0 comments · May be fixed by #2824

Comments

@danielwe
Copy link

Since #2148 the stdout capture window supports ANSI terminal colors, and :color => true is set in default_stdout_iocontext as seen here:

const default_stdout_iocontext = IOContext(devnull,
:color => true,
:limit => true,
:displaysize => (18, 75),
:is_pluto => false,
)

However, when querying stdout in a Pluto cell, :color is set to false, so well-behaved Julia code will not print colors. MWE: printstyled("hello"; color=:red). A workaround is to wrap stdout in your own IOContext and set :color => true, but this should not be necessary.

image
(Please take this screenshot in place of a video. Nothing dynamic here.)

Notebook file: https://gist.github.com/danielwe/0663e49fbfb2219b2230d3fe2092c097

Using Pluto 0.19.39 on Julia 1.10.1

@danielwe danielwe linked a pull request Feb 22, 2024 that will close this issue
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