It would seem that when the input to a completer includes a double quote character as the first character and there are multiple completion candidates, the parser doesn't correctly remove the quote before adding the beginning and end quote back in. This leads to 3 quote characters instead of 2.
This happens when using the default parser & highlighter and built in completers as shown in the below snippet. Entering "Ex and then pressing tab would lead to ""Example1" as the output.
reader = LineReaderBuilder.builder().parser(new DefaultParser())
.completer(new StringsCompleter("Example1", "Example2")).highlighter(new DefaultHighlighter())
.terminal(terminal).build();
reader.setOpt(Option.MENU_COMPLETE); // Show completion options as menu
reader.unsetOpt(Option.CASE_INSENSITIVE);
// Create auto-suggestion widgets and enable it
AutosuggestionWidgets autosuggestionWidgets = new AutosuggestionWidgets(reader);
autosuggestionWidgets.enable();
I have also had this happen when there are quotes at the beginning and the end, leading to part of the string being included too. "Example" and then pressing tab would lead to "EExample1.
It would seem that when the input to a completer includes a double quote character as the first character and there are multiple completion candidates, the parser doesn't correctly remove the quote before adding the beginning and end quote back in. This leads to 3 quote characters instead of 2.
This happens when using the default parser & highlighter and built in completers as shown in the below snippet. Entering
"Ex
and then pressing tab would lead to""Example1"
as the output.I have also had this happen when there are quotes at the beginning and the end, leading to part of the string being included too.
"Example"
and then pressing tab would lead to"EExample1
.