Skip to content
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

Prefill and edit prompt? #673

Open
joehillen opened this issue Feb 7, 2024 · 1 comment
Open

Prefill and edit prompt? #673

joehillen opened this issue Feb 7, 2024 · 1 comment

Comments

@joehillen
Copy link

I'm not seeing a way to prefill a prompt with text that the user can edit. Is this something that cliffy supports?

@c4spar
Copy link
Owner

c4spar commented Feb 11, 2024

Currently you can only define a default value but it doesn't fill the input.

const name: string = await Input.prompt({
  message: "Whats your name?",
  default: "Foo",
});
? What's your name? (Foo) ›

One way to add support for this could be to fill the input with the default value when pressing tab. The easiest way to implement this could be to add the default value as first entry to the suggestions list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants