AlecAivazis / survey

A golang library for building interactive and accessible prompts with full support for windows and posix terminals.
MIT License
4.07k stars 350 forks source link

Allow editable default for Input prompt #421

Open mislav opened 2 years ago

mislav commented 2 years ago

When doing

survey.Input{
    Message: "What is your name?",
    Default: "Jordan",
}

the default value "Jordan" is now editable and can be navigated around with the cursor if survey.WithShowCursor(true) was used.

Promoting visibility for this idea: https://github.com/AlecAivazis/survey/issues/196#issuecomment-1067042464

@AlecAivazis Since this is backwards incompatible, what do you think about adding a separate field for editable default value? E.g. DefaultEditable: "Jordan"

AlecAivazis commented 1 year ago

Hm, good question. I think having a new field is "alright". it's definitely not great but we're kind of stuck with it. If there are enough little breaks maybe its time to get them together?