Commit Graph

12 Commits

Author SHA1 Message Date
Ryan Prichard
a7bc8fcf9d Rename Shared to shared and Misc to misc. 2012-04-01 02:13:21 -07:00
Ryan Prichard
0427aedadd Remove unused console font code from Win32Console::setSmallFont. 2012-03-28 01:09:52 -07:00
Ryan Prichard
dbc2d51fec Select a small console font on agent startup.
This maximizes the possible console size in terms of rows * cols.
2012-03-28 01:05:26 -07:00
Ryan Prichard
6585b72375 Use STD_{INPUT,OUTPUT}_HANDLE instead of reopening CONIN$ and CONOUT$.
Reopening the files is unnecessary.
2012-03-28 01:05:14 -07:00
Ryan Prichard
32627354df Work on the agent debugging code.
* Suppress debug output unless the PCONSOLEDBG enviroment variable is
   set.

 * Rename Trace to trace to be consistent with the camelCaps naming
   convention.
2012-03-24 16:43:50 -07:00
Ryan Prichard
44554d5e9d Add an MIT copyright notice to all the source files. 2012-03-23 03:11:34 -07:00
Ryan Prichard
ac76cbcc20 Initial checkin of improved console input handling.
* Generate Ctrl-C events by calling GenerateConsoleCtrlEvent.

   I noticed that calls to this routine don't behave exactly the same as
   a real Ctrl-C keypress.  In Python, pressing Ctrl-C immediately
   displays a new "KeyboardInterrupt" line.  Calling
   GenerateConsoleCtrlEvent has no immediate effect, but after pressing
   Enter, Python displays a stack trace where a KeyboardInterrupt was
   raised.  After some testing, I suspect the issue is that a real Ctrl-C
   keypress interrupts a blocking console read, but
   GenerateConsoleCtrlEvent does not.

   I also tried synthesizing Ctrl-C using (a) PostMessage with
   WM_{CHAR,KEYDOWN}, and (b) SendInput.  I couldn't get either to work.

 * Recognize ESC sequences.  The set of recognized sequences is ad hoc.

 * Recognize UTF-8-encoded characters and convert them to UTF-16.

 * The code currently uses a timeout to differentiate between pressing ESC
   and pressing a key that generates an ESC sequence.  I have a theory that
   I can use the "Device Status Report" ESC sequences to avoid this
   timeout.
2012-03-19 21:30:16 -07:00
Ryan Prichard
a4f26594f0 Various changes intended to help with debugging.
* Replace Buffer::isEof with Buffer::eof so I can use the agent-specific
   ASSERT macro instead of the standard assert().

 * If an API call in Win32Console fails, print a message using Trace.

 * Add Coord::toString and SmallRect::toString functions.
2012-03-15 01:59:12 -07:00
Ryan Prichard
76f25ae5dd Checkpoint work on the EventLoop and NamedPipe classes.
* Make the agent work correctly when the child process exits.
2012-03-14 02:37:18 -07:00
Ryan Prichard
d8b8403651 Begin removing the Qt dependency.
* Replace QPoint and QSize with Coord, a C++ class derived from COORD.

 * Replace QRect with SmallRect, a C++ class derived from SMALL_RECT.

 * Turn Win32Console into a non-QObject class.
2012-03-13 00:16:51 -07:00
Ryan Prichard
3abee55179 Work on agent's build system. 2012-01-21 17:39:22 -08:00
Ryan Prichard
7e4c06c2e1 Rename Agent to agent. 2012-01-21 17:32:26 -08:00