We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0f43b2c commit b908f21Copy full SHA for b908f21
shell/core/src/main/java/org/apache/karaf/shell/impl/console/ConsoleSessionImpl.java
@@ -465,6 +465,12 @@ private CharSequence readCommand(AtomicBoolean reading) throws UserInterruptExce
465
}
466
} catch (UserInterruptException e) {
467
command = ""; // Do nothing
468
+ } catch (StringIndexOutOfBoundsException e) {
469
+ // Workaround for JLine CompletionMatcherImpl bug: Tab on empty line triggers
470
+ // substring(0, 1) on "" in defaultMatchers() before EMPTY_WORD_OPTIONS check.
471
+ // Re-prompt instead of exiting the shell.
472
+ LOGGER.debug("Completion on empty line triggered known JLine edge case", e);
473
+ command = "";
474
} catch (Throwable t) {
475
ShellUtil.logException(this, t);
476
} finally {
0 commit comments