Commit Graph

9 Commits

Author SHA1 Message Date
Ryan Prichard
3bf4703f6a Add tests of screen buffer handles. 2015-10-19 23:32:08 -05:00
Ryan Prichard
a66de7dc28 Add more tests of full-width characters and rename one of the tests.
* Fix the -std=c++11 narrowing warnings in TestUtil.cc.
2015-10-11 22:44:22 -05:00
Ryan Prichard
2751488f18 Fix a build failure 2015-10-10 03:30:58 -05:00
Ryan Prichard
f5b15bf274 Fix UnicodeDoubleWidthTest font name output. 2015-10-10 02:22:53 -05:00
Ryan Prichard
5beb4c1cbb Add a new test program, QueryFont, and expand SetFont. 2015-10-09 17:42:18 -05:00
Ryan Prichard
d4640890cf Rewrite resize logic, introduce "direct mode", and tweak scroll scraping.
* 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.
2015-09-29 02:32:49 -05:00
Ryan Prichard
9fc1b70fa4 Fix a character-handling defect in TestUtil.cc, startChildProcess
- 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.)
2015-09-25 23:41:08 -05:00
Ryan Prichard
06a81be1fc Add a setCursorPos convenience function. 2015-09-24 23:58:26 -07:00
Ryan Prichard
95fe71a501 Add a few more experiments 2015-08-22 20:56:24 -07:00