| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| // Unfortunately need to access _internal namespace of termcolor to check if a tty. | ||
| if (!m_grabbed && termcolor::_internal::is_atty(std::cout)) | ||
| { | ||
| // Should we do anything with cerr? |
There was a problem hiding this comment.
We should probably capture std::cerr too as by default (at least on some platforms) it outputs to the same place as std::cout
Sorry, something went wrong.
There was a problem hiding this comment.
We do need a strategy for what to do with cerr, but I don't know what is best yet.
Currently cerr will be written to the normal terminal buffer, so it won't be seen whilst the alternative buffer is being used but it reappears when the alternative buffer is disabled. This is perhaps not a good solution, but I don't think it is too bad for a first implementation. Some other options:
Sorry, something went wrong.
There was a problem hiding this comment.
I have a preference for option 1, but I think we can discuss it in a dedicated issue and solve it in a dedicated PR so that it does not block this one, WDYT?
Sorry, something went wrong.
There was a problem hiding this comment.
Yes, I agree let's deal with cerr separately so that we can merge and use this now.
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
The start of a terminal pager for various git2cpp commands, initially enabled for log subcommand. Fixes #45.
pager.mp4Supports the following keys to navigate:
If cout is not to a tty or the output is short enough to fit within a single page the pager is not used.
Still to do, probably in separate PRs:
To add to other subcommands, see how it is used in log_subcommand.cpp. The terminal_pager constructor does the required initialisation, and it displays on the show call. I suppose I could have done the show automatically in the destructor but that didn't seem a good idea.
Awaiting a new release of JupyterLite before we can easily try it in the terminal.