[ 
https://issues.apache.org/jira/browse/KARAF-5382?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171404#comment-16171404
 ] 

Tom Quarendon commented on KARAF-5382:
--------------------------------------

The effect of this is that, actually, session.readLine isn't a great deal of 
use. If you try to use if for non masked input, you get undesirable 
highlighting and completion (the LineReader thinks you are trying to type in a 
shell command).
The only solution seems to be to create your own LineReader object, (casting 
the karaf Terminal to a jline Terminal), or read from the session.getKeyboard 
directly, which is rather tedious. However I've had other issues with doing 
that which I've been unable to reduce to a simple example (key presses not 
being recognised, seems like LineReaders don't clean up properly or something).

> Karaf shell session.readLine consumes backslashes
> -------------------------------------------------
>
>                 Key: KARAF-5382
>                 URL: https://issues.apache.org/jira/browse/KARAF-5382
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-shell
>            Reporter: Tom Quarendon
>
> I don't know what the intended use case is for session.readLine, but the 
> behaviour w.r.t backslashes is odd.
> I use is to prompt for a password from the user. So in an action, call 
> session.readLine("prompt", '*'). However, if the user's password contains a 
> backslash, readLine doesn't return what the user typed, which is mighty 
> confusing. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to