Skip to content

Commit

Permalink
Do not pre-write the answer to questions with the default anwser
Browse files Browse the repository at this point in the history
  • Loading branch information
kit-ty-kate committed Nov 20, 2024
1 parent 0128c98 commit 57cf486
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/core/opamConsole.ml
Original file line number Diff line number Diff line change
Expand Up @@ -824,12 +824,13 @@ let confirm ?(require_unsafe_yes=false) ?(default=true) fmt =
then
(formatted_msg "%sn\n" prompt; false)
else
short_user_input ~prompt ~default:(if default then 'y' else 'n')
short_user_input ~prompt ~default:' '
(function
| "y" | "yes" -> Some true
| "n" | "no" -> Some false
| "\027" -> Some false (* echap *)
| _ -> None))
| " " -> Some default
| "y" | "yes" -> Some true
| "n" | "no" -> Some false
| "\027" -> Some false (* echap *)
| _ -> None))
fmt

let read fmt =
Expand Down

0 comments on commit 57cf486

Please sign in to comment.