Bukkit/CraftBukkit — pull request #718 by EdGruberman (2012-03-10 05:07:22+00:00)
Title: Prevent JLine console causing "unknown command" responses for multiple character line separators. Fixes BUKKIT-717

JLine doesn't properly compensate for a line separator having more than one character on an unsupported terminal. This will.

When the jline.terminal=UnsupportedTerminal system property is set (CraftBukkit's -nojline option sets this also), JLine utilizes this method to read the console input:
https://github.com/jline/jline/blob/9736dee06f07a7d296df5b0e9a1bf5c8f565d7c2/src/main/java/jline/ConsoleReader.java#L633
That method will return all characters up to the first error (-1), carriage return (/r), or line feed (/n).In Windows, a carriage return and line feed combination is the standard line separator. JLine's unsupported terminal approach will split a standard line of input on Windows into all the characters preceding the carriage return and then an empty string when it continues to read again and then finds the line feed character.

This pull request works around this shortcoming in JLine by detecting if CraftBukkit is running with JLine as an unsupported terminal and the line separator (ironically provided by JLine itself) is more than one character. If it is, the input stream is skipped ahead past the additional line separator characters effectively discarding them as the sad lonely orphaned characters the deserve to be as punishment for all the grief they have caused Windows server admins over wondering why their consoles would so unsolicitedly complain to them.

https://bukkit.atlassian.net/browse/BUKKIT-717