Skip to content

displaysize is not inherited from tty inIOContext(io, tty) #34721

@c42f

Description

@c42f

For example in my terminal locally:

julia> displaysize(stdout)
(46, 167)

julia> displaysize(IOContext(IOBuffer(), stdout))
(24, 80)

This has flow-on effects like the context argument to sprint not being used for the display size and seems inconsistent with the :displaysize key being inherited from an IOContext.

On the other hand, it's not obvious to me how to fix this. If we always called displaysize on the context when creating the IOContext, we'd hit uv_tty_get_winsize which in turn hits an ioctl syscall on unix. That seems like a nasty pessimization. Another idea is to stash the context IO somewhere so we can call displaysize lazily.

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIndicates a good issue for first-time contributors to JuliaioInvolving the I/O subsystem: libuv, read, write, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions