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

Add readline support #122

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

brendon-boldt
Copy link

This should add command history and some basic readline commands to the main command line prompt. I have tested this on my Linux system with CPython and Pypy (NixOS, specifically).

@Lazza
Copy link
Owner

Lazza commented Mar 26, 2024

I only see import readline but the module is not being used anywhere. Is this PR missing some commits?

@brendon-boldt
Copy link
Author

brendon-boldt commented Mar 26, 2024

It's not a mistake, and it confused me at first too. I cannot find any documentation, but just importing the module gives you some of the nice features (for me backspace and up/down for command history) for Python's input() function. It could just be a quirk of my system, but it is pretty easy to test by running python -c 'input(); input()' and comparing it to python -c 'import readline; input(); input()' (double input() gives you a chance to check command history support).

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.

2 participants