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

[REQUEST] Add instructions about readline in the docs #1633

Closed
1 task done
schneiderfelipe opened this issue Oct 31, 2021 · 1 comment · Fixed by #1634
Closed
1 task done

[REQUEST] Add instructions about readline in the docs #1633

schneiderfelipe opened this issue Oct 31, 2021 · 1 comment · Fixed by #1634

Comments

@schneiderfelipe
Copy link
Contributor

  • Have you checked the issues for similar suggestions.

I believe the docs (and the community in general) would benefit a lot from having some basic guidelines on how to use the standard readline module with Rich. It's a single import after all.

What problem does it solve for you?

Without readline (weird stuff are the result of arrow keys):
withoutreadline

With readline:
withreadline

How would you improve Rich?

It turns out there's no need to change a single line in Rich, just mention it in the docs (such as here):

from rich.console import Console
import readline  # just add this
console = Console()
console.input("What is [i]your[/i] [bold red]name[/]? :smiley: ")

The reason I think it is useful is because

  1. it might not be known by beginners (I didn't!)
  2. it's nowhere to be found in the docs
  3. it's dead easy (just import readline)
  4. similar stuff seems to have been requested before (e.g. [REQUEST] Cycle through Prompt's choices #306), but without any definite answer
@github-actions
Copy link

github-actions bot commented Nov 7, 2021

Did I solve your problem?

Consider sponsoring the ongoing work on Rich and Textual.

Or buy me a coffee to say thanks.

Will McGugan

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

Successfully merging a pull request may close this issue.

1 participant