achiurizo / consular

Terminal automation
http://rdoc.info/github/achiu/consular/master/file/README.md
MIT License
813 stars 46 forks source link

experimental windows support #66

Closed jondot closed 13 years ago

jondot commented 13 years ago

Hi,

I think this pull request deserves some detail since windows and *nix (linux,darwin) worlds are much apart.

So here it is -- an experimental windows support, during which i've ruled out using powershell, Console2, PwrCmd as consoles (since some of those have tabs), and went with the plain cmd.exe console (which doesn't have tabs).

Some of the differences root in these details:

To Terminitor devs, i've changed the core tests support to remove fakefs (for some reason it cries about missing constant in windows). And i've expaneded the in_platform macro to include several options, a better way would be to test against a regex but i didn't want to stray away from the original impl too much. If you would examine this let me know if you want me to change / modify in any way. Whatever would make you feel more comfertable.

--- snip snip ---

To win32 devs examining this, i've tried (among other methods) using wscipt shell and pipes as methods of controlling cmd.exe and other consoles. Eventually i've settled at win32api process and window calls. You can also notice there is a tiny sleep when spawning a new process in order to enumerate through windows and get a HWND. I'd really be interested in better ways to do this.

All in all i've used and enjoyed it so far on Win7, Vista 32 and 64 bit. You can also find decent tests, which spawns (and kills, no worries) a real window in the process, so they're dirty in a sense.

Thanks

achiurizo commented 13 years ago

i've temporarily pull these commits into branch jondot-win32. Once I review the changes and check everything out, i'll merge them back to master. thanks

achiurizo commented 13 years ago

as of d5f7c119a4d380a6c27eddb2d0e9f78c986f34f0, this commit has been merged into master and released under version 0.5.0. thanks!

jondot commented 13 years ago

thanks achiu, i'll keep an eye :)