Hi,

I guess it's not a new issue right ?

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.

Regards
JB

On 22/10/2019 12:35, Davi Baldin Tavares wrote:
> Hi,
> 
> 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.
> 
> AND
> 
> 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,
> 
> Davi
> 

-- 
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to