On 07/31/2014 12:13 AM, Thiago Arruda wrote:
> 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
> 

What a mess :-S I suspected it was not going to be a walk in the park.
Thanks for taking the time to share your findings though!

-- 
Saúl Ibarra Corretgé
bettercallsaghul.com


Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to