hymkor / expect

Expect-lua for Windows
MIT License
118 stars 15 forks source link

what's the principle of this project? #34

Closed axeprpr closed 9 months ago

axeprpr commented 9 months ago

I'm sorry, I'm not very familiar with the mechanisms of expect in windows. I noticed that almost all expect Go code fails to work on Windows due to pty. Why does this project work? Is Lua required for it? If so, can this project run on Linux?

hymkor commented 9 months ago

Thank you for your insightful question.

Expect.Lua does not use pseudo terminals.

Expect.Lua monitors the text output by the child process by periodically directly reading the line where the cursor is and the line before it on the terminal screen using the Windows API ( ReadConsoleOutputW ).

Therefore, Lua is not needed for that purpose. Also, this program does not work on Linux.

axeprpr commented 9 months ago

I understand it now. Thank you very much!