I'm giving up on this, mainly because Windows has nothing equivalent to pseudo terminals and it seems to be impossible to achieve something similar with conventional API call. It's not surprising that there aren't many custom terminal emulators for Windows out there.
With that said, I found a way achieve some level of terminal emulation on Windows after reading parts of Console2 source code: http://sourceforge.net/projects/console/ The idea is fairly simple: Besides the executable, Console2 also builds a dll that is injected into the child process running in a new hidden console created with CREATE_NEW_CONSOLE(actually, what is injected is a call to LoadLibrary passing the dll path). This dll creates a thread to watch for changes in 'CONOUT$' (which is the console screen buffer) and send updates with the parent Console2 process through shared memory. Likewise, it will watch shared memory for input coming from Console2, and forward it to 'CONIN$' which is the console input buffer. To avoid requiring an extra dll to be shipped, one could use MemoryModule(https://github.com/fancycode/MemoryModule) to inject an embedded dll, but that would be too hacky for a library like libuv -- You received this message because you are subscribed to the Google Groups "libuv" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/libuv. For more options, visit https://groups.google.com/d/optout.
