Skip to content

Conversation

@fonsp
Copy link
Member

@fonsp fonsp commented Oct 11, 2024

Hi!

This PR adds the ability to override can_fancyprint(io::IO) for a self-provided IO by setting an IOContext flag: :Pkg_force_fancyprint can be set to true or false.

Why

My use case is Pluto, where we call Pkg functions like Pkg.precompile() with a buffer as io. Our display (in the browser) supports fancy-printing, but because the buffer is not a <: Base.TTY, Pkg will not fancy-print.

The current workaround in Pluto is to add type piracy to the Pkg.can_fancyprint function, defining a new, more specific method for can_fancyprint(io::IOContext{BufferStream}) where we set it to true, but I want to avoid this solution.

What do you think?

@fonsp
Copy link
Member Author

fonsp commented Oct 11, 2024

Hmm I see that this function was moved/copied to Base in JuliaLang/julia#53403, so I would make a matching PR there. But I'll wait for feedback here before I continue :)

@IanButterworth
Copy link
Member

Makes sense to me, and yeah needs opening against the julia repo now.

@fonsp
Copy link
Member Author

fonsp commented Jul 3, 2025

@IanButterworth Moved to JuliaLang/julia#58887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants