jline/jline2 — Issue #23: Bad behavior when handling \ at the end of the line
Author: gnodet
Created: 2012-02-16 10:15:15+00:00
State: open

See https://issues.apache.org/jira/browse/KARAF-542?focusedCommentId=13036920&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13036920

There's one nuance that should be fixed. In Unix you can add the line break in the middle of a command like this:
$ ech\
> o Hell World!
Hell World!
$

But in Karaf, the line break is adding a space so the same command fails:
karaf@root> ech\
> o Hello World!
Error executing command: Cannot coerce hello(String) to any of []
karaf@root>

Jline is inserting a space where the line break is. This shows the space better:
karaf@root> echo 123\
> 456
123 456
karaf@root>

It also doesn't handle quoting correctly. On Unix:
$ echo "123\
> 456"
123456
$

On Karaf:
karaf@root> echo "123\
> 456"
123\ 456
karaf@root>