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

StringIndexOutOfBoundsException in shell-jline2 completion #576

Closed
remkop opened this issue Dec 25, 2018 · 1 comment
Closed

StringIndexOutOfBoundsException in shell-jline2 completion #576

remkop opened this issue Dec 25, 2018 · 1 comment
Labels
theme: shell An issue or change related to interactive (JLine) applications type: bug 🐛
Milestone

Comments

@remkop
Copy link
Owner

remkop commented Dec 25, 2018

Steps to reproduce:
Start the example with:

java -cp picocli-3.9.0-SNAPSHOT.jar;picocli-shell-jline2-3.9.0-SNAPSHOT.jar;jline-2.14.6.jar;picocli-shell-jline2-3.9.0-SNAPSHOT-tests.jar picocli.shell.jline2.example.Example

type this command in the shell:

cmd --timeUnit=

Bring the cursor back one position so it is in front of the = character, and hit <TAB>. This will generate the following error:

prompt> cmd --timeUnitjava.lang.StringIndexOutOfBoundsException: String index out of range: -1
        at java.lang.String.substring(Unknown Source)
        at picocli.AutoComplete.complete(AutoComplete.java:600)
        at picocli.shell.jline2.PicocliJLineCompleter.complete(PicocliJLineCompleter.java:48)
        at jline.console.ConsoleReader.complete(ConsoleReader.java:3312)
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2653)
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2378)
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2366)
        at jline.console.ConsoleReader.readLine(ConsoleReader.java:2354)
        at picocli.shell.jline2.example.Example.main(Example.java:97)
@remkop remkop added type: bug 🐛 theme: shell An issue or change related to interactive (JLine) applications labels Dec 25, 2018
@remkop remkop added this to the 3.9 milestone Dec 25, 2018
@remkop
Copy link
Owner Author

remkop commented Dec 25, 2018

Fixed in commit e63d231.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
theme: shell An issue or change related to interactive (JLine) applications type: bug 🐛
Projects
None yet
Development

No branches or pull requests

1 participant