prompt-toolkit / pymux

A terminal multiplexer (like tmux) in Python
BSD 3-Clause "New" or "Revised" License
1.45k stars 82 forks source link

Windows ? #3

Open stonebig opened 8 years ago

stonebig commented 8 years ago

Hi Jonathan,

Happy New year 2016.

Does this work on Windows too ?

jonathanslenders commented 8 years ago

Unfortunately, it does not work on Windows. (Or, not yet.)

The windows console is very different from a pseudo terminal, like we know on Linux and Unix. I think, that technically, it should be possible to make it compatible with Windows, but that would require many changes. So, this is maybe some thing that we can do in the future, but probably not very soon.

Happy new year for you too!

giann commented 8 years ago

However it works perfectly well on cygwin

stonebig commented 8 years ago

cygwin could be a last resort solution, but I guess there is a catch.

stonebig commented 8 years ago

my favorite rådgiver says cygwin is a painfull solution https://github.com/ipython/ipython/issues/9107#issuecomment-168965899

jonathanslenders commented 8 years ago

Some notes for myself, if Windows support would ever be feasible. It's worth looking at the source code of ConEmu to see how these things work on Windows.

It appears that sub processes can be created by calling CreateProcess [0]. There is a flag CREATE_NEW_CONSOLE [1] that runs the child process in a separate console. And probably GetConsoleScreenBuffer(Ex) [2] should return the content of the console for that process.

[0] https://msdn.microsoft.com/en-us/library/windows/desktop/ms682512%28v=vs.85%29.aspx [1] https://msdn.microsoft.com/en-us/library/windows/desktop/ms684863%28v=vs.85%29.aspx [2] https://msdn.microsoft.com/en-us/library/windows/desktop/ms683171%28v=vs.85%29.aspx and https://msdn.microsoft.com/en-us/library/windows/desktop/ms683172%28v=vs.85%29.aspx

Tset-Noitamotua commented 8 years ago

would like to see it on Windows (native, no cygwin or msys) ;-)

zommuter commented 8 years ago

@jonathanslenders Since you already mention ConEmu, its -inside options sound interesting.

zommuter commented 8 years ago

Btw, when I try running pymux from msysgit's bash, I get an import error since fcntl does not work with Windows. Maybe those functions could be made optional, or portalocker, also mentioned in that SO question, be used.