-
Notifications
You must be signed in to change notification settings - Fork 144
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 documentation for 3.0 #77
Conversation
669f6f3
to
044a265
Compare
Codecov Report
@@ Coverage Diff @@
## next-release #77 +/- ##
=============================================
Coverage 96.46% 96.46%
=============================================
Files 5 5
Lines 566 566
=============================================
Hits 546 546
Misses 20 20
Continue to review full report at Codecov.
|
Great documentation! rang::bg::reset and rang::fg::reset should also work and affect bg/bgB, fg/fgB colours respectevly. So it's possible to reset foreground/background only, instead of resetting all style. On native windows terminals also works correctly. Win10 have vt100 compatible sequencies, and it should also work (39 and 49 codes respectevly). By the way, I'm wanted to add nobold/noconceal etc. support but I can't doing that, because Win10 ANSI Terminal not provide that. That's weird and not full vt100 compatible terminal. |
In old Win we can use bold conceal and reversed, Italic is not supported 😺 blink/underline is emulated throw increasing of background intensity (this is default behaviour on most ansi drivers for windows 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.
So, slightly corrections in doc is needed. We also should tell something about redirection of ostreams from/to cout/cerr/clog and check it out.
Made changes to docs based on the recent input!
Do you mean like the redirection performed in test.cpp?
Or something different than that? And what should we tell to users about it 🤔 ? Another thing to note is, 99% users won't bother themselves with these redirections and the rest will know what to do themselves 😛 |
2bd6b1a
to
8a083f3
Compare
Yes. Exactly after your code rang tried to call isatty(fileno(stdout)) for cout and still assume that output is going to terminal instead of file. It means that redirection of rdbuf for cout/cerr/clog objects is not supported. I'm agree that 99% users don't need it. But if someone is need it, he should know that correct redirection of stdout/stderr should be done throw freopen function before calling any rang functions. Finally I'm create example of allocating terminal in WinAPI GUI application if someone want it. |
@kingseva Would adding this to readme be fine - Redirecting
|
Yeah it's better than nothing. 😄 |
Intersting that wcout/wcerr/wclog is not supported. |
Should we support them? They look very similar to |
Well, for generic purposes yes. It's not hard to add support of basic streams. I'm create branch generic_streams that support that feature if it's still interested. Tested on MSVC and GCC for wcout/wcerr etc. |
sure, I created https://github.com/agauniyal/rang/tree/version4 for further PRs 😬 , also going to implement some features from #51 as soon as I get some time 👍 |
Nice! I have some ideas about #52 . How to store rang values and process them in ostreams. |
It would've been a lot easier if windows native method never operated directly on the terminal(and gave strings like win10/unix). I have 0 ideas how to store them into some stream for using them later when user wants 🤔 |
It's possible to override behavior of operator << only for stringstream/ostringstream and store all values to stringstream as pure ANSI Esc sequencies into regular std::[w]string. After that for regular operator << for basic_ostreams we can create method "fromAnsi". it's returned some type that applied as pure string of Ansi Esc sequencies for Unix like systems or parsed if Windows Native terminal is used. |
No description provided.