Skip to content

Fix UI glitches and do not pre-write the answer to questions with the default anwser#6290

Closed
kit-ty-kate wants to merge 2 commits intoocaml:masterfrom
kit-ty-kate:fix-opamconsole-pause
Closed

Fix UI glitches and do not pre-write the answer to questions with the default anwser#6290
kit-ty-kate wants to merge 2 commits intoocaml:masterfrom
kit-ty-kate:fix-opamconsole-pause

Conversation

@kit-ty-kate
Copy link
Copy Markdown
Member

@kit-ty-kate kit-ty-kate commented Nov 11, 2024

Queued on top of #6289
This implements what was described in #6289 (review) with the addition of a UI bugfix:

$ opam pin edit ppxlib
Package ppxlib is not pinned. Edit as a new pinning to version 0.33.1~5.3preview? [y/n] y
Press enter to start "vim" (this can be customised by setting EDITOR or OPAMEDITOR)...[WARNING] The opam file didn't pass validation:
  warning 59: url doesn't contain a checksum
Proceed anyway ('no' will re-edit)? [y/n] 

In this example you can see the Press enter ... line is missing the end of line character. This happens because OpamConsole.pause (used to write this line) uses short_user_input with ~default:"", but this function wasn't made to have its default be anything but a string of length 1 in interactive mode. This is marked evident as the prompt subfunction will move the cursor left then remove one character, which happens to be the issue here.

@kit-ty-kate kit-ty-kate added this to the 2.4.0~alpha1 milestone Nov 11, 2024
@rjbou rjbou self-requested a review November 12, 2024 16:24
@kit-ty-kate kit-ty-kate force-pushed the fix-opamconsole-pause branch from 668b1b4 to 57cf486 Compare November 20, 2024 15:55
Copy link
Copy Markdown
Collaborator

@rjbou rjbou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR content, lgtm!
I'm wondering if we should split the PR as ther is 2 purposes : the fix and the change (back) of the output of confirm questions.

@kit-ty-kate
Copy link
Copy Markdown
Member Author

Superseded by #6376

@kit-ty-kate kit-ty-kate closed this Feb 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AREA: UI PR: WIP Not for merge at this stage

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants