-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reimplement the depext UI with a menu #5053
Conversation
Pushing a small style update. Here are a few screenshots to show the interaction: Trying to do it manually, then ignoring:With depext-run-installs=false (different menu)The code is a little spaghetti, but there is probably no better way. I have the before/after flow charts (on paper!) if you are interested ^^ |
I think is marvellous 🙂 It's not crystal clear (to me) for the sentences - I read the partial sentences w.r.t. the opening menu sentence (e.g. "Let opam run apt-get to install the required system packages? ... and abort" rather than "[quit]................. and abort" I wonder if numbered options and a full sentence for each works more clearly: opam believes some required external dependencies are missing. opam can:
|
For the manual menu, I'd suggest: This command should get the requirements installed:
Would you like opam to:
|
Probably so, although in my display the brackets + table alignment didn't help with that, so we could have fiddled with that as well. |
I find the Just saying, I can live with that. |
I already had doubts about it, your input is welcome. |
I'd be happy to see how it fares on MacOS shells; but I am actually doing the minimum in terms of escape codes magic so it shouldn't be too much trouble. And at worst, there will be a little garbage on top of the menu when moving around, but it will still be readable; or the arrow keys just won't work, which is an ok fallback. |
On macOS the arrows work fine but some thing that throws me a bit off is that it seems that the prompt is waiting for only one character. For example is you go and input In the same kind of behaviour, if you type anything but one of the character that the prompt is waiting for, nothing happens and your character does not appear. This feels kind of stressful, even claustrophobic a little, it feels like opam just broke and froze your computer (^C still works but still) |
the same freezing behaviour happens on a simple installation prompt. The I think we should keep the old |
Rebased; windows test broken due to last cygwin/git update (unrelated to this PR) |
plus some goodies like: - intuitive display of the default choice (it's already printed left of the cursor so it's clear you just have to `<enter>`) - fixed and generalised handling of `echap` Handling arrows in menus would be cool and not so difficult (just need to rollback n lines and clear lines), but I am afraid of portability...
Alright I had to do it; "it works for me", and actually the menus don't appear on Windows (yet?) so... :D
- split to a separate function for easier porting (Windows support would also require correctly detecting arrow key presses though) - clear all lines to avoid glitches if the terminal is resized while in the menu
Closes #5026
Additionally, also shows the hint on C-c :)