diff --git a/cli/src/main/java/org/jboss/as/cli/impl/CLICommandCompleter.java b/cli/src/main/java/org/jboss/as/cli/impl/CLICommandCompleter.java index 6b771f41cdd..6d001840c55 100644 --- a/cli/src/main/java/org/jboss/as/cli/impl/CLICommandCompleter.java +++ b/cli/src/main/java/org/jboss/as/cli/impl/CLICommandCompleter.java @@ -73,7 +73,7 @@ public static void transferOperation(AeshCompleteOperation from, AeshCompleteOpe protected void doComplete(CommandContext ctx, AeshCompleteOperation op, Completer completer) { String buffer = op.getBuffer(); int cursor = op.getCursor(); - if (buffer.isEmpty()) { + if (buffer.isEmpty() || cursor == 0) { completer.addAllCommandNames(ctx, op); return; } diff --git a/pom.xml b/pom.xml index 2d691007ff1..1161ee116c4 100644 --- a/pom.xml +++ b/pom.xml @@ -140,9 +140,9 @@ 1.1.2 4.12 1.2.17 - 1.5 - 1.4 - 1.8 + 1.6 + 1.5 + 1.9 2.0.0-M15 4.5.2 diff --git a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/MoreTestCase.java b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/MoreTestCase.java index 07098a627ca..ba3ed46f147 100644 --- a/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/MoreTestCase.java +++ b/testsuite/standalone/src/test/java/org/jboss/as/test/integration/management/cli/MoreTestCase.java @@ -153,16 +153,15 @@ public void testPaging() throws Exception { checkWithRegex(window, morePattern); Assert.assertEquals(window, readlineConsole.getTerminalHeight(), countLines(window)); - // Testing of key down is blocked by https://issues.jboss.org/browse/WFCORE-3545 -// // it sends key down to the console what should return only one new line -// consoleWriter.print(Key.DOWN.getKeyValuesAsString()); -// Assert.assertFalse(consoleWriter.checkError()); -// -// window = queue.poll(10, TimeUnit.SECONDS); -// Assert.assertNotNull(window); -// checkWithRegex(window, morePattern); -// // we expect 2 because on the second line there is --More(%)-- string -// Assert.assertEquals(window,2, countLines(window)); + // it sends key down to the console what should return only one new line + consoleWriter.print(Key.DOWN.getKeyValuesAsString()); + Assert.assertFalse(consoleWriter.checkError()); + + window = queue.poll(10, TimeUnit.SECONDS); + Assert.assertNotNull(window); + checkWithRegex(window, morePattern); + // we expect 2 because on the second line there is --More(%)-- string + Assert.assertEquals(window,2, countLines(window)); consoleWriter.print("q"); Assert.assertFalse(consoleWriter.checkError());