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

Clear the questionnaire ? #746

Closed
udithv opened this issue Nov 11, 2018 · 8 comments
Closed

Clear the questionnaire ? #746

udithv opened this issue Nov 11, 2018 · 8 comments

Comments

@udithv
Copy link

udithv commented Nov 11, 2018

how do I clear the entire questionnaire after all of it is asked.

@SBoudrias
Copy link
Owner

Do you mean to clean the terminal?

@udithv
Copy link
Author

udithv commented Nov 12, 2018

@SBoudrias yes but not the whole console. just the output. Something like logUpdate module where the output is replaced with another... only in my case it has to be replaced with nothing.

@bczak
Copy link

bczak commented Jan 14, 2021

Any update?

@LitoMore
Copy link
Collaborator

Jump out of your question, I think Ink is a better tool to implement your idea.

@raulfdm
Copy link

raulfdm commented Aug 30, 2022

I've just implemented that by using console.clear:

2022-08-30 at 16 23 17 - Blue Owl

In my case, I have multiple prompts, and before jumping from one to another, I run a console.clear and then show my CLI title again.

@SBoudrias
Copy link
Owner

Hello, I've added this feature in our new prompts (the @inquirer/* modules.)

@raulfdm
Copy link

raulfdm commented Aug 31, 2022

@SBoudrias, what do you mean exactly?

Is there documentation about this somewhere?

@SBoudrias
Copy link
Owner

SBoudrias commented Aug 31, 2022

There's types and documentation per prompts; but not a great consolidated doc yet. Here's an example code:

import confirm from '@inquirer/confirm';

const answer = await confirm(
  { message: 'Confirm action?' },
  { clearPromptOnDone: true }
);

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

5 participants