Open ScottFreeCode opened 2 years ago
One candidate is prompt-toolkit. This looks like it provides just about everything we need, and more we don't; at its most basic it's a drop-in for the input
function, so we could start there.
The tutorial covers the essentials (prompts with a sane repl, autocompletion – although I am not sure if that can be updated dynamically as tests are edited? – and history). History can be persisted to a file somewhere in case of Touchstone crashing.
Cmd might be an alternative? The documentation is harder to make sense of.
The Touchstone develop console lacks many common console/shell features such as command history via up and down keys, jumping over words by holding control or alt/option while pressing left or right, home and end or other shortcuts to the beginning and end of a line, holding alt or option while pressing delete/backspace to delete entire words, etc.
It would be great if some Python library for console apps could supply these features for Touchstone without having to reimplement them. Bonus points if tab completion is also possible using such a system.