jline / jline2

Jline 2.x
http://jline.github.com/jline2/
Other
711 stars 183 forks source link

NumberFormatException on missing termcap #287

Closed Elemecca closed 6 years ago

Elemecca commented 6 years ago

When I use UnixTerminal with the TERM environment variable set to a value for which no termcap/terminfo entry is installed (xterm-256color, in my case) I get an unhandled exception from the parsing logic:

java.lang.NumberFormatException: For input string: "0x100"
  java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
  java.lang.Integer.parseInt(Integer.java:580)
  java.lang.Integer.valueOf(Integer.java:766)
  jline.internal.InfoCmp.parseInfoCmp(InfoCmp.java:59)
  jline.UnixTerminal.parseInfoCmp(UnixTerminal.java:242)
  jline.UnixTerminal.<init>(UnixTerminal.java:65)
  jline.UnixTerminal.<init>(UnixTerminal.java:50)
  ...

Rather than attempt to parse a nonexistent termcap/terminfo entry, JLine should detect that the entry is missing and throw a more meaningful error message.

Elemecca commented 6 years ago

Ah, this is probably a duplicate of #281. I thought I didn't have an xterm-256color terminfo entry because Gradle said so, but it looks like I do and Gradle's error message was most likely caused by a similar bug involving the update to ncurses.

gnodet commented 6 years ago

Closing as a duplicate.