go-expect icon indicating copy to clipboard operation
go-expect copied to clipboard

go-expect compatibility with Windows

Open singhrasster opened this issue 7 years ago • 2 comments

It looks like this library is compatible with only Linux? Is it possible to make it compatible with Windows? Would that require lot of work or it would be something simple? Any pointers you could provide?

singhrasster avatar Dec 14 '18 23:12 singhrasster

Hi @singhrasster, sorry only seeing this now. I personally don't use or have a need for Windows hence why it doesn't support it, but I'd be happy to review any PRs if you want to investigate how to provide Windows compatibility.

From what I know, the main blocker is that Windows doesn't have pseudo-terminals. A possible lead is https://github.com/mintty/mintty project, so if you can figure out how to provide a generic interface to create ptys across Windows / Linux / OSX and contribute it to https://github.com/kr/pty we can have support for Windows.

hinshun avatar Jan 14 '19 22:01 hinshun

Hi and thanks for Netflix/go-expect. We are successfully using this project at ActiveState and have developed a solution around it, so we can test Windows command-line applications.

We created a separate repository https://github.com/ActiveState/termtest, which at its core uses the Netflix/go-expect library, but on Windows uses the ConPTY pseudo-terminal and funnels all its output to a virtual terminal emulator. We found the latter to be necessary as the Windows console injects a lot of control characters, that make it otherwise difficult to match expected strings. If you are interested to add Windows compatibility to the Netflix/go-expect project, please let us know if we can advise or help. I have thought about making a PR back to this project, but it seems difficult now, as we introduced a lot of dependencies by now, and changed the library in significant parts for our purposes.

mdrohmann avatar May 19 '20 22:05 mdrohmann