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

Use rustyline crate for Input prompt #82

Open
jamesmcm opened this issue Sep 8, 2020 · 3 comments
Open

Use rustyline crate for Input prompt #82

jamesmcm opened this issue Sep 8, 2020 · 3 comments

Comments

@jamesmcm
Copy link
Contributor

jamesmcm commented Sep 8, 2020

The Input prompt has a few issues at the moment, mainly:

  • There is no emacs/readline support and we'd have to handle each keypress manually to add it in
  • Due to the above manual handling, some things like backspace in tmux don't work

We could use the rustyline crate underneath so we get all the readline functionality for free, and it should work in terminal multiplexers and cross-platform.

EDIT: Swapped liner for rustyline, as the former is dead.

@jamesmcm jamesmcm changed the title Use liner crate for Input prompt Use rustyline crate for Input prompt Sep 8, 2020
@jamesmcm
Copy link
Contributor Author

jamesmcm commented Sep 8, 2020

Hmm, I can't actually replicate the tmux backspace issues I had before now. It might have been due to pasting lines too maybe.

Nevertheless I think it would be useful to have the readline support, and also better handling for if the user pastes multiple lines (or if their paste ends with a newline, etc.)

@pksunkara
Copy link
Collaborator

Is this still an issue?

@jamesmcm
Copy link
Contributor Author

I think it's still a good idea (and rustyline is still maintained) - ideally we could remove this whole loop if all the features work well (not sure if it has built-in history support though) - https://github.com/mitsuhiko/dialoguer/blob/master/src/prompts/input.rs#L262

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

No branches or pull requests

2 participants