Skip to content

Commit

Permalink
add docstring note about displaysize and IOContext with context (
Browse files Browse the repository at this point in the history
  • Loading branch information
IanButterworth authored Oct 25, 2024
1 parent beda632 commit c94102b
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions base/show.jl
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,11 @@ end
IOContext(io::IO, context::IOContext)
Create an `IOContext` that wraps an alternate `IO` but inherits the properties of `context`.
!!! note
Unless explicitly set in the wrapped `io` the `displaysize` of `io` will not be inherited.
This is because by default `displaysize` is not a property of IO objects themselves, but lazily inferred,
as the size of the terminal window can change during the lifetime of the IO object.
"""
IOContext(io::IO, context::IO) = IOContext(io, ioproperties(context))

Expand Down

0 comments on commit c94102b

Please sign in to comment.