no new line before use of println
When writing to stdout using for instance System.out.println, the line is printed as appended to the end of the line, instead of on a new line of its own:
println(1)1
I would expect a new line after println:
println(1)
1
Sorry to not reply before, and yes, I'm aware of that error, some times not sure why it doesn't happens but most of the times it does.
The problem is Gradle and its pour support for managing I/O in the console, check this https://github.com/mrsarm/jshell-plugin/issues/2.
We were talking today in another issue how limited is to run JShell from Gradle and it would be ideal to run the process outside Gradle to solve this and other problems (https://github.com/mrsarm/jshell-plugin/issues/12#issuecomment-1035093443), but for now, I'm limited of time to work on it :disappointed: .
Is it a same problem? Any workaround?
I used this version:
// build.gradle
plugins {
id 'com.github.mrsarm.jshell.plugin' version '1.2.1'
}
The actual result differs from the expected:
$ rlwrap ./gradlew --no-daemon --console plain jshell
# Expected
jshell> new String("Hello");
$1 ==> "Hello"
# Actual
jshell> new String("Hello");
new String("Hello")$1 ==> "Hello"
While in a vanilla jshell:
$ jshell
jshell> new String("Hello");
$1 ==> "Hello"
Hi @appkr , no, there is no workaround at the moment :disappointed:
@mrsarm Thanks for the clarification.