Stebalien / term

A Rust library for terminfo parsing and terminal colors.
https://stebalien.github.io/doc/term/term/
Apache License 2.0
178 stars 49 forks source link

WinConsole's tty check is inaccurate #62

Open retep998 opened 8 years ago

retep998 commented 8 years ago

When using WinConsole::new() it takes an arbitrary writer, but then it doesn't check whether that writer is a console, instead it just gets a handle to the current console buffer, whatever it is, and applies attributes to that, assuming that is also the writer.

This leads to silly situations where if someone passes a writer to WinConsole::new() that isn't the windows console but a pipe or any other sort of writer, or even a console framebuffer that isn't the active one, term will still set the attributes on the console frame buffer that was active at the time WinConsole::new() was called.

Stebalien commented 8 years ago

Unfortunately, fixing this (along with most of the bugs here) really requires term to be rewritten. I've started this a few times but haven't really had time to come up with a design I'm happy with (impending thesis deadline).