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

Configurable prompt symbols #16

Closed
lauriejim opened this issue Feb 28, 2018 · 12 comments
Closed

Configurable prompt symbols #16

lauriejim opened this issue Feb 28, 2018 · 12 comments
Labels
enhancement New feature or request

Comments

@lauriejim
Copy link

lauriejim commented Feb 28, 2018

Is it actually possible to customize the question prefix ? with emoji for exemple.
It could be really cool to offert a more contextual experience.

And nice job for this project 👍

@terkelg
Copy link
Owner

terkelg commented Feb 28, 2018

Do you want it to be dynamic, so it can change during runtime?

@lukeed
Copy link
Collaborator

lukeed commented Feb 28, 2018

I think that the furthest I'd take this is allowing a specific prefix per prompt.

@terkelg
Copy link
Owner

terkelg commented Feb 28, 2018

@lukeed per prompt object or prompt function? I guess we can make it a option

@lukeed
Copy link
Collaborator

lukeed commented Feb 28, 2018

I don't need this, but I would guess those who want it would want per object.

@tunnckoCore
Copy link

Per object, yea. Which in turn to be able to be function too. Don't need too but sounds good thing.

@terkelg terkelg added the enhancement New feature or request label Mar 1, 2018
@terkelg
Copy link
Owner

terkelg commented Mar 1, 2018

Perfect! This will be implemented.

@terkelg terkelg added this to the v0.1.3 milestone Mar 1, 2018
@terkelg terkelg closed this as completed Mar 4, 2018
@terkelg terkelg reopened this Mar 4, 2018
@terkelg
Copy link
Owner

terkelg commented Mar 6, 2018

opt.symbols could look like this:

{
  prompt: { done, aborted, default },
  delimiter: { default },
  item: { expanded, default }
}

Is this too much?

@terkelg terkelg changed the title Update prefix ? Configurable prompt symbols ? Mar 6, 2018
@terkelg terkelg changed the title Configurable prompt symbols ? Configurable prompt symbols Mar 6, 2018
@terkelg terkelg modified the milestones: v0.1.5, v0.1.6, v0.1.7, v0.1.8 Mar 7, 2018
@terkelg terkelg removed this from the v0.1.8 milestone Aug 14, 2018
@terkelg
Copy link
Owner

terkelg commented Aug 14, 2018

Closing for now

@terkelg terkelg closed this as completed Aug 14, 2018
@lauriejim
Copy link
Author

@terkelg opt.symbols is a good option.

@jzecca
Copy link

jzecca commented May 7, 2019

Has this idea been abandonned?
Being able to customize the output would be a really nice addition without adding much complexity.

@terkelg
Copy link
Owner

terkelg commented May 7, 2019

This is on hold for now – I'll look into this for a v2

@aral
Copy link

aral commented May 13, 2019

I just added very quick and dirty custom symbol support for the confirmation prompt in my branch: https://github.com/aral/prompts/tree/custom-symbols-for-confirm

To use:

{
  type: 'confirm',
  name: 'confirmed',
  message: 'Can you confirm?',
  symbol: () => (done, aborted) => aborted ? '❌' : done ? '🎉' : '🧐',
}

In case it helps as a stopgap for anyone else.

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

No branches or pull requests

6 participants