shanejansen / touchstone

Touchstone is a testing framework for your services that focuses on component, end-to-end, and exploratory testing.
17 stars 2 forks source link

Dedicated console library? #40

Open ScottFreeCode opened 2 years ago

ScottFreeCode commented 2 years ago

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.

ScottFreeCode commented 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.

ScottFreeCode commented 2 years ago

Cmd might be an alternative? The documentation is harder to make sense of.