* I'm still going to try to include what is used in each module.
* At some point, I should implement these in the main project. It will
need more testing on the various compilers. It really needs to be
on-by-default everywhere. If it's off, then at least pch.h should be
included everywhere, to minimize configuration differences between my
checkout and other people's checkouts.
* There should be some way to configure it off to check whether includes
are correct.
* The change reduces build times from 27.6s to 15.2s on a single-core VM.
* Unfreeze the console while changing the buffer size. Changing the
buffer size hangs conhost.exe. See:
- https://github.com/rprichard/winpty/issues/31
- https://wpdev.uservoice.com/forums/266908-command-prompt/suggestions/9941292-conhost-exe-hangs-in-win10-if-setconsolescreenbuff
* Detect buffer size changes and switch to a "direct mode". Direct mode
makes no attempt to track incremental console changes. Instead, the
content of the current console window is printed. This mode is
intended for full-screen apps that resize the console.
* Reopen CONOUT$, which detects apps that change the active screen buffer.
Fixes https://github.com/rprichard/winpty/issues/34.
* In the scroll scraping (scrollingScrapeOutput), consider a line changed
if the new content is truncated relative to the content previously
output. Previously, we only compared against the line-buffer up to the
current console width. e.g.
If this:
|C:\Program|
turns into:
|C:\Prog|
|ram |
we previously left |C:\Program| in the line-buffer for the first line
and did not re-output the first line.
We *should* reoutput the first line at this point so that, if the line
scrolls upward, and the terminal is later expanded, we will have
output an "Erase in Line" CSI command to clear the obscured "ram" text.
We need to update the line-buffer for the sake of Windows 10 combined
with terminals like xterm and putty. On such a terminal, if the
terminal later widened, Windows 10 will restore the console to the
first state. At that point, we need to reoutput the line, because
xterm and putty do not save and restore truncated line content extending
past the current terminal width.
- Formatting a wchar_t* argument with %s does not work with MinGW's
swprintf. (Apparently it does with MSVC? Sigh.) AFAICT, %ls does
the right thing with both MinGW and MSVC. (I didn't test MSVC.)
Avoid zero-initializing the buffer to accommodate VMs that have
little RAM. Use a smaller buffer size (9000x9000 ==> 324MB
buffer) that still demonstrates the read-size limit on XP.