teemtee / tmt

Test Management Tool
MIT License
81 stars 122 forks source link

Accept whole words in tmt try interactive session #3044

Open martinhoyer opened 3 months ago

martinhoyer commented 3 months ago

Users are expected to type single letters to select actions when --ask is used. This could be problematic, when user's terminal does not display bulk/underscore highlighting of the letters. It might be good to either start the action after key press, i.e. without Enter, or to accept users typing whole words, so for example: login instead of just l.

happz commented 3 months ago

Is it time to find some cool and awesome library for this kind of thing? With command completion, colors, history, magic, unicorns and rainbows? Not that I have one in my sleeve, but… Unlike let’s say export, tmt try users might appreciate some bells and whistles.

No immediate idea, and I’m afraid EPEL would lack such a package, but I was wrong on that front before.

martinhoyer commented 3 months ago

https://github.com/Textualize/trogon?

happz commented 3 months ago

https://github.com/Textualize/trogon?

I tried that one, the result wasn’t pretty, but mostly thanks to tmt, and I tried it with whole tmt - might get better results if limited to just try.

I found https://github.com/prompt-toolkit/python-prompt-toolkit

LecrisUT commented 3 months ago

I thought click itself (or adjacent plugin) had a functionality to behave like a TUI (terminal user interface). Or at least an example of how to implement one.

Edit: ah, no it was bubbletea (golang) that I was remembering, and another very similar one.

Also, curated list: https://github.com/rothgar/awesome-tuis?tab=readme-ov-file#libraries

Edit2: within click: https://github.com/click-contrib/click-repl