Uploaded image for project: 'Aesh'
  1. Aesh
  2. AESH-498

/ by zero when posixTerminal size is 0,0

XMLWordPrintable

    • Icon: Task Task
    • Resolution: Done
    • Icon: Major Major
    • 1.11
    • None
    • None
    • None

      The -nottycopy option makes the PosixSysTerminal to have a 0,0 size. So any cursor movement (completion, delete char, add char) gets you / by zero

      /usr/bin/expect
      spawn -nottycopy java -jar examples/target/aesh-examples-1.10.jar
      interact
      <type a character>
      [aesh@rules]$ Exception in thread "main" java.lang.ArithmeticException: / by zero
      at org.aesh.readline.Buffer.printInsertedData(Buffer.java:586)
      at org.aesh.readline.Buffer.insert(Buffer.java:235)
      at org.aesh.readline.AeshConsoleBuffer.writeChar(AeshConsoleBuffer.java:130)
      at org.aesh.readline.Readline$AeshInputProcessor.parse(Readline.java:252)
      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:324)
      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:216)
      at org.aesh.readline.tty.terminal.TerminalConnection.openBlocking(TerminalConnection.java:203)
      at org.aesh.readline.ReadlineConsole.accept(ReadlineConsole.java:232)
      at org.aesh.readline.ReadlineConsole.accept(ReadlineConsole.java:86)
      at org.aesh.readline.tty.terminal.TerminalConnection.init(TerminalConnection.java:153)
      at org.aesh.readline.tty.terminal.TerminalConnection.<init>(TerminalConnection.java:86)
      at org.aesh.readline.tty.terminal.TerminalConnection.<init>(TerminalConnection.java:96)
      at org.aesh.readline.ReadlineConsole.start(ReadlineConsole.java:180)
      at examples.Example.main(Example.java:164)

              spederse@redhat.com Stale Pedersen
              jdenise@redhat.com Jean Francois Denise
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: