And I also guess it's working fine with the local console.
If you are in the context of a shell command, you should use the Session
instead of directly System.console().
The session is wrapping the local shell or ssh console impl.
On 22/10/2019 12:35, Davi Baldin Tavares wrote:
> I'm getting an odd behaviour over ssh and bin/client. Searching for issue, I've found fixed issues in the past for similar situations.
> When I reach part of my code over (bin/client) connected to localhost:
> Console cnsl = System.console();
> ---> System.console() is being NULL.
> BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
> String line = reader.readLine();
> ---> readLine() is reading a truncated input and not correctly echoing characters while typing.
> Karaf is 4.2.7
> OS: Linux RedHat 7.5 and/or MacOS
> Java: 1.8.0_211
> Is a better way to get console and read user input while I'm over remote console?
> System.out.println() and ShellTable table = new ShellTable() is OK, only user input is broken.
> Thanks and Regards,