Skip to content

Add option to clear TextPrompt after input#1979

Open
ThePCJakub wants to merge 1 commit intospectreconsole:mainfrom
ThePCJakub:feature/textprompt-clear-on-finish
Open

Add option to clear TextPrompt after input#1979
ThePCJakub wants to merge 1 commit intospectreconsole:mainfrom
ThePCJakub:feature/textprompt-clear-on-finish

Conversation

@ThePCJakub
Copy link

fixes #1154

  • I have read the Contribution Guidelines
  • I have commented on the issue above and discussed the intended changes
  • A maintainer has signed off on the changes and the issue was assigned to me
  • All newly added code is adequately covered by tests
  • All existing tests are still running without errors
  • The documentation was modified to reflect the changes OR no documentation changes are required.

Changes

  • Add a ClearOnFinish property to TextPrompt<T> to optionally clear the prompt line after successful input.
  • Add a ClearOnFinish() fluent extension for easier configuration.
  • Clear the prompt line by emitting an ANSI clear-line sequence (ESC[2K) when ANSI is supported.
  • Add an expectation-based test (ClearOnFinish) to verify the output of TextPrompt<string> with ClearOnFinish() enabled.

Please upvote 👍 this pull request if you are interested in it.

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

Successfully merging this pull request may close these issues.

Add support for removing TextPrompt after text entry

1 participant

Comments