AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 349 forks source link

Use virtual terminal processing on Windows #473

Open mislav opened 1 year ago

mislav commented 1 year ago

This removes:

  1. Manual conversion of ANSI escape codes to Windows syscalls, and
  2. Windows-specific Cursor implementation

in favor of the 3rd-party go-colorable module that implements all those conversions plus more. Furthermore, go-colorable will attempt to enable "virtual terminal processing" under Windows which is a mode where ANSI escape codes are recognized natively by the system, and no conversions whatsoever will be necessary.

Note: doesn't work yet. Not sure why, but any prompt is now hanging. I suspect the Windows-specific runereader is not liking the changes to Cursor.