-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
First off, thanks for creating this package.
I'm using it create a REPL using Pyodide (Python compiled to wasm), and I would like to add support for tab completions. The idea is that when you press tab, it does one of the following (which is similar to the normal python REPL):
- If there are zero possible completions, then nothing happens.
- If there is one possible completion, it completes it.
- If there are two or more possible completions, then it fills in any following characters that are present in all of the possible completions, and then displays the possible completions.
I don't see a good way to do this with the existing API. One way to go would be to provide a way register a completion handler; this handler would be a function which takes a string (the text typed on the command line so far) and returns an array of strings (the list of possible completions).
So the usage would be something like this:
readline.setCompletionHandler((text: string): string[] => {
// Do stuff here
}) Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels