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

Consider allowing use of PSConsoleHostReadLine for general-purpose prompting #881

Open
mklement0 opened this issue Apr 5, 2019 · 0 comments
Labels
Issue-Enhancement It's a feature request.

Comments

@mklement0
Copy link

mklement0 commented Apr 5, 2019

PSReadLine offers great flexibility and customizability for editing of user input that is PowerShell code.

It would be great to offer the same for general-purpose, end user prompting, possibly by adding parameters to the PSConsoleHostReadLine function, notably by allowing opt-out of the following features:

  • parsing the input as PowerShell code, notably to prevent accidental continuation of the prompt on the next line, if the input is a syntactically incomplete PowerShell statement.

  • (and therefore) syntax coloring

  • adding the submitted input to the command history.

A real-life use case is this Stack Overflow question, which asks for implementing custom key bindings in a prompt presented to the end user.

Scripts could implement such and more sophisticated customizations in order to enhance the end-user input experience, including tab-completion.

Additionally, it would make sense for the Read-Host cmdlet to use this enhanced PSConsoleHostReadLine function either by default or on request.

Environment data

PSReadline version: 2.0.0-beta3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Issue-Enhancement It's a feature request.
Projects
None yet
Development

No branches or pull requests

2 participants