I'm using JDK 9 build 179 on Windows 7. I've got the "Screen Buffer Size Width" property of my Windows 7 command shell, set to a large number because that's the way I roll. That works fine normally; when I'm simply using the Windows shell on its own.
Unfortunately though, when I'm using JShell, my "Screen Buffer Size Width" property is ignored and JShell wraps my long lines back on themselves. When a line wraps, it doesn't create a new line. Instead, the cursor doubles back to the beginning of the same line and overwrites characters in that line.
Take a look at this screen recording to see what I mean.
It appears to be using the rightmost dimension of the actual width of the window as its cue to wrap a line; ignoring the "Screen Buffer Size Width" property. That property's sole purpose in life is to explicitly prevent wrapping and allow long lines up to a maximum of 9999 characters.
I've put up with this annoying crap since JDK 9 ea+166. I patiently waited for months; expecting it would be fixed by the time of JDK 9's general release. No such luck.
Please, can anybody let me in on the secret of how to fix this?
Thanks in advance.
Since Oracle has officially confirmed that the issue I discovered is indeed a bug, my own answer for this question is, "Use BeanShell's Interactive Console instead".
bsh has met all my personal Java REPL needs unfailingly for going on eight or ten years now. There's nothing that I currently use jshell for that I can't also do in bsh; with a lot more ease and a lot more intuitively, in my opinion.
Sure, jshell does a couple things that bsh doesn't do. But if like me all you use a Java REPL for is to try out code on the command line, then bsh can't be beat as an already-mature Java REPL option; tried and proven by thousands (if not millions) of developers over a lotta years (since 1999, in fact).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With