-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add docs to a bunch of stuff #13401
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add docs to a bunch of stuff #13401
Conversation
|
||
let entry = open(term); | ||
if entry.is_err() { | ||
if "cygwin" == term { // msys terminal |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you change the line to if "cygwin" == term && os::getenv("MSYSCON") == Some(~"mintty.exe")
? I should've fixed it but forgot until now.
Explanation:
TERM=cygwin
doesn't really mean it's ok to use TerminfoTerminal
(escape sequences).
There are two ways to use escape seq: 1) use mintty (bundled in msys2), or 2) use libgreen (libuv internally parses escape sequence and calls windows console api).
It means currently rustc.exe output looks illegible if you use msys but don't use mintty.
To fix it, we have to create TerminfoTerminal
only if it's on mintty. msys sets MSYSCON
env to console application name, so we may use it.
Indeed it is mintty-specific bad hack. Other possible way is to not try to create TerminfoTerminal
in term::stdout()
/term::stderr()
, but it would make rustc colorless on mintty.
I touched libterm a bit (as commented) and created small exe using libterm. It works very well on various settings: {libnative, libgreen} * {cmd, msys1, msys2, msys2+mintty} |
@cmr ping, this needs rebase. ❤️ docs! |
Rebased. |
😍 |
// redirected to a different console. This is good enough for | ||
// rustc though. See #13400. | ||
let out = GetStdHandle(-11); | ||
SetConsoleTextAttribute(out, accum); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, for late comment, but this just occurred to me: don't you need buf.flush()
before applying new attributes? Otherwise if you have a buffering writer, you'll apply new attributes to text that's already been output.
Adds docs where previously there were no docs. Also adds windows support to libterm.
Run `analysis-stats` on CI, with `opt-level = 1` We might want to run `analysis-stats` on PRs, and this makes it less unbearable.
Lint comparison to empty slice using `PartialEq` methods changelog: [`comparison_to_empty`]: Also detect comparaisons using `PartialEq` methods Fix rust-lang#13401
Adds docs where previously there were no docs. Also adds windows support to libterm.