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 Prompt Toolkit as an optional dependency #22

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

corranwebster
Copy link

Prompt toolkit is a modern cross-platform Python replacement for GNU readline.

This PR add support for prompt toolkit if it is available, falling back to readline and/or standard input if it is not available. It also adds it as an optional install option via pip (ie. you should be able to install it via pip install adventurelib[prompt_toolkit]) and is added to the tox.ini for testing.

@lordmauve
Copy link
Owner

Sorry for the delay, wanted to try this out properly.

In principle this looks good - will help solve #16 and could go towards other features like tab completion.

However, it seems that in its default configuration, prompt_toolkit isn't set up for things like up/down to move through history. I think we should at least turn that on before merging.

@corranwebster
Copy link
Author

Initially I was just going for basic arrow key support on OS X, but it looks like it is fairly straightforward to add history functionality as well. It does mean restricting to prompt_toolkit >= 2, but I think that's fine.

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