Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-3828

ArrayIndexOutOfBoundsException on clear screen if the cursor in on the start position

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 6.0.0.Alpha1
    • 5.0.0.Alpha7
    • CLI
    • None

    Description

      CLI throws java.lang.ArrayIndexOutOfBoundsException user tries to clear screen (Ctrl+L) with cursor at the starting position.
      reproduce

      wildfly-core] (master)$ ./build/target/wildfly-core-5.0.0.Beta1-SNAPSHOT/bin/jboss-cli.sh 
      You are disconnected at the moment. Type 'connect' to connect to the server or 'help' for the list of supported commands.
      # type 'a'
      [disconnected  /] a[]
      # press "home" or left cursor key to move the cursor back to initial position
      [disconnected  /] []a
      # clear the screen (Ctrl+L)
      Exception in thread "CLI Terminal Connection (uninterruptable)" java.lang.ArrayIndexOutOfBoundsException: -1
      	at org.aesh.readline.Buffer.printInsertedData(Buffer.java:561)
      	at org.aesh.readline.Buffer.insert(Buffer.java:217)
      	at org.aesh.readline.AeshConsoleBuffer.writeChars(AeshConsoleBuffer.java:143)
      	at org.aesh.readline.action.mappings.Clear.accept(Clear.java:39)
      	at org.aesh.readline.Readline$AeshInputProcessor.parse(Readline.java:245)
      	at org.aesh.readline.Readline$AeshInputProcessor.access$100(Readline.java:174)
      	at org.aesh.readline.Readline.readInput(Readline.java:95)
      	at org.aesh.readline.Readline.access$1000(Readline.java:57)
      	at org.aesh.readline.Readline$AeshInputProcessor.lambda$start$1(Readline.java:333)
      	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:118)
      	at org.aesh.terminal.EventDecoder.accept(EventDecoder.java:31)
      	at org.aesh.io.Decoder.write(Decoder.java:133)
      	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:212)
      	at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:199)
      	at org.jboss.as.cli.impl.ReadlineConsole$CLITerminalConnection.lambda$null$1(ReadlineConsole.java:171)
      	at java.lang.Thread.run(Thread.java:748)
      

      CLI session is terminated.

      Attachments

        Issue Links

          Activity

            People

              jdenise@redhat.com Jean Francois Denise
              pkremens@redhat.com Petr Kremensky (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: