jline3

Encoding issue with JLine

被刻印的时光 ゝ 提交于 2019-12-14 04:19:30
问题 Jline is a module for intercepting user input at a console before the user presses Enter . It uses JNA or similar wizardry. I'm doing a few experiments with it and I'm getting encoding problems when I input more "exotic" Unicode characters. The OS here is W10 and I'm using Cygwin. Also this is in Groovy but should be obvious to Java people. def terminal = org.jline.terminal.TerminalBuilder.builder().jna( true ).system( true ).build() terminal.enterRawMode() // NB the Terminal I get is class

JLine the contract for NonBlockingReader seems broken

非 Y 不嫁゛ 提交于 2019-12-11 15:53:16
问题 Follows on from my previous question about JLine. OS: W10, using Cygwin. def terminal = org.jline.terminal.TerminalBuilder.builder().jna( true ).system( true ).build() terminal.enterRawMode() // NB the Terminal I get is class org.jline.terminal.impl.PosixSysTerminal def reader = terminal.reader() // class org.jline.utils.NonBlocking$NonBlockingInputStreamReader def bytes = [] // NB class ArrayList int readInt = -1 while( readInt != 13 && readInt != 10 ) { readInt = reader.read() byte