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 11, 2024
1 parent 7678301 commit 668b1b4
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 668b1b4

Please sign in to comment.