4

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.

  • 1
    Did you report this to the [mailing list](http://mail.openjdk.java.net/mailman/listinfo)? – Naman Nov 20 '17 at 18:06
  • Seems like all you have to do now is post a simple message on the mailing list and reference this post. But I might suggest you tone down your anger just a bit. – Jim Garrison Nov 20 '17 at 18:09
  • Thanks @nullpointer. I'll get on that right away. The only thing I could find before you shared [_your link_](http://mail.openjdk.java.net/mailman/listinfo), was [_the Open JDK Bug System_](https://bugs.openjdk.java.net/browse/JDK-8157261); which isn't open to the public I don't think. I'd planned on reporting it in [_Oracle's Java Bugs Database_](https://www.oracle.com/search/results?Ntt=jshell%20wraps%20lines&Dy=1&Nty=1&cat=bugs&Ntk=S3) but I wanted to check here in SO first; so as not to go off half-cocked. Thanks for [_the mailing list link_](http://mail.openjdk.java.net/mailman/listinfo). – javaContractor Nov 20 '17 at 19:02
  • "_Anger_" @JimGarrison? Who's "_angry_"? That's just how we talk where I come from. We say crap like "_crap_" all the time—with a smile on our faces and a sing-songy song in our hearts ;) – javaContractor Nov 20 '17 at 19:04
  • @nullpointer I tried emailing to [_Open JDK's jdk9-dev mailing-list_](http://mail.openjdk.java.net/mailman/listinfo/jdk9-dev) from my unregistered email address. They snubbed me! And after the stress of jumping through first SO's and then imgur's sign-up hoops to post my findings here, I wasn't in the mood for an uber elitist ezmlm mailing list subscription process. Instead, I went ahead and [_submitted it as a bug to Oracle_](http://bugs.java.com/bugdatabase/view_bug.do?bug_id=JDK-8191640); it's their product after all. I didn't even need to login or register! That's what I call "_Service_"! – javaContractor Nov 21 '17 at 13:54

1 Answers1

2

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).