summaryrefslogtreecommitdiffstats
path: root/src/line_printer.cc
Commit message (Collapse)AuthorAgeFilesLines
* Disable stdout buffering in real_mainBruce Dawson2021-10-011-5/+0
| | | | | | | | | | | | Previously stdout buffering was disabled in the LinePrinter constructor. This worked for a long time but ultimately this side-effect caused a performance bug (issue #2018) in tools such as -t deps. Moving the disabling of buffering into real_main and only disabling buffering when a tool is not used makes the desired semantics clearer and restores the lost performance. This fixes issue #2018. It has been tested and a 10x speedup was seen relative to the tip-of-tree version.
* Use UTF-8 on Windows 10 Version 1903, fix #1195Jan Niklas Hasse2021-02-171-15/+20
| | | | | | | | | | | | | | | | Allows Ninja to use descriptions, filenames and environment variables with characters outside of the ANSI codepage on Windows. Build manifests are now UTF-8 by default (this change needs to be emphasized in the release notes). WriteConsoleOutput doesn't support UTF-8, but it's deprecated on newer Windows 10 versions anyway (or as Microsoft likes to put it: "no longer a part of our ecosystem roadmap"). We'll use the VT100 sequence just as we do on Linux and macOS. https://docs.microsoft.com/en-us/windows/uwp/design/globalizing/use-utf8-code-page https://docs.microsoft.com/en-us/windows/console/writeconsoleoutput https://docs.microsoft.com/de-de/windows/console/console-virtual-terminal-sequences
* Add 'using namespace std;' to all cc files to prepare for removing it from ↵Michael Jones2020-09-301-0/+2
| | | | header files
* Merge pull request #1508 from mqudsi/colored_failJan Niklas Hasse2019-08-021-1/+3
|\ | | | | Emit "FAILED: " in red if terminal supports ANSI color output
| * Unset suports_color_ if SetConsoleMode fails on WIN32Mahmoud Al-Qudsi2018-12-101-1/+3
| |
* | Feature/add term env dumb to win32 (#1550)jhuels2019-04-161-5/+9
|/ | | Add reading of TERM variable for win32 dumb terminals
* Enable ANSI escape sequences on Windows 10 terminalsGoaLitiuM2018-11-141-0/+12
|
* Allow disabling of escape code stripping, fix #1475Jan Niklas Hasse2018-11-131-0/+4
| | | | | Don't strip colors when CLICOLOR_FORCE is set to a non-zero value. This environment variable is also used by CMake's Make back-end.
* Merge pull request #1473 from zdave/query-term-stdoutJan Niklas Hasse2018-11-051-1/+1
|\ | | | | Query terminal width from STDOUT_FILENO
| * Query terminal width from STDOUT_FILENODavid Emett2018-09-291-1/+1
| | | | | | | | | | Rather than 0 (stdin). So it will work even if ninja's stdin isn't connected to the terminal for whatever reason.
* | Do not always strip colored output in verbose mode, fix #1214Jan Niklas Hasse2018-11-051-0/+1
|/
* win: Use full console width for status messages.Nico Weber2014-12-021-7/+4
| | | | | | | | | | The original overprinting code, added in 7b3d8c8e, used printf for printing the status. printf needs one column for the cursor, so the status message could only take up `width - 1` columns. fc554c22 changed Windows from printf to WriteConsoleOutput which doesn't move the cursor, so keeping one column empty is no longer needed. So stop doing that. Also remove a duplicate call to GetConsoleScreenBufferInfo.
* win/lineprinter: Use a vector instead of manual memory management.Nico Weber2014-12-021-8/+4
| | | | No behavior change. Based on a patch from gmisocpp@gmail.com!
* win: Let the "Pause" key or Ctrl-S pause output.Nico Weber2014-12-021-10/+5
| | | | | | | | | | | | In cmd.exe, hitting the "Pause" key or Ctrl-S will pause programs until a key is pressed. This is apparently implemented when stdout is writing to, so use printf instead of Console functions to reset the cursor to the start of the line. Also happens to simplify the code. (This already worked in -v mode since that already prints using printf.) Based on a patch from gmisocpp@gmail.com!
* Update line_printer.ccppbrown2014-10-271-0/+1
| | | Include POSIX termios.h
* Introduce the "console" poolPeter Collingbourne2014-02-031-6/+45
| | | | | | | This is a pre-defined pool with a depth of 1. It has the special property that any task in the pool has direct access to the console. This can be useful for interactive tasks or long-running tasks which produce status updates on the console (such as test suites).
* Use fwrite to print whatever the subcommand wroteReid Kleckner2013-07-021-1/+5
| | | | | | | | | | | | | | | | | Subcommands can write things like UTF-16, which some terminals can understand. printf() will interpret the null bytes as the end of the string. In particular, MSVC's assert() will print wide characters by default, and I can't find a way to disable it, leading to clang assertion failures looking like: FAILED: ...clang.exe ... Aninja: build stopped: subcommand failed. With this fix, I get the desired: FAILED: ...clang.exe ... Assertion failed: SymbolMap... ninja: build stopped: subcommand failed.
* drop std:: qualifiers on more stl datatypesEvan Martin2013-04-181-1/+1
| | | | We "using namespace std" anywhere we need a std::string or a std::vector.
* fix windows build after depslogScott Graham2013-04-091-4/+6
|
* Try to fix build on Linux.Nico Weber2013-04-091-0/+2
|
* move printing of new lines into LinePrinter.Nico Weber2013-04-091-0/+7
|
* move single-line printing to new classNico Weber2013-04-091-0/+98