Changeset 12800

Sep 10, 2009, 3:28:33 AM (10 years ago)

An initial altconsole-like application for Windows (this just uses a
Win32 console window.) I think that we ultimately want to use something
like this in Cocotron (rather than continuing to do what we've been doing)
for a variety of reasons: we'd like to be able to plug in replacement
"console" applications (SLIME, a remote CCL, ...), want that application
to be able to run and display output even after the .app has crashed or
exited, don't want to redirect stdout/stderr (since NSLogged messages tend
to confuse users), don't want to create buffered stdio streams in the
lisp kernel and then think that we need to flush them at arbitrary times,

This seems to behave as well as it can under Vista; before hooking it up,
it'd be good to know if it also works under Win7. It uses an undocumented
Windows kernel function to find the pid of the parent process (usually
wx86cl.exe) and uses a function from the "psapi" library that may have
moved elsewhere/been renamed under Win7; I can't quite parse what the
MSDN documentation says about this.


? (run-program "/path/to/WaltConsole.exe"

:input :stream
:output :stream
:error :output
:wait nil)

should create an EXTERNAL-PROCESS without erring; writing text to the
output) should cause the process to display a console window with that
text; anything typed in the console window (followed by the enter key)
should be readable by reading from the EXTERNAL-PROCESS-OUTPUT-STREAM
of the external process. Quitting from the lisp (or possibly just
closing one or both of those streams) should cause the console window
to note that the parent process has exited and provide an opportunity
to save the console window's output (via some awkward cut/paste operation)
before the subprocess exits.

If that all works in Win7, then I think that we should figure out how to
(optionally) install this in a standalone Cocotron bundle, activate it
on startup of a standalone .app (should be similar to how that's done on
OSX), and remove some of the code that we've been using. Win32 consoles
are ugly and stupid and we can always replace this implementation with
something a bit more feature-rich; that's part of the idea.

4 added

Note: See TracChangeset for help on using the changeset viewer.