Friday, 27 January 2023

Python CLI Menu with Arrow Keys on Windows

The terminal I use on Windows is Mingw-w64 (Git Bash). I am trying to find or create a CLI menu with Python that I can navigate with arrow keys, however nothing I find works.

The Python library, simple-term-menu, doesn't work on Windows. console-menu doesn't use arrow keys but it just throws an error when I import it anyway. After importing windows-curses, I was able to get it working in CMD but not Git Bash (it says, "Redirection is not supported.")

I know for a fact that what I'm after is possible. The JavaScript framework, Adonis, is capable of it with their create command (yarn create adonis-ts-app hello-world). The NPM one doesn't work but Yarn does. Given this, it's obviously possible, but how?

Given all of this, how can I get the CLI menu I want in Git Bash, or how can I get windows-curses to work?



from Python CLI Menu with Arrow Keys on Windows

No comments:

Post a Comment