Feature request: `std::io::Sink` should implement `std::io::IsTerminal` (returning `false`)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the standard-library definitions and implementations for std::io::Sink and std::io::IsTerminal, then inspect nearby tests for terminal detection. Add the requested Sink behavior and verify that it reports false without changing other terminal implementations.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 72/100