Skip to content

Feature request: std::io::Sink should implement std::io::IsTerminal (returning false) #161941

Description

@nicola-gigante

I have a tool which formats output and error messages on the terminal depending on the terminal size and therefore needs to query io::IsTerminal often. I have a trait RenderTarget: io::Write + io::IsTerminal which is used throughout the code.

Today I had the need to pass io::sink() to a function expecting a RenderTarget but io::sink() does not implement io::IsTerminal, and I cannot implement the latter for a wrapper type because it is sealed.

So I'm out of luck. I've found an ugly workaround but I think it would be harmless to have io::sink() implement io::IsTerminal always returning false.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-libs-nominatedNominated for discussion during a libs team meeting.T-libsRelevant to the library team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions