Commit Graph

49 Commits

Author SHA1 Message Date
Ryan Prichard
af9e06a71d Log the pipe handles in newPipe, and close the pipes in the host process 2015-10-23 00:00:34 -05:00
Ryan Prichard
abf54bc454 Add a function for querying an NT handle's underlying object pointer. 2015-10-22 19:03:49 -05:00
Ryan Prichard
38cc0bf3fe Reorganize buffer-tests/Makefile and permit tests that aren't checked in 2015-10-22 19:00:00 -05:00
Ryan Prichard
e3a148ccf5 Add notes on CREATE_NO_WINDOW to console-handles.md. 2015-10-22 18:48:48 -05:00
Ryan Prichard
0264277bcd Move more things from tests into the test harness. 2015-10-22 18:39:33 -05:00
Ryan Prichard
fb7a19c4f1 Split TestCommon -> Remote{Worker,Handle} and add TestCommon.h uber-header
* TestCommon.h is a convenience header for the test cases.  It aliases
   Remote{Worker,Handle} back to {Worker,Handle}, and it includes many
   basic C/C++ headers, as well as the parts of the harness suitable for
   test cases.
2015-10-22 18:16:47 -05:00
Ryan Prichard
6c5a5aa670 Rename Worker.cc->WorkerProgram.cc and WorkerApi.h->Command.h
* Fix some of the rules in the Makefile to use build/% instead of %
2015-10-22 17:47:35 -05:00
Ryan Prichard
fdeb2e5cb5 Add a comment to TestHandleInheritance 2015-10-22 17:34:06 -05:00
Ryan Prichard
c3484b5355 First draft of console-handles.md. 2015-10-22 17:34:05 -05:00
Ryan Prichard
55bea51430 Implement precompiled headers in misc/buffer-tests
* 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.
2015-10-22 03:18:47 -05:00
Ryan Prichard
2b7df627eb Expand the Test_AttachConsole_And_CreateProcess_Inheritance test a little 2015-10-22 03:18:46 -05:00
Ryan Prichard
a697017eb7 Allow Worker user to override CREATE_NEW_CONSOLE; reduce verbosity 2015-10-22 03:18:46 -05:00
Ryan Prichard
17f5f9e960 Rename getTitle to title, add consoleProcessList. 2015-10-21 23:11:37 -05:00
Ryan Prichard
3e4086cb39 Turn off -Wformat checking within buffer-tests so %I64x warnings stop 2015-10-21 23:10:56 -05:00
Ryan Prichard
cb1341b0ef Add a test for GetConsoleTitleW 2015-10-21 19:56:12 -05:00
Ryan Prichard
3575c55c8c Expand console handle testing for XP through Windows 7.
* The tests are mostly wrong for Windows 8 and up.
2015-10-21 19:56:06 -05:00
Ryan Prichard
3bf4703f6a Add tests of screen buffer handles. 2015-10-19 23:32:08 -05:00
Ryan Prichard
4d52166b8c Add OSVersion utility 2015-10-19 23:27:00 -05:00
Ryan Prichard
793957e17e Add more line-overwriting tests to color-test.sh. 2015-10-15 17:51:00 -05:00
Ryan Prichard
4338e7b687 Add a Bash script that tests terminal color handling 2015-10-13 04:09:44 -05:00
Ryan Prichard
208d084c81 Convert UnicodeWideTest1.cc from CRLF to LF for consistency.
The repository probably should be configured somehow to ensure line ending
consistency, particularly across Cygwin and MSYS git.
2015-10-12 04:33:40 -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
31ee484b29 Add notes on fonts, code pages, and East Asian character widths 2015-10-10 19:25:20 -05:00
Ryan Prichard
085aa0a9f0 s/UnicodeTest1/Utf16Echo/ and output arbitrary UTF-16 codepoints. 2015-10-10 15:04:48 -05:00
Ryan Prichard
1ef25fb6c6 Fix UnicodeTest1 to work with TrueType fonts 2015-10-10 04:31:58 -05:00
Ryan Prichard
2751488f18 Fix a build failure 2015-10-10 03:30:58 -05:00
Ryan Prichard
c3701e60d9 Automatically test all three common fonts 2015-10-10 02:29:47 -05:00
Ryan Prichard
f5b15bf274 Fix UnicodeDoubleWidthTest font name output. 2015-10-10 02:22:53 -05:00
Ryan Prichard
fe26bfda5f Create a test program to explore the U+30FC width problem w/Lucida Console 2015-10-10 02:14:31 -05:00
Ryan Prichard
b0b79e1b1e Improve Unicode handling of SetFont arguments. 2015-10-09 18:52:20 -05:00
Ryan Prichard
5beb4c1cbb Add a new test program, QueryFont, and expand SetFont. 2015-10-09 17:42:18 -05:00
Ryan Prichard
44ee1cc7ea Updates to the UnicodeVariableWidthChars test program 2015-10-09 01:32:17 -05:00
Ryan Prichard
ac00ac8315 Updates to the UnicodeVariableWidthChars test program 2015-10-07 02:00:11 -05:00
Ryan Prichard
22164a090a Also print U+30FC and print it many times.
* With Lucida Console 10px, U+30FC is handled as a halfwidth character.
   With Lucida Console 12px, it is instead handled as a fullwidth
   character.
2015-10-06 23:51:12 -05:00
Ryan Prichard
80cc3b9096 Add a test case that writes and reads half-width vs full-width characters. 2015-10-05 01:01:24 -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
6c9c7bb985 Allow col and row to be specified to VeryLargeRead.cc and add server OSs 2015-09-26 00:13:31 -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
f4ef2a0d0b Document the largest allowed ReadConsoleOutputW call on various client OSs 2015-09-25 05:51:34 -05:00
Ryan Prichard
0907855b87 Make VeryLargeRead.cc work better on Windows XP.
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.
2015-09-25 00:25:51 -07:00
Ryan Prichard
3a4a602ac8 Add a test case that performs a very large read. 2015-09-24 23:58:31 -07:00
Ryan Prichard
6122f0d989 Expand on the Win10ResizeWhileFrozen comment. 2015-09-24 23:58:28 -07:00
Ryan Prichard
06a81be1fc Add a setCursorPos convenience function. 2015-09-24 23:58:26 -07:00
Ryan Prichard
bb5edfb2fd Add a test program that writes and reads a non-ASCII character. 2015-09-23 17:38:12 -05:00
Ryan Prichard
ccd1406dd8 Add a test program demonstrating how to clear (part of) the console buffer. 2015-08-23 23:13:20 -05:00
Ryan Prichard
95fe71a501 Add a few more experiments 2015-08-22 20:56:24 -07:00
Ryan Prichard
380828dee5 Add a test case demonstrating the Win10 hang on resize-during-selection 2015-08-21 14:45:50 -07:00
Ryan Prichard
2ebc715c28 Add a toplevel license file and remove the misc one. 2012-04-17 09:50:07 -07:00
Ryan Prichard
a7bc8fcf9d Rename Shared to shared and Misc to misc. 2012-04-01 02:13:21 -07:00