From sundararajan.athijegannathan at oracle.com Sat Dec 1 06:13:20 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Sat, 01 Dec 2018 11:43:20 +0530 Subject: RFR: 8210943: Hiding of inner classes not resolved properly In-Reply-To: References: <297BF1EF-38A7-4CAC-85EB-D5A0D4A93466@oracle.com> Message-ID: <5C022680.2020006@oracle.com> Class.getClasses() javadoc does not mention anything about order of classes returned. https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() Do we need a check using Class.getDeclaringClass() or do I something here? Thanks, -Sundar On 30/11/18, 4:44 PM, Attila Szegedi wrote: > +1. Thanks for fixing this. > >> On 2018. Nov 29., at 18:01, Hannes Walln?fer wrote: >> >> Please review: >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 >> Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ >> >> AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes returned by Class.getClasses(), but these may contain inherited classes that are shadowed and thus not visible from the current class. The solution is to make sure we use the first inner class with any given name. >> >> Thanks, >> Hannes From sundararajan.athijegannathan at oracle.com Sat Dec 1 06:44:51 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Sat, 01 Dec 2018 12:14:51 +0530 Subject: RFR: 8210943: Hiding of inner classes not resolved properly In-Reply-To: <5C022680.2020006@oracle.com> References: <297BF1EF-38A7-4CAC-85EB-D5A0D4A93466@oracle.com> <5C022680.2020006@oracle.com> Message-ID: <5C022DE3.2060206@oracle.com> That should have been "do I miss something here?" :) -Sundar On 01/12/18, 11:43 AM, Sundararajan Athijegannathan wrote: > Class.getClasses() javadoc does not mention anything about order of > classes returned. > > https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() > > > Do we need a check using Class.getDeclaringClass() or do I something > here? > > Thanks, > -Sundar > > On 30/11/18, 4:44 PM, Attila Szegedi wrote: >> +1. Thanks for fixing this. >> >>> On 2018. Nov 29., at 18:01, Hannes >>> Walln?fer wrote: >>> >>> Please review: >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 >>> Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ >>> >>> AccessibleMembersLookup#lookupAccessibleMembers adds all nested >>> classes returned by Class.getClasses(), but these may contain >>> inherited classes that are shadowed and thus not visible from the >>> current class. The solution is to make sure we use the first inner >>> class with any given name. >>> >>> Thanks, >>> Hannes From szegedia at gmail.com Sat Dec 1 12:05:31 2018 From: szegedia at gmail.com (Attila Szegedi) Date: Sat, 1 Dec 2018 13:05:31 +0100 Subject: RFR: 8210943: Hiding of inner classes not resolved properly In-Reply-To: <5C022680.2020006@oracle.com> References: <297BF1EF-38A7-4CAC-85EB-D5A0D4A93466@oracle.com> <5C022680.2020006@oracle.com> Message-ID: <6335A43D-B16B-483D-AA9B-E1929B18378C@gmail.com> The relevant Dynalink algorithm processes the class before moving on to superclass, so Hannes fix is correct in that we won?t stomp over a subclass? inner class (inserted into the map earlier) with the superclass? inner class (encountered later by the algorithm). So yeah, getClasses() doesn?t specify an order, but the Dynalink code has a subclass-towards-superclass traversal order. Attila. > On 2018. Dec 1., at 7:13, Sundararajan Athijegannathan wrote: > > Class.getClasses() javadoc does not mention anything about order of classes returned. > > https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() > > Do we need a check using Class.getDeclaringClass() or do I something here? > > Thanks, > -Sundar > > On 30/11/18, 4:44 PM, Attila Szegedi wrote: >> +1. Thanks for fixing this. >> >>> On 2018. Nov 29., at 18:01, Hannes Walln?fer wrote: >>> >>> Please review: >>> >>> Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 >>> Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ >>> >>> AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes returned by Class.getClasses(), but these may contain inherited classes that are shadowed and thus not visible from the current class. The solution is to make sure we use the first inner class with any given name. >>> >>> Thanks, >>> Hannes From hannes.wallnoefer at oracle.com Sat Dec 1 18:12:32 2018 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Sat, 1 Dec 2018 19:12:32 +0100 Subject: RFR: 8210943: Hiding of inner classes not resolved properly In-Reply-To: <6335A43D-B16B-483D-AA9B-E1929B18378C@gmail.com> References: <297BF1EF-38A7-4CAC-85EB-D5A0D4A93466@oracle.com> <5C022680.2020006@oracle.com> <6335A43D-B16B-483D-AA9B-E1929B18378C@gmail.com> Message-ID: Attila, the subclass-to-superclass traversal is actually not done in dynalink but directly in java.lang.Class.getClasses(). So Sundar has a point in that my code relies on implementation rather than specified behaviour of Class.getClasses(). Now I do think it is highly unlikely that the order of classes returned by Classes.getClasses() would change in a future release. That would certainly break a lot of other code. Furthermore, if the order was reversed (superclasses to subclasses) that change would be caught by the test. The only change that could go unnoticed would be classes returned in random order, which I don?t think is a real concern. But of course we could choose to be defensive and add code that guards against it. Hannes > Am 01.12.2018 um 13:05 schrieb Attila Szegedi : > > The relevant Dynalink algorithm processes the class before moving on to superclass, so Hannes fix is correct in that we won?t stomp over a subclass? inner class (inserted into the map earlier) with the superclass? inner class (encountered later by the algorithm). So yeah, getClasses() doesn?t specify an order, but the Dynalink code has a subclass-towards-superclass traversal order. > > Attila. > >> On 2018. Dec 1., at 7:13, Sundararajan Athijegannathan wrote: >> >> Class.getClasses() javadoc does not mention anything about order of classes returned. >> >> https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() >> >> Do we need a check using Class.getDeclaringClass() or do I something here? >> >> Thanks, >> -Sundar >> >> On 30/11/18, 4:44 PM, Attila Szegedi wrote: >>> +1. Thanks for fixing this. >>> >>>> On 2018. Nov 29., at 18:01, Hannes Walln?fer wrote: >>>> >>>> Please review: >>>> >>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 >>>> Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ >>>> >>>> AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes returned by Class.getClasses(), but these may contain inherited classes that are shadowed and thus not visible from the current class. The solution is to make sure we use the first inner class with any given name. >>>> >>>> Thanks, >>>> Hannes > From szegedia at gmail.com Sat Dec 1 18:37:37 2018 From: szegedia at gmail.com (Attila Szegedi) Date: Sat, 1 Dec 2018 19:37:37 +0100 Subject: RFR: 8210943: Hiding of inner classes not resolved properly In-Reply-To: References: <297BF1EF-38A7-4CAC-85EB-D5A0D4A93466@oracle.com> <5C022680.2020006@oracle.com> <6335A43D-B16B-483D-AA9B-E1929B18378C@gmail.com> Message-ID: <1DF9EC42-1269-4CCD-9372-81E234B0C249@gmail.com> Huh? so even within the single array returned from a single call to Classes.getClasses() we can have two classes of the same short name? I foolishly presumed this wouldn?t be the case. I guess in this case the full solution would indeed to provide an ordering on the classes, first on the name, then on whether one?s declaring class is a subclass of the other (I guess the number of superclasses is also a good proxy for that.) Attila. > On 2018. Dec 1., at 19:12, Hannes Walln?fer wrote: > > Attila, the subclass-to-superclass traversal is actually not done in dynalink but directly in java.lang.Class.getClasses(). So Sundar has a point in that my code relies on implementation rather than specified behaviour of Class.getClasses(). > > Now I do think it is highly unlikely that the order of classes returned by Classes.getClasses() would change in a future release. That would certainly break a lot of other code. Furthermore, if the order was reversed (superclasses to subclasses) that change would be caught by the test. The only change that could go unnoticed would be classes returned in random order, which I don?t think is a real concern. But of course we could choose to be defensive and add code that guards against it. > > Hannes > > >> Am 01.12.2018 um 13:05 schrieb Attila Szegedi : >> >> The relevant Dynalink algorithm processes the class before moving on to superclass, so Hannes fix is correct in that we won?t stomp over a subclass? inner class (inserted into the map earlier) with the superclass? inner class (encountered later by the algorithm). So yeah, getClasses() doesn?t specify an order, but the Dynalink code has a subclass-towards-superclass traversal order. >> >> Attila. >> >>> On 2018. Dec 1., at 7:13, Sundararajan Athijegannathan wrote: >>> >>> Class.getClasses() javadoc does not mention anything about order of classes returned. >>> >>> https://docs.oracle.com/javase/10/docs/api/java/lang/Class.html#getClasses() >>> >>> Do we need a check using Class.getDeclaringClass() or do I something here? >>> >>> Thanks, >>> -Sundar >>> >>> On 30/11/18, 4:44 PM, Attila Szegedi wrote: >>>> +1. Thanks for fixing this. >>>> >>>>> On 2018. Nov 29., at 18:01, Hannes Walln?fer wrote: >>>>> >>>>> Please review: >>>>> >>>>> Bug: https://bugs.openjdk.java.net/browse/JDK-8210943 >>>>> Webrev: http://cr.openjdk.java.net/~hannesw/8210943/webrev.00/ >>>>> >>>>> AccessibleMembersLookup#lookupAccessibleMembers adds all nested classes returned by Class.getClasses(), but these may contain inherited classes that are shadowed and thus not visible from the current class. The solution is to make sure we use the first inner class with any given name. >>>>> >>>>> Thanks, >>>>> Hannes >> > From hannes.wallnoefer at oracle.com Wed Dec 5 14:33:09 2018 From: hannes.wallnoefer at oracle.com (=?utf-8?Q?Hannes_Walln=C3=B6fer?=) Date: Wed, 5 Dec 2018 15:33:09 +0100 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup Message-ID: Please review: Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). Thanks, Hannes From sundararajan.athijegannathan at oracle.com Wed Dec 5 14:57:05 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Wed, 05 Dec 2018 20:27:05 +0530 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup In-Reply-To: References: Message-ID: <5C07E741.2070706@oracle.com> Looks good -Sundar On 05/12/18, 8:03 PM, Hannes Walln?fer wrote: > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 > Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ > > This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). > > Thanks, > Hannes From sundararajan.athijegannathan at oracle.com Wed Dec 5 14:55:42 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Wed, 05 Dec 2018 20:25:42 +0530 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup In-Reply-To: References: Message-ID: <5C07E6EE.1070308@oracle.com> Looks good. -Sundar On 05/12/18, 8:03 PM, Hannes Walln?fer wrote: > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 > Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ > > This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). > > Thanks, > Hannes From james.laskey at oracle.com Wed Dec 5 14:45:43 2018 From: james.laskey at oracle.com (Jim Laskey) Date: Wed, 5 Dec 2018 10:45:43 -0400 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup In-Reply-To: References: Message-ID: <23E9F86A-A09A-4C91-B82E-78490FE2D100@oracle.com> Wouldn?t you still use innerClasses.putIfAbsent in case there is a race? > On Dec 5, 2018, at 10:33 AM, Hannes Walln?fer wrote: > > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 > Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ > > This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). > > Thanks, > Hannes From szegedia at gmail.com Wed Dec 5 15:26:00 2018 From: szegedia at gmail.com (Attila Szegedi) Date: Wed, 5 Dec 2018 16:26:00 +0100 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup In-Reply-To: <23E9F86A-A09A-4C91-B82E-78490FE2D100@oracle.com> References: <23E9F86A-A09A-4C91-B82E-78490FE2D100@oracle.com> Message-ID: This code is ultimately invoked from BeanLinker constructor, so always on a single thread; there?s no race here. putIfAbsent was used here previously solely for its effect of not replacing existing mappings, not because of its atomicity. Attila. > On 2018. Dec 5., at 15:45, Jim Laskey wrote: > > Wouldn?t you still use innerClasses.putIfAbsent in case there is a race? > >> On Dec 5, 2018, at 10:33 AM, Hannes Walln?fer wrote: >> >> Please review: >> >> Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 >> Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ >> >> This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). >> >> Thanks, >> Hannes > From szegedia at gmail.com Wed Dec 5 15:26:12 2018 From: szegedia at gmail.com (Attila Szegedi) Date: Wed, 5 Dec 2018 16:26:12 +0100 Subject: RFR: 8214795: Add safety check to dynalink inner class lookup In-Reply-To: References: Message-ID: <66F33CDF-72F1-4C69-8240-9E346D25B1B3@gmail.com> +1 > On 2018. Dec 5., at 15:33, Hannes Walln?fer wrote: > > Please review: > > Bug: https://bugs.openjdk.java.net/browse/JDK-8214795 > Webrev: http://cr.openjdk.java.net/~hannesw/8214795/webrev.00/ > > This is to make sure we use the right inner classes regardless of the order of classes returned by Class.getClasses(). > > Thanks, > Hannes From sundararajan.athijegannathan at oracle.com Thu Dec 6 02:55:27 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Thu, 06 Dec 2018 08:25:27 +0530 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C080880.2080407@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> Message-ID: <5C088F9F.5020902@oracle.com> CC'ing nashorn-dev. -Sundar On 05/12/18, 10:48 PM, Jan Lahoda wrote: > Hi Robert, > > On 4.12.2018 23:59, Robert Field wrote: >> I saw no issues with JShell tool and test portions of the webrev. I did >> not review the nashorn changes. > > Thanks for looking at this! > >> >> Testing it: editing multi-line snippets is vastly easier and more >> intuitive. >> There is one issue, with the old mechanism, as horridly clunky as it >> was, you could add new lines of code (a frequently needed >> functionality). >> Since is accept, I could find no way to add lines with this >> JLine 3 version. Thoughts? > > One possibility that comes to mind: pressing Enter inside the snippet > would add a new line, Enter at the very end of a (complete) snippet > would confirm that snippet. Could be fairly convenient/intuitive. What > do you think? > >> >> I looked into readline commands as an approach to addressing this, found >> nothing. However, most readline commands worked. Ctrl-u however did not >> behave as documented in readline (instead deleting to the beginning of >> the line). I notice that the there is zero in-command documentation of >> command-line editing -- not even a mention. Independent from the review >> of this port, it seems we should have in-command documentation of >> command editing -- even more so now that multiline editing is useful. > > This is about enhancing /help, right? I'll see what I can do. > >> >> The JShell User Manual will also need a little edit in the History >> Navigation section. > > Where is that? > > Thanks, > Jan > >> >> -Robert >> >> >> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>> Hi, >>> >>> I'd like to update the internal JLine used by JShell and jjs to JLine >>> 3.9.0. Two notable advantages of this version is multi-line snippet >>> editing and better UI on Windows (escape sequence support on Windows). >>> As a consequence, this patch drops EditingHistory, as it does not seem >>> to be needed anymore. >>> >>> JBS: >>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>> >>> The full patch is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>> >>> >>> To make the changes more clear, I've split it into two: >>> -replacement of existing JLine with the new on in jdk.internal.le, no >>> changes to JLine code: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>> >>> -tweaks to JLine (repackaging, eliminating references to j.u.l.Logger, >>> adding hooks to wrap input streams with our stop-detecting input >>> stream, adding unicode escapes to unicode characters, support for >>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>> substantial): >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>> >>> Any feedback is welcome! >>> >>> Thanks, >>> Jan From jan.lahoda at oracle.com Thu Dec 6 15:20:41 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Thu, 6 Dec 2018 16:20:41 +0100 Subject: JShell: Request for ideas: Editing multiline snippets, adding lines In-Reply-To: <828669D6-589E-42FB-AA95-2A5EC548CDF9@oracle.com> References: <60F4F891-8481-480E-9DD8-F4A70BF91ABF@oracle.com> <828669D6-589E-42FB-AA95-2A5EC548CDF9@oracle.com> Message-ID: <5C093E49.7010705@oracle.com> On 6.12.2018 06:08, Michel Trudeau wrote: > What about Ctrl-Enter ? Actually, Alt-Enter turnes out to work on Linux (KDE Konsole) as a shortcut to add a new line. The main issue here is that we can only use shortcuts for which the terminal will produce an escape sequence, and IIRC on Mac this was very troublesome (the shortcuts that produced escape sequences and that we could use were severely limited). So the Alt-Enter may not work on Mac (I believe we wanted to have the "add import" bound to Alt-Enter and it was not possible on Mac). If someone with Mac could try with this patch: --- diff -r 183e274baccd src/jdk.internal.le/share/classes/jdk/internal/org/jline/keymap/BindingReader.java --- a/src/jdk.internal.le/share/classes/jdk/internal/org/jline/keymap/BindingReader.java Thu Dec 06 15:05:31 2018 +0100 +++ b/src/jdk.internal.le/share/classes/jdk/internal/org/jline/keymap/BindingReader.java Thu Dec 06 16:00:04 2018 +0100 @@ -11,7 +11,10 @@ import java.io.IOError; import java.io.IOException; import java.util.ArrayDeque; +import java.util.Arrays; import java.util.Deque; +import java.util.stream.Collectors; +import java.util.stream.StreamSupport; import jdk.internal.org.jline.reader.EndOfFileException; import jdk.internal.org.jline.utils.ClosedException; @@ -112,6 +115,12 @@ return null; } opBuffer.appendCodePoint(c); + System.err.print("opBuffer='"); + for (char cc : opBuffer.toString().toCharArray()) { + System.err.print(Integer.toHexString(cc)); + System.err.print(" "); + } + System.err.println("'"); hasRead = true; } return null; --- When a key or a combination of keys is pressed, it should print output like: opBuffer='1b d ' (this is for Alt-Enter for me). If there's some useful combination on Mac that prints something distinguishable, we can use that as a shortcut. Thanks, Jan > > On Dec 5, 2018, at 8:46 PM, Robert Field wrote: > > A fix about to go back to JDK 12 (see JLine 3 review discussion) provides a significant improvement when editing multiline snippets ? they are treated as an integral unit ? with WYSIWYG-ish interaction. > > There is however one limitation: Since has its legacy action of accepting the input, there is no way with line editing to add a line within a multiline snippet. > > It would seem that a different input is needed to add a line (unless I?m missing something). Suggestions for that keystroke are herein solicited. > > Thanks, > Robert > > From jan.lahoda at oracle.com Sat Dec 8 15:21:54 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Sat, 8 Dec 2018 16:21:54 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C080880.2080407@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> Message-ID: <5C0BE192.8010404@oracle.com> Hi, I've updated the patch to reflect the comments so far, the current version is here: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ Delta since the previous version is here for convenience: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ In this version, while editing a snippet, a new line can be added using Alt-Enter (on platforms that support that), or Ctrl-Enter (on Windows). And alternative patch is here: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ Delta: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ In the alternative version, Enter will only "confirm" multi-line snippet when the cursor is at the end of the snippet, otherwise it will add a new line (so that a special shortcut is not needed; but a snippet cannot be "confirmed" by pressing Enter in the middle of a multi-line snippet.) The only difference between the .01 and .01a patches is the way they allow to add new lines into the multi-line snippets. Other changes are the same. Any feedback on this is welcome. Thanks! Jan On 5.12.2018 18:18, Jan Lahoda wrote: > Hi Robert, > > On 4.12.2018 23:59, Robert Field wrote: >> I saw no issues with JShell tool and test portions of the webrev. I did >> not review the nashorn changes. > > Thanks for looking at this! > >> >> Testing it: editing multi-line snippets is vastly easier and more >> intuitive. >> There is one issue, with the old mechanism, as horridly clunky as it >> was, you could add new lines of code (a frequently needed functionality). >> Since is accept, I could find no way to add lines with this >> JLine 3 version. Thoughts? > > One possibility that comes to mind: pressing Enter inside the snippet > would add a new line, Enter at the very end of a (complete) snippet > would confirm that snippet. Could be fairly convenient/intuitive. What > do you think? > >> >> I looked into readline commands as an approach to addressing this, found >> nothing. However, most readline commands worked. Ctrl-u however did not >> behave as documented in readline (instead deleting to the beginning of >> the line). I notice that the there is zero in-command documentation of >> command-line editing -- not even a mention. Independent from the review >> of this port, it seems we should have in-command documentation of >> command editing -- even more so now that multiline editing is useful. > > This is about enhancing /help, right? I'll see what I can do. > >> >> The JShell User Manual will also need a little edit in the History >> Navigation section. > > Where is that? > > Thanks, > Jan > >> >> -Robert >> >> >> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>> Hi, >>> >>> I'd like to update the internal JLine used by JShell and jjs to JLine >>> 3.9.0. Two notable advantages of this version is multi-line snippet >>> editing and better UI on Windows (escape sequence support on Windows). >>> As a consequence, this patch drops EditingHistory, as it does not seem >>> to be needed anymore. >>> >>> JBS: >>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>> >>> The full patch is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>> >>> >>> To make the changes more clear, I've split it into two: >>> -replacement of existing JLine with the new on in jdk.internal.le, no >>> changes to JLine code: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>> >>> -tweaks to JLine (repackaging, eliminating references to j.u.l.Logger, >>> adding hooks to wrap input streams with our stop-detecting input >>> stream, adding unicode escapes to unicode characters, support for >>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>> substantial): >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>> >>> Any feedback is welcome! >>> >>> Thanks, >>> Jan From robert.field at oracle.com Sat Dec 8 19:39:04 2018 From: robert.field at oracle.com (Robert Field) Date: Sat, 8 Dec 2018 11:39:04 -0800 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0BE192.8010404@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> Message-ID: <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> Thanks for updating. Good to have /help for line editing keys, however: ? (1) The supported keys should be listed without requiring that the user knows or looks-up readline. More so, since only some readline keys are supposed. ? (2) "/edit" is a command, so with this change, typing "/help edit" would give both the /edit and editing help -- which would be confusing.? I suggest "/help keys", there are no "k" help items. ? (3) In jshell tool online docs the tool is spelled "jshell tool" I'd be happy to write up suggested text. As to the alternative patch: I understand the motivation, it would be nice to just use the natural "Enter" as new line. Unfortunately it's functionality is then overloaded.? I believe the alternative will be confusing and awkward: ? (1) It breaks backward compatibility in user experience, Enter has always been accept/evaluate ? (2) It would be very awkward and non-intuitive (particularly in a long multiline snippet) to have to navigate to the end of the snippet to accept. ?????? Note: must be the end both vertically and horizontally. ? (3) It is inconsistent: Mid snippet Enter on one line does accept.? However, on a continuation line (say after "int x =") it adds a new line instead. ? (4) It doesn't solve the problem for the most common location for adding a new line, the end of snippet -- thus introducing more inconsistency. Thanks, Robert On 12/8/18 7:21 AM, Jan Lahoda wrote: > Hi, > > I've updated the patch to reflect the comments so far, the current > version is here: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ > Delta since the previous version is here for convenience: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ > > In this version, while editing a snippet, a new line can be added > using Alt-Enter (on platforms that support that), or Ctrl-Enter (on > Windows). > > > And alternative patch is here: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ > Delta: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ > > In the alternative version, Enter will only "confirm" multi-line > snippet when the cursor is at the end of the snippet, otherwise it > will add a new line (so that a special shortcut is not needed; but a > snippet cannot be "confirmed" by pressing Enter in the middle of a > multi-line snippet.) > > The only difference between the .01 and .01a patches is the way they > allow to add new lines into the multi-line snippets. Other changes are > the same. > > Any feedback on this is welcome. > > Thanks! > > Jan > > On 5.12.2018 18:18, Jan Lahoda wrote: >> Hi Robert, >> >> On 4.12.2018 23:59, Robert Field wrote: >>> I saw no issues with JShell tool and test portions of the webrev.? I >>> did >>> not review the nashorn changes. >> >> Thanks for looking at this! >> >>> >>> Testing it: editing multi-line snippets is vastly easier and more >>> intuitive. >>> There is one issue, with the old mechanism, as horridly clunky as it >>> was, you could add new lines of code (a frequently needed >>> functionality). >>> Since is accept, I could find no way to add lines with this >>> JLine 3 version.? Thoughts? >> >> One possibility that comes to mind: pressing Enter inside the snippet >> would add a new line, Enter at the very end of a (complete) snippet >> would confirm that snippet. Could be fairly convenient/intuitive. What >> do you think? >> >>> >>> I looked into readline commands as an approach to addressing this, >>> found >>> nothing.? However, most readline commands worked. Ctrl-u however did >>> not >>> behave as documented in readline (instead deleting to the beginning of >>> the line).? I notice that the there is zero in-command documentation of >>> command-line editing -- not even a mention.? Independent from the >>> review >>> of this port, it seems we should have in-command documentation of >>> command editing -- even more so now that multiline editing is useful. >> >> This is about enhancing /help, right? I'll see what I can do. >> >>> >>> The JShell User Manual will also need a little edit in the History >>> Navigation section. >> >> Where is that? >> >> Thanks, >> ???? Jan >> >>> >>> -Robert >>> >>> >>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>> Hi, >>>> >>>> I'd like to update the internal JLine used by JShell and jjs to JLine >>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>> editing and better UI on Windows (escape sequence support on Windows). >>>> As a consequence, this patch drops EditingHistory, as it does not seem >>>> to be needed anymore. >>>> >>>> JBS: >>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>> >>>> The full patch is here: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>> >>>> >>>> To make the changes more clear, I've split it into two: >>>> -replacement of existing JLine with the new on in jdk.internal.le, no >>>> changes to JLine code: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>> >>>> -tweaks to JLine (repackaging, eliminating references to j.u.l.Logger, >>>> adding hooks to wrap input streams with our stop-detecting input >>>> stream, adding unicode escapes to unicode characters, support for >>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>> substantial): >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>> >>>> Any feedback is welcome! >>>> >>>> Thanks, >>>> ??? Jan From jan.lahoda at oracle.com Sat Dec 8 19:47:06 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Sat, 8 Dec 2018 20:47:06 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> Message-ID: <5C0C1FBA.2050602@oracle.com> On 8.12.2018 20:39, Robert Field wrote: > Thanks for updating. > > Good to have /help for line editing keys, however: > (1) The supported keys should be listed without requiring that the > user knows or looks-up readline. More so, since only some readline keys > are supposed. > (2) "/edit" is a command, so with this change, typing "/help edit" > would give both the /edit and editing help -- which would be confusing. > I suggest "/help keys", there are no "k" help items. Will do. > (3) In jshell tool online docs the tool is spelled "jshell tool" > I'd be happy to write up suggested text. Thanks, that would be very welcome! > > As to the alternative patch: I understand the motivation, it would be > nice to just use the natural "Enter" as new line. Unfortunately it's > functionality is then overloaded. I believe the alternative will be > confusing and awkward: > (1) It breaks backward compatibility in user experience, Enter has > always been accept/evaluate > (2) It would be very awkward and non-intuitive (particularly in a > long multiline snippet) to have to navigate to the end of the snippet to > accept. > Note: must be the end both vertically and horizontally. > (3) It is inconsistent: Mid snippet Enter on one line does accept. > However, on a continuation line (say after "int x =") it adds a new line > instead. > (4) It doesn't solve the problem for the most common location for > adding a new line, the end of snippet -- thus introducing more > inconsistency. Ok. This was meant more as a backup in case there's no reasonable shortcut we could use to add new lines. Thanks for the comments! Jan > > Thanks, > Robert > > > On 12/8/18 7:21 AM, Jan Lahoda wrote: >> Hi, >> >> I've updated the patch to reflect the comments so far, the current >> version is here: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >> Delta since the previous version is here for convenience: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >> >> In this version, while editing a snippet, a new line can be added >> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >> Windows). >> >> >> And alternative patch is here: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >> Delta: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >> >> In the alternative version, Enter will only "confirm" multi-line >> snippet when the cursor is at the end of the snippet, otherwise it >> will add a new line (so that a special shortcut is not needed; but a >> snippet cannot be "confirmed" by pressing Enter in the middle of a >> multi-line snippet.) >> >> The only difference between the .01 and .01a patches is the way they >> allow to add new lines into the multi-line snippets. Other changes are >> the same. >> >> Any feedback on this is welcome. >> >> Thanks! >> >> Jan >> >> On 5.12.2018 18:18, Jan Lahoda wrote: >>> Hi Robert, >>> >>> On 4.12.2018 23:59, Robert Field wrote: >>>> I saw no issues with JShell tool and test portions of the webrev. I >>>> did >>>> not review the nashorn changes. >>> >>> Thanks for looking at this! >>> >>>> >>>> Testing it: editing multi-line snippets is vastly easier and more >>>> intuitive. >>>> There is one issue, with the old mechanism, as horridly clunky as it >>>> was, you could add new lines of code (a frequently needed >>>> functionality). >>>> Since is accept, I could find no way to add lines with this >>>> JLine 3 version. Thoughts? >>> >>> One possibility that comes to mind: pressing Enter inside the snippet >>> would add a new line, Enter at the very end of a (complete) snippet >>> would confirm that snippet. Could be fairly convenient/intuitive. What >>> do you think? >>> >>>> >>>> I looked into readline commands as an approach to addressing this, >>>> found >>>> nothing. However, most readline commands worked. Ctrl-u however did >>>> not >>>> behave as documented in readline (instead deleting to the beginning of >>>> the line). I notice that the there is zero in-command documentation of >>>> command-line editing -- not even a mention. Independent from the >>>> review >>>> of this port, it seems we should have in-command documentation of >>>> command editing -- even more so now that multiline editing is useful. >>> >>> This is about enhancing /help, right? I'll see what I can do. >>> >>>> >>>> The JShell User Manual will also need a little edit in the History >>>> Navigation section. >>> >>> Where is that? >>> >>> Thanks, >>> Jan >>> >>>> >>>> -Robert >>>> >>>> >>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>> Hi, >>>>> >>>>> I'd like to update the internal JLine used by JShell and jjs to JLine >>>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>>> editing and better UI on Windows (escape sequence support on Windows). >>>>> As a consequence, this patch drops EditingHistory, as it does not seem >>>>> to be needed anymore. >>>>> >>>>> JBS: >>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>> >>>>> The full patch is here: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>> >>>>> >>>>> To make the changes more clear, I've split it into two: >>>>> -replacement of existing JLine with the new on in jdk.internal.le, no >>>>> changes to JLine code: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>> >>>>> -tweaks to JLine (repackaging, eliminating references to j.u.l.Logger, >>>>> adding hooks to wrap input streams with our stop-detecting input >>>>> stream, adding unicode escapes to unicode characters, support for >>>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>>> substantial): >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>> >>>>> Any feedback is welcome! >>>>> >>>>> Thanks, >>>>> Jan From robert.field at oracle.com Sat Dec 8 19:49:00 2018 From: robert.field at oracle.com (Robert Field) Date: Sat, 8 Dec 2018 11:49:00 -0800 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0C1FBA.2050602@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> Message-ID: <4c78f958-42f9-f83a-b2ae-3f9254038286@oracle.com> On 12/8/18 11:47 AM, Jan Lahoda wrote: > On 8.12.2018 20:39, Robert Field wrote: >> Thanks for updating. >> >> Good to have /help for line editing keys, however: >> ?? (1) The supported keys should be listed without requiring that the >> user knows or looks-up readline. More so, since only some readline keys >> are supposed. >> ?? (2) "/edit" is a command, so with this change, typing "/help edit" >> would give both the /edit and editing help -- which would be confusing. >> I suggest "/help keys", there are no "k" help items. > > Will do. > >> ?? (3) In jshell tool online docs the tool is spelled "jshell tool" >> I'd be happy to write up suggested text. > > Thanks, that would be very welcome! OK, I'll put something together now. -Robert > >> >> As to the alternative patch: I understand the motivation, it would be >> nice to just use the natural "Enter" as new line. Unfortunately it's >> functionality is then overloaded.? I believe the alternative will be >> confusing and awkward: >> ?? (1) It breaks backward compatibility in user experience, Enter has >> always been accept/evaluate >> ?? (2) It would be very awkward and non-intuitive (particularly in a >> long multiline snippet) to have to navigate to the end of the snippet to >> accept. >> ??????? Note: must be the end both vertically and horizontally. >> ?? (3) It is inconsistent: Mid snippet Enter on one line does accept. >> However, on a continuation line (say after "int x =") it adds a new line >> instead. >> ?? (4) It doesn't solve the problem for the most common location for >> adding a new line, the end of snippet -- thus introducing more >> inconsistency. > > Ok. This was meant more as a backup in case there's no reasonable > shortcut we could use to add new lines. > > Thanks for the comments! > > Jan > >> >> Thanks, >> Robert >> >> >> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>> Hi, >>> >>> I've updated the patch to reflect the comments so far, the current >>> version is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>> Delta since the previous version is here for convenience: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>> >>> In this version, while editing a snippet, a new line can be added >>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>> Windows). >>> >>> >>> And alternative patch is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>> Delta: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>> >>> In the alternative version, Enter will only "confirm" multi-line >>> snippet when the cursor is at the end of the snippet, otherwise it >>> will add a new line (so that a special shortcut is not needed; but a >>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>> multi-line snippet.) >>> >>> The only difference between the .01 and .01a patches is the way they >>> allow to add new lines into the multi-line snippets. Other changes are >>> the same. >>> >>> Any feedback on this is welcome. >>> >>> Thanks! >>> >>> Jan >>> >>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>> Hi Robert, >>>> >>>> On 4.12.2018 23:59, Robert Field wrote: >>>>> I saw no issues with JShell tool and test portions of the webrev.? I >>>>> did >>>>> not review the nashorn changes. >>>> >>>> Thanks for looking at this! >>>> >>>>> >>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>> intuitive. >>>>> There is one issue, with the old mechanism, as horridly clunky as it >>>>> was, you could add new lines of code (a frequently needed >>>>> functionality). >>>>> Since is accept, I could find no way to add lines with this >>>>> JLine 3 version.? Thoughts? >>>> >>>> One possibility that comes to mind: pressing Enter inside the snippet >>>> would add a new line, Enter at the very end of a (complete) snippet >>>> would confirm that snippet. Could be fairly convenient/intuitive. What >>>> do you think? >>>> >>>>> >>>>> I looked into readline commands as an approach to addressing this, >>>>> found >>>>> nothing.? However, most readline commands worked. Ctrl-u however did >>>>> not >>>>> behave as documented in readline (instead deleting to the >>>>> beginning of >>>>> the line).? I notice that the there is zero in-command >>>>> documentation of >>>>> command-line editing -- not even a mention.? Independent from the >>>>> review >>>>> of this port, it seems we should have in-command documentation of >>>>> command editing -- even more so now that multiline editing is useful. >>>> >>>> This is about enhancing /help, right? I'll see what I can do. >>>> >>>>> >>>>> The JShell User Manual will also need a little edit in the History >>>>> Navigation section. >>>> >>>> Where is that? >>>> >>>> Thanks, >>>> ???? Jan >>>> >>>>> >>>>> -Robert >>>>> >>>>> >>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>> Hi, >>>>>> >>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>> JLine >>>>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>>>> editing and better UI on Windows (escape sequence support on >>>>>> Windows). >>>>>> As a consequence, this patch drops EditingHistory, as it does not >>>>>> seem >>>>>> to be needed anymore. >>>>>> >>>>>> JBS: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>> >>>>>> The full patch is here: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>> >>>>>> >>>>>> To make the changes more clear, I've split it into two: >>>>>> -replacement of existing JLine with the new on in >>>>>> jdk.internal.le, no >>>>>> changes to JLine code: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>> >>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>> j.u.l.Logger, >>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>> stream, adding unicode escapes to unicode characters, support for >>>>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>>>> substantial): >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>> >>>>>> Any feedback is welcome! >>>>>> >>>>>> Thanks, >>>>>> ??? Jan From robert.field at oracle.com Sun Dec 9 01:40:59 2018 From: robert.field at oracle.com (Robert Field) Date: Sat, 8 Dec 2018 17:40:59 -0800 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0C1FBA.2050602@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> Message-ID: <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> OK, here is my thinking on a /help keys entry.? Note: I'm using the representation for keys used by the User's Guide -- which I assume is the official tech pubs style -- seems we should be consistent; If we are however, the other /help entries should be brought into compliance (they seem to be all over the map already).? May make sense to spin this off as a separate bug, which I'd be happy to take on. Comments welcome --- __________________________________________________________________________________________________________________________ /help keys ========== The jshell tool provides line editing support to allow you to navigate within and edit snippets and commands. The current command/snippet can be edited, or prior commands/snippets can be retrieved from history, edited, and executed. This support is similar to readline/editline with simple emacs-like bindings.? There are also jshell tool specific key sequences. --- Line and history navigation --- Return ? Enters the current snippet Left-arrow or Ctrl+B ? Moves backward one character Right-arrow or Ctrl+F ? Moves forward one character Up-arrow or Ctrl+P ? Moves up one line, backward through history Down arrow or Ctrl+N ? Moves down one line, forward through history Ctrl+A ? Moves to the beginning of the line Ctrl+E ? Moves to the end of the line Meta+B ? Moves backward one word Meta+F ? Moves forward one word Ctrl+R ? Search backward through history --- Line and history basic editing --- Meta+Return or Ctrl+Return (depending on platform) ? Insert a new line in snippet Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U ? Undo edit - repeat to undo more edits Delete ? Deletes the character at or after the cursor, depending on the operating system Backspace ? Deletes the character before the cursor Ctrl+K ? Deletes the text from the cursor to the end of the line Meta+D ? Deletes the text from the cursor to the end of the word Ctrl+W ? Deletes the text from the cursor to the previous white space Ctrl+Y ? Pastes the most recently deleted text into the line Meta+Y ? After Ctrl+Y, Meta+Y cycles through previously deleted text Ctrl+X then Ctrl+K ? Delete whole snippet --- Shortcuts for jshell tool --- For details, see: /help shortcuts Tab ? Complete Java identifier or jshell command Shift+Tab then v ? Convert expression to variable declaration Shift+Tab then m ? Convert statement to method declaration Shift+Tab then i ? Add imports for this identifier --- More line and history editing --- Ctrl+L ? Clear screen and reprint snippet Ctrl+U ? Kill whole line Ctrl+T ? Transpose characters Ctrl+X then Ctrl+B ? Navigate to matching bracket, parenthesis, ... Ctrl+X then = ? Enter show current character position mode Ctrl+X then Ctrl+O ? Toggle overwrite characters vs insert characters Meta+C ? Capitalize word Meta+U ? Convert word to uppercase Meta+L ? Convert word to lowercase Meta+0 through Meta+9 then key ? Repeat the specified number of times Where, for example, "Ctrl+A" means hold down the control key and press A. Where "Meta" is "Alt" on many keyboards. Line editing support is derived from JLine 3. _______________________________________________________________________________ -Robert On 12/8/18 11:47 AM, Jan Lahoda wrote: > On 8.12.2018 20:39, Robert Field wrote: >> Thanks for updating. >> >> Good to have /help for line editing keys, however: >> ?? (1) The supported keys should be listed without requiring that the >> user knows or looks-up readline. More so, since only some readline keys >> are supposed. >> ?? (2) "/edit" is a command, so with this change, typing "/help edit" >> would give both the /edit and editing help -- which would be confusing. >> I suggest "/help keys", there are no "k" help items. > > Will do. > >> ?? (3) In jshell tool online docs the tool is spelled "jshell tool" >> I'd be happy to write up suggested text. > > Thanks, that would be very welcome! > >> >> As to the alternative patch: I understand the motivation, it would be >> nice to just use the natural "Enter" as new line. Unfortunately it's >> functionality is then overloaded.? I believe the alternative will be >> confusing and awkward: >> ?? (1) It breaks backward compatibility in user experience, Enter has >> always been accept/evaluate >> ?? (2) It would be very awkward and non-intuitive (particularly in a >> long multiline snippet) to have to navigate to the end of the snippet to >> accept. >> ??????? Note: must be the end both vertically and horizontally. >> ?? (3) It is inconsistent: Mid snippet Enter on one line does accept. >> However, on a continuation line (say after "int x =") it adds a new line >> instead. >> ?? (4) It doesn't solve the problem for the most common location for >> adding a new line, the end of snippet -- thus introducing more >> inconsistency. > > Ok. This was meant more as a backup in case there's no reasonable > shortcut we could use to add new lines. > > Thanks for the comments! > > Jan > >> >> Thanks, >> Robert >> >> >> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>> Hi, >>> >>> I've updated the patch to reflect the comments so far, the current >>> version is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>> Delta since the previous version is here for convenience: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>> >>> In this version, while editing a snippet, a new line can be added >>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>> Windows). >>> >>> >>> And alternative patch is here: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>> Delta: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>> >>> In the alternative version, Enter will only "confirm" multi-line >>> snippet when the cursor is at the end of the snippet, otherwise it >>> will add a new line (so that a special shortcut is not needed; but a >>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>> multi-line snippet.) >>> >>> The only difference between the .01 and .01a patches is the way they >>> allow to add new lines into the multi-line snippets. Other changes are >>> the same. >>> >>> Any feedback on this is welcome. >>> >>> Thanks! >>> >>> Jan >>> >>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>> Hi Robert, >>>> >>>> On 4.12.2018 23:59, Robert Field wrote: >>>>> I saw no issues with JShell tool and test portions of the webrev.? I >>>>> did >>>>> not review the nashorn changes. >>>> >>>> Thanks for looking at this! >>>> >>>>> >>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>> intuitive. >>>>> There is one issue, with the old mechanism, as horridly clunky as it >>>>> was, you could add new lines of code (a frequently needed >>>>> functionality). >>>>> Since is accept, I could find no way to add lines with this >>>>> JLine 3 version.? Thoughts? >>>> >>>> One possibility that comes to mind: pressing Enter inside the snippet >>>> would add a new line, Enter at the very end of a (complete) snippet >>>> would confirm that snippet. Could be fairly convenient/intuitive. What >>>> do you think? >>>> >>>>> >>>>> I looked into readline commands as an approach to addressing this, >>>>> found >>>>> nothing.? However, most readline commands worked. Ctrl-u however did >>>>> not >>>>> behave as documented in readline (instead deleting to the >>>>> beginning of >>>>> the line).? I notice that the there is zero in-command >>>>> documentation of >>>>> command-line editing -- not even a mention.? Independent from the >>>>> review >>>>> of this port, it seems we should have in-command documentation of >>>>> command editing -- even more so now that multiline editing is useful. >>>> >>>> This is about enhancing /help, right? I'll see what I can do. >>>> >>>>> >>>>> The JShell User Manual will also need a little edit in the History >>>>> Navigation section. >>>> >>>> Where is that? >>>> >>>> Thanks, >>>> ???? Jan >>>> >>>>> >>>>> -Robert >>>>> >>>>> >>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>> Hi, >>>>>> >>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>> JLine >>>>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>>>> editing and better UI on Windows (escape sequence support on >>>>>> Windows). >>>>>> As a consequence, this patch drops EditingHistory, as it does not >>>>>> seem >>>>>> to be needed anymore. >>>>>> >>>>>> JBS: >>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>> >>>>>> The full patch is here: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>> >>>>>> >>>>>> To make the changes more clear, I've split it into two: >>>>>> -replacement of existing JLine with the new on in >>>>>> jdk.internal.le, no >>>>>> changes to JLine code: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>> >>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>> j.u.l.Logger, >>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>> stream, adding unicode escapes to unicode characters, support for >>>>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>>>> substantial): >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>> >>>>>> Any feedback is welcome! >>>>>> >>>>>> Thanks, >>>>>> ??? Jan From jan.lahoda at oracle.com Sun Dec 9 14:36:22 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Sun, 9 Dec 2018 15:36:22 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> Message-ID: <5C0D2866.6020105@oracle.com> Hi Robert, On 9.12.2018 02:40, Robert Field wrote: > OK, here is my thinking on a /help keys entry. Note: I'm using the I think this looks great! > representation for keys used by the User's Guide -- which I assume is > the official tech pubs style -- seems we should be consistent; If we are > however, the other /help entries should be brought into compliance (they > seem to be all over the map already). May make sense to spin this off > as a separate bug, which I'd be happy to take on. I'm happy with a separate bug, if you prefer/are OK with that. Or I can incorporate the text into upgrade patch, whichever you prefer. I've updated my current patch with only a rename "editing" -> "keys" and the fix to the jshell tool name: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ Delta from last: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ Jan > > Comments welcome --- > > __________________________________________________________________________________________________________________________ > > > /help keys > ========== > > The jshell tool provides line editing support to allow you to navigate > within and edit snippets and commands. The current command/snippet can > be edited, or prior commands/snippets can be retrieved from history, > edited, and executed. This support is similar to readline/editline with > simple emacs-like bindings. There are also jshell tool specific key > sequences. > > --- Line and history navigation --- > > Return > Enters the current snippet > Left-arrow or Ctrl+B > Moves backward one character > Right-arrow or Ctrl+F > Moves forward one character > Up-arrow or Ctrl+P > Moves up one line, backward through history > Down arrow or Ctrl+N > Moves down one line, forward through history > Ctrl+A > Moves to the beginning of the line > Ctrl+E > Moves to the end of the line > Meta+B > Moves backward one word > Meta+F > Moves forward one word > Ctrl+R > Search backward through history > > > --- Line and history basic editing --- > > Meta+Return or Ctrl+Return (depending on platform) > Insert a new line in snippet > Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U > Undo edit - repeat to undo more edits > Delete > Deletes the character at or after the cursor, depending on the > operating system > Backspace > Deletes the character before the cursor > Ctrl+K > Deletes the text from the cursor to the end of the line > Meta+D > Deletes the text from the cursor to the end of the word > Ctrl+W > Deletes the text from the cursor to the previous white space > Ctrl+Y > Pastes the most recently deleted text into the line > Meta+Y > After Ctrl+Y, Meta+Y cycles through previously deleted text > Ctrl+X then Ctrl+K > Delete whole snippet > > > --- Shortcuts for jshell tool --- > > For details, see: /help shortcuts > > Tab > Complete Java identifier or jshell command > Shift+Tab then v > Convert expression to variable declaration > Shift+Tab then m > Convert statement to method declaration > Shift+Tab then i > Add imports for this identifier > > > --- More line and history editing --- > > Ctrl+L > Clear screen and reprint snippet > Ctrl+U > Kill whole line > Ctrl+T > Transpose characters > Ctrl+X then Ctrl+B > Navigate to matching bracket, parenthesis, ... > Ctrl+X then = > Enter show current character position mode > Ctrl+X then Ctrl+O > Toggle overwrite characters vs insert characters > Meta+C > Capitalize word > Meta+U > Convert word to uppercase > Meta+L > Convert word to lowercase > Meta+0 through Meta+9 then key > Repeat the specified number of times > > Where, for example, "Ctrl+A" means hold down the control key and press A. > Where "Meta" is "Alt" on many keyboards. > Line editing support is derived from JLine 3. > > _______________________________________________________________________________ > > > > -Robert > > > > On 12/8/18 11:47 AM, Jan Lahoda wrote: >> On 8.12.2018 20:39, Robert Field wrote: >>> Thanks for updating. >>> >>> Good to have /help for line editing keys, however: >>> (1) The supported keys should be listed without requiring that the >>> user knows or looks-up readline. More so, since only some readline keys >>> are supposed. >>> (2) "/edit" is a command, so with this change, typing "/help edit" >>> would give both the /edit and editing help -- which would be confusing. >>> I suggest "/help keys", there are no "k" help items. >> >> Will do. >> >>> (3) In jshell tool online docs the tool is spelled "jshell tool" >>> I'd be happy to write up suggested text. >> >> Thanks, that would be very welcome! >> >>> >>> As to the alternative patch: I understand the motivation, it would be >>> nice to just use the natural "Enter" as new line. Unfortunately it's >>> functionality is then overloaded. I believe the alternative will be >>> confusing and awkward: >>> (1) It breaks backward compatibility in user experience, Enter has >>> always been accept/evaluate >>> (2) It would be very awkward and non-intuitive (particularly in a >>> long multiline snippet) to have to navigate to the end of the snippet to >>> accept. >>> Note: must be the end both vertically and horizontally. >>> (3) It is inconsistent: Mid snippet Enter on one line does accept. >>> However, on a continuation line (say after "int x =") it adds a new line >>> instead. >>> (4) It doesn't solve the problem for the most common location for >>> adding a new line, the end of snippet -- thus introducing more >>> inconsistency. >> >> Ok. This was meant more as a backup in case there's no reasonable >> shortcut we could use to add new lines. >> >> Thanks for the comments! >> >> Jan >> >>> >>> Thanks, >>> Robert >>> >>> >>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>> Hi, >>>> >>>> I've updated the patch to reflect the comments so far, the current >>>> version is here: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>> Delta since the previous version is here for convenience: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>> >>>> In this version, while editing a snippet, a new line can be added >>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>> Windows). >>>> >>>> >>>> And alternative patch is here: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>> Delta: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>> >>>> In the alternative version, Enter will only "confirm" multi-line >>>> snippet when the cursor is at the end of the snippet, otherwise it >>>> will add a new line (so that a special shortcut is not needed; but a >>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>> multi-line snippet.) >>>> >>>> The only difference between the .01 and .01a patches is the way they >>>> allow to add new lines into the multi-line snippets. Other changes are >>>> the same. >>>> >>>> Any feedback on this is welcome. >>>> >>>> Thanks! >>>> >>>> Jan >>>> >>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>> Hi Robert, >>>>> >>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>> I saw no issues with JShell tool and test portions of the webrev. I >>>>>> did >>>>>> not review the nashorn changes. >>>>> >>>>> Thanks for looking at this! >>>>> >>>>>> >>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>> intuitive. >>>>>> There is one issue, with the old mechanism, as horridly clunky as it >>>>>> was, you could add new lines of code (a frequently needed >>>>>> functionality). >>>>>> Since is accept, I could find no way to add lines with this >>>>>> JLine 3 version. Thoughts? >>>>> >>>>> One possibility that comes to mind: pressing Enter inside the snippet >>>>> would add a new line, Enter at the very end of a (complete) snippet >>>>> would confirm that snippet. Could be fairly convenient/intuitive. What >>>>> do you think? >>>>> >>>>>> >>>>>> I looked into readline commands as an approach to addressing this, >>>>>> found >>>>>> nothing. However, most readline commands worked. Ctrl-u however did >>>>>> not >>>>>> behave as documented in readline (instead deleting to the >>>>>> beginning of >>>>>> the line). I notice that the there is zero in-command >>>>>> documentation of >>>>>> command-line editing -- not even a mention. Independent from the >>>>>> review >>>>>> of this port, it seems we should have in-command documentation of >>>>>> command editing -- even more so now that multiline editing is useful. >>>>> >>>>> This is about enhancing /help, right? I'll see what I can do. >>>>> >>>>>> >>>>>> The JShell User Manual will also need a little edit in the History >>>>>> Navigation section. >>>>> >>>>> Where is that? >>>>> >>>>> Thanks, >>>>> Jan >>>>> >>>>>> >>>>>> -Robert >>>>>> >>>>>> >>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>> JLine >>>>>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>> Windows). >>>>>>> As a consequence, this patch drops EditingHistory, as it does not >>>>>>> seem >>>>>>> to be needed anymore. >>>>>>> >>>>>>> JBS: >>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>> >>>>>>> The full patch is here: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>> >>>>>>> >>>>>>> To make the changes more clear, I've split it into two: >>>>>>> -replacement of existing JLine with the new on in >>>>>>> jdk.internal.le, no >>>>>>> changes to JLine code: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>> >>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>> j.u.l.Logger, >>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>> stream, adding unicode escapes to unicode characters, support for >>>>>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>>>>> substantial): >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>> >>>>>>> Any feedback is welcome! >>>>>>> >>>>>>> Thanks, >>>>>>> Jan From robert.field at oracle.com Sun Dec 9 15:40:05 2018 From: robert.field at oracle.com (Robert Field) Date: Sun, 09 Dec 2018 07:40:05 -0800 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0D2866.6020105@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> Message-ID: <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Ok. Go ahead and incorporate the text. I'll make a separate bug to sync the representation of keys in the other help entries. Robert On December 9, 2018 6:36:26 AM Jan Lahoda wrote: > Hi Robert, > > On 9.12.2018 02:40, Robert Field wrote: >> OK, here is my thinking on a /help keys entry. Note: I'm using the > > I think this looks great! > >> representation for keys used by the User's Guide -- which I assume is >> the official tech pubs style -- seems we should be consistent; If we are >> however, the other /help entries should be brought into compliance (they >> seem to be all over the map already). May make sense to spin this off >> as a separate bug, which I'd be happy to take on. > > I'm happy with a separate bug, if you prefer/are OK with that. Or I can > incorporate the text into upgrade patch, whichever you prefer. > > I've updated my current patch with only a rename "editing" -> "keys" and > the fix to the jshell tool name: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ > > Delta from last: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ > > Jan > >> >> Comments welcome --- >> >> __________________________________________________________________________________________________________________________ >> >> >> /help keys >> ========== >> >> The jshell tool provides line editing support to allow you to navigate >> within and edit snippets and commands. The current command/snippet can >> be edited, or prior commands/snippets can be retrieved from history, >> edited, and executed. This support is similar to readline/editline with >> simple emacs-like bindings. There are also jshell tool specific key >> sequences. >> >> --- Line and history navigation --- >> >> Return >> Enters the current snippet >> Left-arrow or Ctrl+B >> Moves backward one character >> Right-arrow or Ctrl+F >> Moves forward one character >> Up-arrow or Ctrl+P >> Moves up one line, backward through history >> Down arrow or Ctrl+N >> Moves down one line, forward through history >> Ctrl+A >> Moves to the beginning of the line >> Ctrl+E >> Moves to the end of the line >> Meta+B >> Moves backward one word >> Meta+F >> Moves forward one word >> Ctrl+R >> Search backward through history >> >> >> --- Line and history basic editing --- >> >> Meta+Return or Ctrl+Return (depending on platform) >> Insert a new line in snippet >> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >> Undo edit - repeat to undo more edits >> Delete >> Deletes the character at or after the cursor, depending on the >> operating system >> Backspace >> Deletes the character before the cursor >> Ctrl+K >> Deletes the text from the cursor to the end of the line >> Meta+D >> Deletes the text from the cursor to the end of the word >> Ctrl+W >> Deletes the text from the cursor to the previous white space >> Ctrl+Y >> Pastes the most recently deleted text into the line >> Meta+Y >> After Ctrl+Y, Meta+Y cycles through previously deleted text >> Ctrl+X then Ctrl+K >> Delete whole snippet >> >> >> --- Shortcuts for jshell tool --- >> >> For details, see: /help shortcuts >> >> Tab >> Complete Java identifier or jshell command >> Shift+Tab then v >> Convert expression to variable declaration >> Shift+Tab then m >> Convert statement to method declaration >> Shift+Tab then i >> Add imports for this identifier >> >> >> --- More line and history editing --- >> >> Ctrl+L >> Clear screen and reprint snippet >> Ctrl+U >> Kill whole line >> Ctrl+T >> Transpose characters >> Ctrl+X then Ctrl+B >> Navigate to matching bracket, parenthesis, ... >> Ctrl+X then = >> Enter show current character position mode >> Ctrl+X then Ctrl+O >> Toggle overwrite characters vs insert characters >> Meta+C >> Capitalize word >> Meta+U >> Convert word to uppercase >> Meta+L >> Convert word to lowercase >> Meta+0 through Meta+9 then key >> Repeat the specified number of times >> >> Where, for example, "Ctrl+A" means hold down the control key and press A. >> Where "Meta" is "Alt" on many keyboards. >> Line editing support is derived from JLine 3. >> >> _______________________________________________________________________________ >> >> >> >> -Robert >> >> >> >> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>> On 8.12.2018 20:39, Robert Field wrote: >>>> Thanks for updating. >>>> >>>> Good to have /help for line editing keys, however: >>>> (1) The supported keys should be listed without requiring that the >>>> user knows or looks-up readline. More so, since only some readline keys >>>> are supposed. >>>> (2) "/edit" is a command, so with this change, typing "/help edit" >>>> would give both the /edit and editing help -- which would be confusing. >>>> I suggest "/help keys", there are no "k" help items. >>> >>> Will do. >>> >>>> (3) In jshell tool online docs the tool is spelled "jshell tool" >>>> I'd be happy to write up suggested text. >>> >>> Thanks, that would be very welcome! >>> >>>> >>>> As to the alternative patch: I understand the motivation, it would be >>>> nice to just use the natural "Enter" as new line. Unfortunately it's >>>> functionality is then overloaded. I believe the alternative will be >>>> confusing and awkward: >>>> (1) It breaks backward compatibility in user experience, Enter has >>>> always been accept/evaluate >>>> (2) It would be very awkward and non-intuitive (particularly in a >>>> long multiline snippet) to have to navigate to the end of the snippet to >>>> accept. >>>> Note: must be the end both vertically and horizontally. >>>> (3) It is inconsistent: Mid snippet Enter on one line does accept. >>>> However, on a continuation line (say after "int x =") it adds a new line >>>> instead. >>>> (4) It doesn't solve the problem for the most common location for >>>> adding a new line, the end of snippet -- thus introducing more >>>> inconsistency. >>> >>> Ok. This was meant more as a backup in case there's no reasonable >>> shortcut we could use to add new lines. >>> >>> Thanks for the comments! >>> >>> Jan >>> >>>> >>>> Thanks, >>>> Robert >>>> >>>> >>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>> Hi, >>>>> >>>>> I've updated the patch to reflect the comments so far, the current >>>>> version is here: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>> Delta since the previous version is here for convenience: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>> >>>>> In this version, while editing a snippet, a new line can be added >>>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>>> Windows). >>>>> >>>>> >>>>> And alternative patch is here: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>> Delta: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>> >>>>> In the alternative version, Enter will only "confirm" multi-line >>>>> snippet when the cursor is at the end of the snippet, otherwise it >>>>> will add a new line (so that a special shortcut is not needed; but a >>>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>>> multi-line snippet.) >>>>> >>>>> The only difference between the .01 and .01a patches is the way they >>>>> allow to add new lines into the multi-line snippets. Other changes are >>>>> the same. >>>>> >>>>> Any feedback on this is welcome. >>>>> >>>>> Thanks! >>>>> >>>>> Jan >>>>> >>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>> Hi Robert, >>>>>> >>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>> I saw no issues with JShell tool and test portions of the webrev. I >>>>>>> did >>>>>>> not review the nashorn changes. >>>>>> >>>>>> Thanks for looking at this! >>>>>> >>>>>>> >>>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>>> intuitive. >>>>>>> There is one issue, with the old mechanism, as horridly clunky as it >>>>>>> was, you could add new lines of code (a frequently needed >>>>>>> functionality). >>>>>>> Since is accept, I could find no way to add lines with this >>>>>>> JLine 3 version. Thoughts? >>>>>> >>>>>> One possibility that comes to mind: pressing Enter inside the snippet >>>>>> would add a new line, Enter at the very end of a (complete) snippet >>>>>> would confirm that snippet. Could be fairly convenient/intuitive. What >>>>>> do you think? >>>>>> >>>>>>> >>>>>>> I looked into readline commands as an approach to addressing this, >>>>>>> found >>>>>>> nothing. However, most readline commands worked. Ctrl-u however did >>>>>>> not >>>>>>> behave as documented in readline (instead deleting to the >>>>>>> beginning of >>>>>>> the line). I notice that the there is zero in-command >>>>>>> documentation of >>>>>>> command-line editing -- not even a mention. Independent from the >>>>>>> review >>>>>>> of this port, it seems we should have in-command documentation of >>>>>>> command editing -- even more so now that multiline editing is useful. >>>>>> >>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>> >>>>>>> >>>>>>> The JShell User Manual will also need a little edit in the History >>>>>>> Navigation section. >>>>>> >>>>>> Where is that? >>>>>> >>>>>> Thanks, >>>>>> Jan >>>>>> >>>>>>> >>>>>>> -Robert >>>>>>> >>>>>>> >>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>>> JLine >>>>>>>> 3.9.0. Two notable advantages of this version is multi-line snippet >>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>> Windows). >>>>>>>> As a consequence, this patch drops EditingHistory, as it does not >>>>>>>> seem >>>>>>>> to be needed anymore. >>>>>>>> >>>>>>>> JBS: >>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>> >>>>>>>> The full patch is here: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>> >>>>>>>> >>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>> -replacement of existing JLine with the new on in >>>>>>>> jdk.internal.le, no >>>>>>>> changes to JLine code: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>> >>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>> j.u.l.Logger, >>>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>>> stream, adding unicode escapes to unicode characters, support for >>>>>>>> Windows without JNA), adjustments to JShell and jjs (unfortunately, >>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes are >>>>>>>> substantial): >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>> >>>>>>>> Any feedback is welcome! >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Jan From jan.lahoda at oracle.com Sun Dec 9 22:45:46 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Sun, 9 Dec 2018 23:45:46 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> Message-ID: <5C0D9B1A.3080409@oracle.com> On 9.12.2018 16:40, Robert Field wrote: > Ok. Go ahead and incorporate the text. I'll make a separate bug to sync > the representation of keys in the other help entries. An updated patch (with your text): http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ Delta from previous patch: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ Thanks for the comments and for the text! Any feedback is welcome. Thanks, Jan > > Robert > > > On December 9, 2018 6:36:26 AM Jan Lahoda wrote: > >> Hi Robert, >> >> On 9.12.2018 02:40, Robert Field wrote: >>> OK, here is my thinking on a /help keys entry. Note: I'm using the >> >> I think this looks great! >> >>> representation for keys used by the User's Guide -- which I assume is >>> the official tech pubs style -- seems we should be consistent; If we are >>> however, the other /help entries should be brought into compliance (they >>> seem to be all over the map already). May make sense to spin this off >>> as a separate bug, which I'd be happy to take on. >> >> I'm happy with a separate bug, if you prefer/are OK with that. Or I can >> incorporate the text into upgrade patch, whichever you prefer. >> >> I've updated my current patch with only a rename "editing" -> "keys" and >> the fix to the jshell tool name: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >> >> Delta from last: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >> >> Jan >> >>> >>> Comments welcome --- >>> >>> __________________________________________________________________________________________________________________________ >>> >>> >>> >>> /help keys >>> ========== >>> >>> The jshell tool provides line editing support to allow you to navigate >>> within and edit snippets and commands. The current command/snippet can >>> be edited, or prior commands/snippets can be retrieved from history, >>> edited, and executed. This support is similar to readline/editline with >>> simple emacs-like bindings. There are also jshell tool specific key >>> sequences. >>> >>> --- Line and history navigation --- >>> >>> Return >>> Enters the current snippet >>> Left-arrow or Ctrl+B >>> Moves backward one character >>> Right-arrow or Ctrl+F >>> Moves forward one character >>> Up-arrow or Ctrl+P >>> Moves up one line, backward through history >>> Down arrow or Ctrl+N >>> Moves down one line, forward through history >>> Ctrl+A >>> Moves to the beginning of the line >>> Ctrl+E >>> Moves to the end of the line >>> Meta+B >>> Moves backward one word >>> Meta+F >>> Moves forward one word >>> Ctrl+R >>> Search backward through history >>> >>> >>> --- Line and history basic editing --- >>> >>> Meta+Return or Ctrl+Return (depending on platform) >>> Insert a new line in snippet >>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>> Undo edit - repeat to undo more edits >>> Delete >>> Deletes the character at or after the cursor, depending on the >>> operating system >>> Backspace >>> Deletes the character before the cursor >>> Ctrl+K >>> Deletes the text from the cursor to the end of the line >>> Meta+D >>> Deletes the text from the cursor to the end of the word >>> Ctrl+W >>> Deletes the text from the cursor to the previous white space >>> Ctrl+Y >>> Pastes the most recently deleted text into the line >>> Meta+Y >>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>> Ctrl+X then Ctrl+K >>> Delete whole snippet >>> >>> >>> --- Shortcuts for jshell tool --- >>> >>> For details, see: /help shortcuts >>> >>> Tab >>> Complete Java identifier or jshell command >>> Shift+Tab then v >>> Convert expression to variable declaration >>> Shift+Tab then m >>> Convert statement to method declaration >>> Shift+Tab then i >>> Add imports for this identifier >>> >>> >>> --- More line and history editing --- >>> >>> Ctrl+L >>> Clear screen and reprint snippet >>> Ctrl+U >>> Kill whole line >>> Ctrl+T >>> Transpose characters >>> Ctrl+X then Ctrl+B >>> Navigate to matching bracket, parenthesis, ... >>> Ctrl+X then = >>> Enter show current character position mode >>> Ctrl+X then Ctrl+O >>> Toggle overwrite characters vs insert characters >>> Meta+C >>> Capitalize word >>> Meta+U >>> Convert word to uppercase >>> Meta+L >>> Convert word to lowercase >>> Meta+0 through Meta+9 then key >>> Repeat the specified number of times >>> >>> Where, for example, "Ctrl+A" means hold down the control key and >>> press A. >>> Where "Meta" is "Alt" on many keyboards. >>> Line editing support is derived from JLine 3. >>> >>> _______________________________________________________________________________ >>> >>> >>> >>> >>> -Robert >>> >>> >>> >>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>> On 8.12.2018 20:39, Robert Field wrote: >>>>> Thanks for updating. >>>>> >>>>> Good to have /help for line editing keys, however: >>>>> (1) The supported keys should be listed without requiring that the >>>>> user knows or looks-up readline. More so, since only some readline >>>>> keys >>>>> are supposed. >>>>> (2) "/edit" is a command, so with this change, typing "/help edit" >>>>> would give both the /edit and editing help -- which would be >>>>> confusing. >>>>> I suggest "/help keys", there are no "k" help items. >>>> >>>> Will do. >>>> >>>>> (3) In jshell tool online docs the tool is spelled "jshell tool" >>>>> I'd be happy to write up suggested text. >>>> >>>> Thanks, that would be very welcome! >>>> >>>>> >>>>> As to the alternative patch: I understand the motivation, it would be >>>>> nice to just use the natural "Enter" as new line. Unfortunately it's >>>>> functionality is then overloaded. I believe the alternative will be >>>>> confusing and awkward: >>>>> (1) It breaks backward compatibility in user experience, Enter has >>>>> always been accept/evaluate >>>>> (2) It would be very awkward and non-intuitive (particularly in a >>>>> long multiline snippet) to have to navigate to the end of the >>>>> snippet to >>>>> accept. >>>>> Note: must be the end both vertically and horizontally. >>>>> (3) It is inconsistent: Mid snippet Enter on one line does accept. >>>>> However, on a continuation line (say after "int x =") it adds a new >>>>> line >>>>> instead. >>>>> (4) It doesn't solve the problem for the most common location for >>>>> adding a new line, the end of snippet -- thus introducing more >>>>> inconsistency. >>>> >>>> Ok. This was meant more as a backup in case there's no reasonable >>>> shortcut we could use to add new lines. >>>> >>>> Thanks for the comments! >>>> >>>> Jan >>>> >>>>> >>>>> Thanks, >>>>> Robert >>>>> >>>>> >>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>> Hi, >>>>>> >>>>>> I've updated the patch to reflect the comments so far, the current >>>>>> version is here: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>> Delta since the previous version is here for convenience: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>> >>>>>> In this version, while editing a snippet, a new line can be added >>>>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>>>> Windows). >>>>>> >>>>>> >>>>>> And alternative patch is here: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>> Delta: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>> >>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>> snippet when the cursor is at the end of the snippet, otherwise it >>>>>> will add a new line (so that a special shortcut is not needed; but a >>>>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>>>> multi-line snippet.) >>>>>> >>>>>> The only difference between the .01 and .01a patches is the way they >>>>>> allow to add new lines into the multi-line snippets. Other changes >>>>>> are >>>>>> the same. >>>>>> >>>>>> Any feedback on this is welcome. >>>>>> >>>>>> Thanks! >>>>>> >>>>>> Jan >>>>>> >>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>> Hi Robert, >>>>>>> >>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>> webrev. I >>>>>>>> did >>>>>>>> not review the nashorn changes. >>>>>>> >>>>>>> Thanks for looking at this! >>>>>>> >>>>>>>> >>>>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>>>> intuitive. >>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>> as it >>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>> functionality). >>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>> this >>>>>>>> JLine 3 version. Thoughts? >>>>>>> >>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>> snippet >>>>>>> would add a new line, Enter at the very end of a (complete) snippet >>>>>>> would confirm that snippet. Could be fairly convenient/intuitive. >>>>>>> What >>>>>>> do you think? >>>>>>> >>>>>>>> >>>>>>>> I looked into readline commands as an approach to addressing this, >>>>>>>> found >>>>>>>> nothing. However, most readline commands worked. Ctrl-u however >>>>>>>> did >>>>>>>> not >>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>> beginning of >>>>>>>> the line). I notice that the there is zero in-command >>>>>>>> documentation of >>>>>>>> command-line editing -- not even a mention. Independent from the >>>>>>>> review >>>>>>>> of this port, it seems we should have in-command documentation of >>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>> useful. >>>>>>> >>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>> >>>>>>>> >>>>>>>> The JShell User Manual will also need a little edit in the History >>>>>>>> Navigation section. >>>>>>> >>>>>>> Where is that? >>>>>>> >>>>>>> Thanks, >>>>>>> Jan >>>>>>> >>>>>>>> >>>>>>>> -Robert >>>>>>>> >>>>>>>> >>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>>>> JLine >>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>> snippet >>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>> Windows). >>>>>>>>> As a consequence, this patch drops EditingHistory, as it does not >>>>>>>>> seem >>>>>>>>> to be needed anymore. >>>>>>>>> >>>>>>>>> JBS: >>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>> >>>>>>>>> The full patch is here: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>> >>>>>>>>> >>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>> jdk.internal.le, no >>>>>>>>> changes to JLine code: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>> >>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>> j.u.l.Logger, >>>>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>>>> stream, adding unicode escapes to unicode characters, support for >>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>> (unfortunately, >>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes >>>>>>>>> are >>>>>>>>> substantial): >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>> >>>>>>>>> Any feedback is welcome! >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Jan > > > From robert.field at oracle.com Sun Dec 9 23:08:28 2018 From: robert.field at oracle.com (Robert Field) Date: Sun, 9 Dec 2018 15:08:28 -0800 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0D9B1A.3080409@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> Message-ID: <203ab488-dba6-dbd7-2de5-10e847bd581f@oracle.com> Thumbs up! -Robert On 12/9/18 2:45 PM, Jan Lahoda wrote: > On 9.12.2018 16:40, Robert Field wrote: >> Ok. Go ahead and incorporate the text. I'll make a separate bug to sync >> the representation of keys in the other help entries. > > An updated patch (with your text): > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ > Delta from previous patch: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ > > Thanks for the comments and for the text! Any feedback is welcome. > > Thanks, > ??? Jan > > >> >> Robert >> >> >> On December 9, 2018 6:36:26 AM Jan Lahoda wrote: >> >>> Hi Robert, >>> >>> On 9.12.2018 02:40, Robert Field wrote: >>>> OK, here is my thinking on a /help keys entry.? Note: I'm using the >>> >>> I think this looks great! >>> >>>> representation for keys used by the User's Guide -- which I assume is >>>> the official tech pubs style -- seems we should be consistent; If >>>> we are >>>> however, the other /help entries should be brought into compliance >>>> (they >>>> seem to be all over the map already).? May make sense to spin this off >>>> as a separate bug, which I'd be happy to take on. >>> >>> I'm happy with a separate bug, if you prefer/are OK with that. Or I can >>> incorporate the text into upgrade patch, whichever you prefer. >>> >>> I've updated my current patch with only a rename "editing" -> "keys" >>> and >>> the fix to the jshell tool name: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>> >>> Delta from last: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>> >>> Jan >>> >>>> >>>> Comments welcome --- >>>> >>>> __________________________________________________________________________________________________________________________ >>>> >>>> >>>> >>>> >>>> /help keys >>>> ========== >>>> >>>> The jshell tool provides line editing support to allow you to navigate >>>> within and edit snippets and commands. The current command/snippet can >>>> be edited, or prior commands/snippets can be retrieved from history, >>>> edited, and executed. This support is similar to readline/editline >>>> with >>>> simple emacs-like bindings.? There are also jshell tool specific key >>>> sequences. >>>> >>>> --- Line and history navigation --- >>>> >>>> Return >>>> ?? Enters the current snippet >>>> Left-arrow or Ctrl+B >>>> ?? Moves backward one character >>>> Right-arrow or Ctrl+F >>>> ?? Moves forward one character >>>> Up-arrow or Ctrl+P >>>> ?? Moves up one line, backward through history >>>> Down arrow or Ctrl+N >>>> ?? Moves down one line, forward through history >>>> Ctrl+A >>>> ?? Moves to the beginning of the line >>>> Ctrl+E >>>> ?? Moves to the end of the line >>>> Meta+B >>>> ?? Moves backward one word >>>> Meta+F >>>> ?? Moves forward one word >>>> Ctrl+R >>>> ?? Search backward through history >>>> >>>> >>>> --- Line and history basic editing --- >>>> >>>> Meta+Return or Ctrl+Return (depending on platform) >>>> ?? Insert a new line in snippet >>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>> ?? Undo edit - repeat to undo more edits >>>> Delete >>>> ?? Deletes the character at or after the cursor, depending on the >>>> operating system >>>> Backspace >>>> ?? Deletes the character before the cursor >>>> Ctrl+K >>>> ?? Deletes the text from the cursor to the end of the line >>>> Meta+D >>>> ?? Deletes the text from the cursor to the end of the word >>>> Ctrl+W >>>> ?? Deletes the text from the cursor to the previous white space >>>> Ctrl+Y >>>> ?? Pastes the most recently deleted text into the line >>>> Meta+Y >>>> ?? After Ctrl+Y, Meta+Y cycles through previously deleted text >>>> Ctrl+X then Ctrl+K >>>> ?? Delete whole snippet >>>> >>>> >>>> --- Shortcuts for jshell tool --- >>>> >>>> For details, see: /help shortcuts >>>> >>>> Tab >>>> ?? Complete Java identifier or jshell command >>>> Shift+Tab then v >>>> ?? Convert expression to variable declaration >>>> Shift+Tab then m >>>> ?? Convert statement to method declaration >>>> Shift+Tab then i >>>> ?? Add imports for this identifier >>>> >>>> >>>> --- More line and history editing --- >>>> >>>> Ctrl+L >>>> ?? Clear screen and reprint snippet >>>> Ctrl+U >>>> ?? Kill whole line >>>> Ctrl+T >>>> ?? Transpose characters >>>> Ctrl+X then Ctrl+B >>>> ?? Navigate to matching bracket, parenthesis, ... >>>> Ctrl+X then = >>>> ?? Enter show current character position mode >>>> Ctrl+X then Ctrl+O >>>> ?? Toggle overwrite characters vs insert characters >>>> Meta+C >>>> ?? Capitalize word >>>> Meta+U >>>> ?? Convert word to uppercase >>>> Meta+L >>>> ?? Convert word to lowercase >>>> Meta+0 through Meta+9 then key >>>> ?? Repeat the specified number of times >>>> >>>> Where, for example, "Ctrl+A" means hold down the control key and >>>> press A. >>>> Where "Meta" is "Alt" on many keyboards. >>>> Line editing support is derived from JLine 3. >>>> >>>> _______________________________________________________________________________ >>>> >>>> >>>> >>>> >>>> >>>> -Robert >>>> >>>> >>>> >>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>> Thanks for updating. >>>>>> >>>>>> Good to have /help for line editing keys, however: >>>>>> ?? (1) The supported keys should be listed without requiring that >>>>>> the >>>>>> user knows or looks-up readline. More so, since only some readline >>>>>> keys >>>>>> are supposed. >>>>>> ?? (2) "/edit" is a command, so with this change, typing "/help >>>>>> edit" >>>>>> would give both the /edit and editing help -- which would be >>>>>> confusing. >>>>>> I suggest "/help keys", there are no "k" help items. >>>>> >>>>> Will do. >>>>> >>>>>> ?? (3) In jshell tool online docs the tool is spelled "jshell tool" >>>>>> I'd be happy to write up suggested text. >>>>> >>>>> Thanks, that would be very welcome! >>>>> >>>>>> >>>>>> As to the alternative patch: I understand the motivation, it >>>>>> would be >>>>>> nice to just use the natural "Enter" as new line. Unfortunately it's >>>>>> functionality is then overloaded.? I believe the alternative will be >>>>>> confusing and awkward: >>>>>> ?? (1) It breaks backward compatibility in user experience, Enter >>>>>> has >>>>>> always been accept/evaluate >>>>>> ?? (2) It would be very awkward and non-intuitive (particularly in a >>>>>> long multiline snippet) to have to navigate to the end of the >>>>>> snippet to >>>>>> accept. >>>>>> ??????? Note: must be the end both vertically and horizontally. >>>>>> ?? (3) It is inconsistent: Mid snippet Enter on one line does >>>>>> accept. >>>>>> However, on a continuation line (say after "int x =") it adds a new >>>>>> line >>>>>> instead. >>>>>> ?? (4) It doesn't solve the problem for the most common location for >>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>> inconsistency. >>>>> >>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>> shortcut we could use to add new lines. >>>>> >>>>> Thanks for the comments! >>>>> >>>>> Jan >>>>> >>>>>> >>>>>> Thanks, >>>>>> Robert >>>>>> >>>>>> >>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I've updated the patch to reflect the comments so far, the current >>>>>>> version is here: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>> Delta since the previous version is here for convenience: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>> >>>>>>> In this version, while editing a snippet, a new line can be added >>>>>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>>>>> Windows). >>>>>>> >>>>>>> >>>>>>> And alternative patch is here: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>> Delta: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>> >>>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>>> snippet when the cursor is at the end of the snippet, otherwise it >>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>> but a >>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>>>>> multi-line snippet.) >>>>>>> >>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>> they >>>>>>> allow to add new lines into the multi-line snippets. Other changes >>>>>>> are >>>>>>> the same. >>>>>>> >>>>>>> Any feedback on this is welcome. >>>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> Jan >>>>>>> >>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>> Hi Robert, >>>>>>>> >>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>> webrev.? I >>>>>>>>> did >>>>>>>>> not review the nashorn changes. >>>>>>>> >>>>>>>> Thanks for looking at this! >>>>>>>> >>>>>>>>> >>>>>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>>>>> intuitive. >>>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>>> as it >>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>> functionality). >>>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>>> this >>>>>>>>> JLine 3 version.? Thoughts? >>>>>>>> >>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>> snippet >>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>> snippet >>>>>>>> would confirm that snippet. Could be fairly convenient/intuitive. >>>>>>>> What >>>>>>>> do you think? >>>>>>>> >>>>>>>>> >>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>> this, >>>>>>>>> found >>>>>>>>> nothing.? However, most readline commands worked. Ctrl-u however >>>>>>>>> did >>>>>>>>> not >>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>> beginning of >>>>>>>>> the line).? I notice that the there is zero in-command >>>>>>>>> documentation of >>>>>>>>> command-line editing -- not even a mention. Independent from the >>>>>>>>> review >>>>>>>>> of this port, it seems we should have in-command documentation of >>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>> useful. >>>>>>>> >>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>> >>>>>>>>> >>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>> History >>>>>>>>> Navigation section. >>>>>>>> >>>>>>>> Where is that? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> ???? Jan >>>>>>>> >>>>>>>>> >>>>>>>>> -Robert >>>>>>>>> >>>>>>>>> >>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>>>>> JLine >>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>> snippet >>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>> Windows). >>>>>>>>>> As a consequence, this patch drops EditingHistory, as it does >>>>>>>>>> not >>>>>>>>>> seem >>>>>>>>>> to be needed anymore. >>>>>>>>>> >>>>>>>>>> JBS: >>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>> >>>>>>>>>> The full patch is here: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>> jdk.internal.le, no >>>>>>>>>> changes to JLine code: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>> >>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>> j.u.l.Logger, >>>>>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>>>>> stream, adding unicode escapes to unicode characters, support >>>>>>>>>> for >>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>> (unfortunately, >>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes >>>>>>>>>> are >>>>>>>>>> substantial): >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>> >>>>>>>>>> Any feedback is welcome! >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> ??? Jan >> >> >> From sundararajan.athijegannathan at oracle.com Mon Dec 10 05:20:31 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Mon, 10 Dec 2018 10:50:31 +0530 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0D9B1A.3080409@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> Message-ID: <5C0DF79F.7050500@oracle.com> I built jdk and ran nashorn tests with this patch. Two tests fail with this patch - but those tests pass without this patch: [testng] Test test/nashorn/script/nosecurity/JDK-8055034.js failed at line 1 - [testng] expected: 'jjs> var x = Object.create(null);' [testng] found: 'jjs> var x = Object.create(null)jjs> jjs> print('PASSED')PASSED' [testng] Test test/nashorn/script/nosecurity/JDK-8130127.js failed at line 5 - [testng] expected: 'jjs> print('hello')' [testng] found: 'jjs> print('hello')hello' Both tests involving exec'ing jjs and comparing with the expected output. Either we need to add these to failing tests and/or address the issue before push. Thanks, -Sundar On 10/12/18, 4:15 AM, Jan Lahoda wrote: > On 9.12.2018 16:40, Robert Field wrote: >> Ok. Go ahead and incorporate the text. I'll make a separate bug to sync >> the representation of keys in the other help entries. > > An updated patch (with your text): > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ > Delta from previous patch: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ > > Thanks for the comments and for the text! Any feedback is welcome. > > Thanks, > Jan > > >> >> Robert >> >> >> On December 9, 2018 6:36:26 AM Jan Lahoda wrote: >> >>> Hi Robert, >>> >>> On 9.12.2018 02:40, Robert Field wrote: >>>> OK, here is my thinking on a /help keys entry. Note: I'm using the >>> >>> I think this looks great! >>> >>>> representation for keys used by the User's Guide -- which I assume is >>>> the official tech pubs style -- seems we should be consistent; If >>>> we are >>>> however, the other /help entries should be brought into compliance >>>> (they >>>> seem to be all over the map already). May make sense to spin this off >>>> as a separate bug, which I'd be happy to take on. >>> >>> I'm happy with a separate bug, if you prefer/are OK with that. Or I can >>> incorporate the text into upgrade patch, whichever you prefer. >>> >>> I've updated my current patch with only a rename "editing" -> "keys" >>> and >>> the fix to the jshell tool name: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>> >>> Delta from last: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>> >>> Jan >>> >>>> >>>> Comments welcome --- >>>> >>>> __________________________________________________________________________________________________________________________ >>>> >>>> >>>> >>>> >>>> /help keys >>>> ========== >>>> >>>> The jshell tool provides line editing support to allow you to navigate >>>> within and edit snippets and commands. The current command/snippet can >>>> be edited, or prior commands/snippets can be retrieved from history, >>>> edited, and executed. This support is similar to readline/editline >>>> with >>>> simple emacs-like bindings. There are also jshell tool specific key >>>> sequences. >>>> >>>> --- Line and history navigation --- >>>> >>>> Return >>>> Enters the current snippet >>>> Left-arrow or Ctrl+B >>>> Moves backward one character >>>> Right-arrow or Ctrl+F >>>> Moves forward one character >>>> Up-arrow or Ctrl+P >>>> Moves up one line, backward through history >>>> Down arrow or Ctrl+N >>>> Moves down one line, forward through history >>>> Ctrl+A >>>> Moves to the beginning of the line >>>> Ctrl+E >>>> Moves to the end of the line >>>> Meta+B >>>> Moves backward one word >>>> Meta+F >>>> Moves forward one word >>>> Ctrl+R >>>> Search backward through history >>>> >>>> >>>> --- Line and history basic editing --- >>>> >>>> Meta+Return or Ctrl+Return (depending on platform) >>>> Insert a new line in snippet >>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>> Undo edit - repeat to undo more edits >>>> Delete >>>> Deletes the character at or after the cursor, depending on the >>>> operating system >>>> Backspace >>>> Deletes the character before the cursor >>>> Ctrl+K >>>> Deletes the text from the cursor to the end of the line >>>> Meta+D >>>> Deletes the text from the cursor to the end of the word >>>> Ctrl+W >>>> Deletes the text from the cursor to the previous white space >>>> Ctrl+Y >>>> Pastes the most recently deleted text into the line >>>> Meta+Y >>>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>>> Ctrl+X then Ctrl+K >>>> Delete whole snippet >>>> >>>> >>>> --- Shortcuts for jshell tool --- >>>> >>>> For details, see: /help shortcuts >>>> >>>> Tab >>>> Complete Java identifier or jshell command >>>> Shift+Tab then v >>>> Convert expression to variable declaration >>>> Shift+Tab then m >>>> Convert statement to method declaration >>>> Shift+Tab then i >>>> Add imports for this identifier >>>> >>>> >>>> --- More line and history editing --- >>>> >>>> Ctrl+L >>>> Clear screen and reprint snippet >>>> Ctrl+U >>>> Kill whole line >>>> Ctrl+T >>>> Transpose characters >>>> Ctrl+X then Ctrl+B >>>> Navigate to matching bracket, parenthesis, ... >>>> Ctrl+X then = >>>> Enter show current character position mode >>>> Ctrl+X then Ctrl+O >>>> Toggle overwrite characters vs insert characters >>>> Meta+C >>>> Capitalize word >>>> Meta+U >>>> Convert word to uppercase >>>> Meta+L >>>> Convert word to lowercase >>>> Meta+0 through Meta+9 then key >>>> Repeat the specified number of times >>>> >>>> Where, for example, "Ctrl+A" means hold down the control key and >>>> press A. >>>> Where "Meta" is "Alt" on many keyboards. >>>> Line editing support is derived from JLine 3. >>>> >>>> _______________________________________________________________________________ >>>> >>>> >>>> >>>> >>>> >>>> -Robert >>>> >>>> >>>> >>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>> Thanks for updating. >>>>>> >>>>>> Good to have /help for line editing keys, however: >>>>>> (1) The supported keys should be listed without requiring that >>>>>> the >>>>>> user knows or looks-up readline. More so, since only some readline >>>>>> keys >>>>>> are supposed. >>>>>> (2) "/edit" is a command, so with this change, typing "/help >>>>>> edit" >>>>>> would give both the /edit and editing help -- which would be >>>>>> confusing. >>>>>> I suggest "/help keys", there are no "k" help items. >>>>> >>>>> Will do. >>>>> >>>>>> (3) In jshell tool online docs the tool is spelled "jshell tool" >>>>>> I'd be happy to write up suggested text. >>>>> >>>>> Thanks, that would be very welcome! >>>>> >>>>>> >>>>>> As to the alternative patch: I understand the motivation, it >>>>>> would be >>>>>> nice to just use the natural "Enter" as new line. Unfortunately it's >>>>>> functionality is then overloaded. I believe the alternative will be >>>>>> confusing and awkward: >>>>>> (1) It breaks backward compatibility in user experience, Enter >>>>>> has >>>>>> always been accept/evaluate >>>>>> (2) It would be very awkward and non-intuitive (particularly in a >>>>>> long multiline snippet) to have to navigate to the end of the >>>>>> snippet to >>>>>> accept. >>>>>> Note: must be the end both vertically and horizontally. >>>>>> (3) It is inconsistent: Mid snippet Enter on one line does >>>>>> accept. >>>>>> However, on a continuation line (say after "int x =") it adds a new >>>>>> line >>>>>> instead. >>>>>> (4) It doesn't solve the problem for the most common location for >>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>> inconsistency. >>>>> >>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>> shortcut we could use to add new lines. >>>>> >>>>> Thanks for the comments! >>>>> >>>>> Jan >>>>> >>>>>> >>>>>> Thanks, >>>>>> Robert >>>>>> >>>>>> >>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>> Hi, >>>>>>> >>>>>>> I've updated the patch to reflect the comments so far, the current >>>>>>> version is here: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>> Delta since the previous version is here for convenience: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>> >>>>>>> In this version, while editing a snippet, a new line can be added >>>>>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>>>>> Windows). >>>>>>> >>>>>>> >>>>>>> And alternative patch is here: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>> Delta: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>> >>>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>>> snippet when the cursor is at the end of the snippet, otherwise it >>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>> but a >>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>>>>> multi-line snippet.) >>>>>>> >>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>> they >>>>>>> allow to add new lines into the multi-line snippets. Other changes >>>>>>> are >>>>>>> the same. >>>>>>> >>>>>>> Any feedback on this is welcome. >>>>>>> >>>>>>> Thanks! >>>>>>> >>>>>>> Jan >>>>>>> >>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>> Hi Robert, >>>>>>>> >>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>> webrev. I >>>>>>>>> did >>>>>>>>> not review the nashorn changes. >>>>>>>> >>>>>>>> Thanks for looking at this! >>>>>>>> >>>>>>>>> >>>>>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>>>>> intuitive. >>>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>>> as it >>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>> functionality). >>>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>>> this >>>>>>>>> JLine 3 version. Thoughts? >>>>>>>> >>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>> snippet >>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>> snippet >>>>>>>> would confirm that snippet. Could be fairly convenient/intuitive. >>>>>>>> What >>>>>>>> do you think? >>>>>>>> >>>>>>>>> >>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>> this, >>>>>>>>> found >>>>>>>>> nothing. However, most readline commands worked. Ctrl-u however >>>>>>>>> did >>>>>>>>> not >>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>> beginning of >>>>>>>>> the line). I notice that the there is zero in-command >>>>>>>>> documentation of >>>>>>>>> command-line editing -- not even a mention. Independent from the >>>>>>>>> review >>>>>>>>> of this port, it seems we should have in-command documentation of >>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>> useful. >>>>>>>> >>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>> >>>>>>>>> >>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>> History >>>>>>>>> Navigation section. >>>>>>>> >>>>>>>> Where is that? >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Jan >>>>>>>> >>>>>>>>> >>>>>>>>> -Robert >>>>>>>>> >>>>>>>>> >>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>>>>> JLine >>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>> snippet >>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>> Windows). >>>>>>>>>> As a consequence, this patch drops EditingHistory, as it does >>>>>>>>>> not >>>>>>>>>> seem >>>>>>>>>> to be needed anymore. >>>>>>>>>> >>>>>>>>>> JBS: >>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>> >>>>>>>>>> The full patch is here: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>> jdk.internal.le, no >>>>>>>>>> changes to JLine code: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>> >>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>> j.u.l.Logger, >>>>>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>>>>> stream, adding unicode escapes to unicode characters, support >>>>>>>>>> for >>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>> (unfortunately, >>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes >>>>>>>>>> are >>>>>>>>>> substantial): >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>> >>>>>>>>>> Any feedback is welcome! >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Jan >> >> >> From jan.lahoda at oracle.com Mon Dec 10 09:39:08 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 10 Dec 2018 10:39:08 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0DF79F.7050500@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> <5C0DF79F.7050500@oracle.com> Message-ID: <5C0E343C.8000705@oracle.com> Hi Sundar, Thanks for finding the problem! I was running tier1-3 tests, but seems these are not there. Seems the problem is how JLine(3) handles "dumb" terminals, it probably does not affect interactive use. So, adjusting the expected output should hopefully be OK. Updated patch: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.04/index.html Delta from previous: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.03.04/ How does this look? Thanks! Jan On 10.12.2018 06:20, Sundararajan Athijegannathan wrote: > I built jdk and ran nashorn tests with this patch. Two tests fail with > this patch - but those tests pass without this patch: > > [testng] Test test/nashorn/script/nosecurity/JDK-8055034.js failed > at line 1 - > [testng] expected: 'jjs> var x = Object.create(null);' > [testng] found: 'jjs> var x = Object.create(null)jjs> jjs> > print('PASSED')PASSED' > > [testng] Test test/nashorn/script/nosecurity/JDK-8130127.js failed > at line 5 - > [testng] expected: 'jjs> print('hello')' > [testng] found: 'jjs> print('hello')hello' > > Both tests involving exec'ing jjs and comparing with the expected > output. Either we need to add these to failing tests and/or address the > issue before push. > > Thanks, > -Sundar > > On 10/12/18, 4:15 AM, Jan Lahoda wrote: >> On 9.12.2018 16:40, Robert Field wrote: >>> Ok. Go ahead and incorporate the text. I'll make a separate bug to sync >>> the representation of keys in the other help entries. >> >> An updated patch (with your text): >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ >> Delta from previous patch: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ >> >> Thanks for the comments and for the text! Any feedback is welcome. >> >> Thanks, >> Jan >> >> >>> >>> Robert >>> >>> >>> On December 9, 2018 6:36:26 AM Jan Lahoda wrote: >>> >>>> Hi Robert, >>>> >>>> On 9.12.2018 02:40, Robert Field wrote: >>>>> OK, here is my thinking on a /help keys entry. Note: I'm using the >>>> >>>> I think this looks great! >>>> >>>>> representation for keys used by the User's Guide -- which I assume is >>>>> the official tech pubs style -- seems we should be consistent; If >>>>> we are >>>>> however, the other /help entries should be brought into compliance >>>>> (they >>>>> seem to be all over the map already). May make sense to spin this off >>>>> as a separate bug, which I'd be happy to take on. >>>> >>>> I'm happy with a separate bug, if you prefer/are OK with that. Or I can >>>> incorporate the text into upgrade patch, whichever you prefer. >>>> >>>> I've updated my current patch with only a rename "editing" -> "keys" >>>> and >>>> the fix to the jshell tool name: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>>> >>>> Delta from last: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>>> >>>> Jan >>>> >>>>> >>>>> Comments welcome --- >>>>> >>>>> __________________________________________________________________________________________________________________________ >>>>> >>>>> >>>>> >>>>> >>>>> /help keys >>>>> ========== >>>>> >>>>> The jshell tool provides line editing support to allow you to navigate >>>>> within and edit snippets and commands. The current command/snippet can >>>>> be edited, or prior commands/snippets can be retrieved from history, >>>>> edited, and executed. This support is similar to readline/editline >>>>> with >>>>> simple emacs-like bindings. There are also jshell tool specific key >>>>> sequences. >>>>> >>>>> --- Line and history navigation --- >>>>> >>>>> Return >>>>> Enters the current snippet >>>>> Left-arrow or Ctrl+B >>>>> Moves backward one character >>>>> Right-arrow or Ctrl+F >>>>> Moves forward one character >>>>> Up-arrow or Ctrl+P >>>>> Moves up one line, backward through history >>>>> Down arrow or Ctrl+N >>>>> Moves down one line, forward through history >>>>> Ctrl+A >>>>> Moves to the beginning of the line >>>>> Ctrl+E >>>>> Moves to the end of the line >>>>> Meta+B >>>>> Moves backward one word >>>>> Meta+F >>>>> Moves forward one word >>>>> Ctrl+R >>>>> Search backward through history >>>>> >>>>> >>>>> --- Line and history basic editing --- >>>>> >>>>> Meta+Return or Ctrl+Return (depending on platform) >>>>> Insert a new line in snippet >>>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>>> Undo edit - repeat to undo more edits >>>>> Delete >>>>> Deletes the character at or after the cursor, depending on the >>>>> operating system >>>>> Backspace >>>>> Deletes the character before the cursor >>>>> Ctrl+K >>>>> Deletes the text from the cursor to the end of the line >>>>> Meta+D >>>>> Deletes the text from the cursor to the end of the word >>>>> Ctrl+W >>>>> Deletes the text from the cursor to the previous white space >>>>> Ctrl+Y >>>>> Pastes the most recently deleted text into the line >>>>> Meta+Y >>>>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>>>> Ctrl+X then Ctrl+K >>>>> Delete whole snippet >>>>> >>>>> >>>>> --- Shortcuts for jshell tool --- >>>>> >>>>> For details, see: /help shortcuts >>>>> >>>>> Tab >>>>> Complete Java identifier or jshell command >>>>> Shift+Tab then v >>>>> Convert expression to variable declaration >>>>> Shift+Tab then m >>>>> Convert statement to method declaration >>>>> Shift+Tab then i >>>>> Add imports for this identifier >>>>> >>>>> >>>>> --- More line and history editing --- >>>>> >>>>> Ctrl+L >>>>> Clear screen and reprint snippet >>>>> Ctrl+U >>>>> Kill whole line >>>>> Ctrl+T >>>>> Transpose characters >>>>> Ctrl+X then Ctrl+B >>>>> Navigate to matching bracket, parenthesis, ... >>>>> Ctrl+X then = >>>>> Enter show current character position mode >>>>> Ctrl+X then Ctrl+O >>>>> Toggle overwrite characters vs insert characters >>>>> Meta+C >>>>> Capitalize word >>>>> Meta+U >>>>> Convert word to uppercase >>>>> Meta+L >>>>> Convert word to lowercase >>>>> Meta+0 through Meta+9 then key >>>>> Repeat the specified number of times >>>>> >>>>> Where, for example, "Ctrl+A" means hold down the control key and >>>>> press A. >>>>> Where "Meta" is "Alt" on many keyboards. >>>>> Line editing support is derived from JLine 3. >>>>> >>>>> _______________________________________________________________________________ >>>>> >>>>> >>>>> >>>>> >>>>> >>>>> -Robert >>>>> >>>>> >>>>> >>>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>>> Thanks for updating. >>>>>>> >>>>>>> Good to have /help for line editing keys, however: >>>>>>> (1) The supported keys should be listed without requiring that >>>>>>> the >>>>>>> user knows or looks-up readline. More so, since only some readline >>>>>>> keys >>>>>>> are supposed. >>>>>>> (2) "/edit" is a command, so with this change, typing "/help >>>>>>> edit" >>>>>>> would give both the /edit and editing help -- which would be >>>>>>> confusing. >>>>>>> I suggest "/help keys", there are no "k" help items. >>>>>> >>>>>> Will do. >>>>>> >>>>>>> (3) In jshell tool online docs the tool is spelled "jshell tool" >>>>>>> I'd be happy to write up suggested text. >>>>>> >>>>>> Thanks, that would be very welcome! >>>>>> >>>>>>> >>>>>>> As to the alternative patch: I understand the motivation, it >>>>>>> would be >>>>>>> nice to just use the natural "Enter" as new line. Unfortunately it's >>>>>>> functionality is then overloaded. I believe the alternative will be >>>>>>> confusing and awkward: >>>>>>> (1) It breaks backward compatibility in user experience, Enter >>>>>>> has >>>>>>> always been accept/evaluate >>>>>>> (2) It would be very awkward and non-intuitive (particularly in a >>>>>>> long multiline snippet) to have to navigate to the end of the >>>>>>> snippet to >>>>>>> accept. >>>>>>> Note: must be the end both vertically and horizontally. >>>>>>> (3) It is inconsistent: Mid snippet Enter on one line does >>>>>>> accept. >>>>>>> However, on a continuation line (say after "int x =") it adds a new >>>>>>> line >>>>>>> instead. >>>>>>> (4) It doesn't solve the problem for the most common location for >>>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>>> inconsistency. >>>>>> >>>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>>> shortcut we could use to add new lines. >>>>>> >>>>>> Thanks for the comments! >>>>>> >>>>>> Jan >>>>>> >>>>>>> >>>>>>> Thanks, >>>>>>> Robert >>>>>>> >>>>>>> >>>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>>> Hi, >>>>>>>> >>>>>>>> I've updated the patch to reflect the comments so far, the current >>>>>>>> version is here: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>>> Delta since the previous version is here for convenience: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>>> >>>>>>>> In this version, while editing a snippet, a new line can be added >>>>>>>> using Alt-Enter (on platforms that support that), or Ctrl-Enter (on >>>>>>>> Windows). >>>>>>>> >>>>>>>> >>>>>>>> And alternative patch is here: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>>> Delta: >>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>>> >>>>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>>>> snippet when the cursor is at the end of the snippet, otherwise it >>>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>>> but a >>>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle of a >>>>>>>> multi-line snippet.) >>>>>>>> >>>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>>> they >>>>>>>> allow to add new lines into the multi-line snippets. Other changes >>>>>>>> are >>>>>>>> the same. >>>>>>>> >>>>>>>> Any feedback on this is welcome. >>>>>>>> >>>>>>>> Thanks! >>>>>>>> >>>>>>>> Jan >>>>>>>> >>>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>>> Hi Robert, >>>>>>>>> >>>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>>> webrev. I >>>>>>>>>> did >>>>>>>>>> not review the nashorn changes. >>>>>>>>> >>>>>>>>> Thanks for looking at this! >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Testing it: editing multi-line snippets is vastly easier and more >>>>>>>>>> intuitive. >>>>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>>>> as it >>>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>>> functionality). >>>>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>>>> this >>>>>>>>>> JLine 3 version. Thoughts? >>>>>>>>> >>>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>>> snippet >>>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>>> snippet >>>>>>>>> would confirm that snippet. Could be fairly convenient/intuitive. >>>>>>>>> What >>>>>>>>> do you think? >>>>>>>>> >>>>>>>>>> >>>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>>> this, >>>>>>>>>> found >>>>>>>>>> nothing. However, most readline commands worked. Ctrl-u however >>>>>>>>>> did >>>>>>>>>> not >>>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>>> beginning of >>>>>>>>>> the line). I notice that the there is zero in-command >>>>>>>>>> documentation of >>>>>>>>>> command-line editing -- not even a mention. Independent from the >>>>>>>>>> review >>>>>>>>>> of this port, it seems we should have in-command documentation of >>>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>>> useful. >>>>>>>>> >>>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>>> >>>>>>>>>> >>>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>>> History >>>>>>>>>> Navigation section. >>>>>>>>> >>>>>>>>> Where is that? >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Jan >>>>>>>>> >>>>>>>>>> >>>>>>>>>> -Robert >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I'd like to update the internal JLine used by JShell and jjs to >>>>>>>>>>> JLine >>>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>>> snippet >>>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>>> Windows). >>>>>>>>>>> As a consequence, this patch drops EditingHistory, as it does >>>>>>>>>>> not >>>>>>>>>>> seem >>>>>>>>>>> to be needed anymore. >>>>>>>>>>> >>>>>>>>>>> JBS: >>>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>>> >>>>>>>>>>> The full patch is here: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>>> jdk.internal.le, no >>>>>>>>>>> changes to JLine code: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>>> >>>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>>> j.u.l.Logger, >>>>>>>>>>> adding hooks to wrap input streams with our stop-detecting input >>>>>>>>>>> stream, adding unicode escapes to unicode characters, support >>>>>>>>>>> for >>>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>>> (unfortunately, >>>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the changes >>>>>>>>>>> are >>>>>>>>>>> substantial): >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>>> >>>>>>>>>>> Any feedback is welcome! >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Jan >>> >>> >>> From sundararajan.athijegannathan at oracle.com Mon Dec 10 10:14:35 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Mon, 10 Dec 2018 15:44:35 +0530 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0E343C.8000705@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> <5C0DF79F.7050500@oracle.com> <5C0E343C.8000705@oracle.com> Message-ID: <5C0E3C8B.2040903@oracle.com> Hi Jan, Tests are fine. Because there are not many UI automated tests for jjs, I tried to manually test few features. Tab-completion seems to be messed up. Only top-level completion seems to work. Property/method completion and inside multi-line method etc. don't seem to work. Thanks, -Sundar On 10/12/18, 3:09 PM, Jan Lahoda wrote: > Hi Sundar, > > Thanks for finding the problem! I was running tier1-3 tests, but seems > these are not there. > > Seems the problem is how JLine(3) handles "dumb" terminals, it > probably does not affect interactive use. So, adjusting the expected > output should hopefully be OK. > > Updated patch: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.04/index.html > Delta from previous: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.03.04/ > > How does this look? > > Thanks! > > Jan > > On 10.12.2018 06:20, Sundararajan Athijegannathan wrote: >> I built jdk and ran nashorn tests with this patch. Two tests fail with >> this patch - but those tests pass without this patch: >> >> [testng] Test test/nashorn/script/nosecurity/JDK-8055034.js failed >> at line 1 - >> [testng] expected: 'jjs> var x = Object.create(null);' >> [testng] found: 'jjs> var x = Object.create(null)jjs> jjs> >> print('PASSED')PASSED' >> >> [testng] Test test/nashorn/script/nosecurity/JDK-8130127.js failed >> at line 5 - >> [testng] expected: 'jjs> print('hello')' >> [testng] found: 'jjs> print('hello')hello' >> >> Both tests involving exec'ing jjs and comparing with the expected >> output. Either we need to add these to failing tests and/or address the >> issue before push. >> >> Thanks, >> -Sundar >> >> On 10/12/18, 4:15 AM, Jan Lahoda wrote: >>> On 9.12.2018 16:40, Robert Field wrote: >>>> Ok. Go ahead and incorporate the text. I'll make a separate bug to >>>> sync >>>> the representation of keys in the other help entries. >>> >>> An updated patch (with your text): >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ >>> Delta from previous patch: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ >>> >>> Thanks for the comments and for the text! Any feedback is welcome. >>> >>> Thanks, >>> Jan >>> >>> >>>> >>>> Robert >>>> >>>> >>>> On December 9, 2018 6:36:26 AM Jan Lahoda >>>> wrote: >>>> >>>>> Hi Robert, >>>>> >>>>> On 9.12.2018 02:40, Robert Field wrote: >>>>>> OK, here is my thinking on a /help keys entry. Note: I'm using the >>>>> >>>>> I think this looks great! >>>>> >>>>>> representation for keys used by the User's Guide -- which I >>>>>> assume is >>>>>> the official tech pubs style -- seems we should be consistent; If >>>>>> we are >>>>>> however, the other /help entries should be brought into compliance >>>>>> (they >>>>>> seem to be all over the map already). May make sense to spin >>>>>> this off >>>>>> as a separate bug, which I'd be happy to take on. >>>>> >>>>> I'm happy with a separate bug, if you prefer/are OK with that. Or >>>>> I can >>>>> incorporate the text into upgrade patch, whichever you prefer. >>>>> >>>>> I've updated my current patch with only a rename "editing" -> "keys" >>>>> and >>>>> the fix to the jshell tool name: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>>>> >>>>> Delta from last: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>>>> >>>>> Jan >>>>> >>>>>> >>>>>> Comments welcome --- >>>>>> >>>>>> __________________________________________________________________________________________________________________________ >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> /help keys >>>>>> ========== >>>>>> >>>>>> The jshell tool provides line editing support to allow you to >>>>>> navigate >>>>>> within and edit snippets and commands. The current >>>>>> command/snippet can >>>>>> be edited, or prior commands/snippets can be retrieved from history, >>>>>> edited, and executed. This support is similar to readline/editline >>>>>> with >>>>>> simple emacs-like bindings. There are also jshell tool specific key >>>>>> sequences. >>>>>> >>>>>> --- Line and history navigation --- >>>>>> >>>>>> Return >>>>>> Enters the current snippet >>>>>> Left-arrow or Ctrl+B >>>>>> Moves backward one character >>>>>> Right-arrow or Ctrl+F >>>>>> Moves forward one character >>>>>> Up-arrow or Ctrl+P >>>>>> Moves up one line, backward through history >>>>>> Down arrow or Ctrl+N >>>>>> Moves down one line, forward through history >>>>>> Ctrl+A >>>>>> Moves to the beginning of the line >>>>>> Ctrl+E >>>>>> Moves to the end of the line >>>>>> Meta+B >>>>>> Moves backward one word >>>>>> Meta+F >>>>>> Moves forward one word >>>>>> Ctrl+R >>>>>> Search backward through history >>>>>> >>>>>> >>>>>> --- Line and history basic editing --- >>>>>> >>>>>> Meta+Return or Ctrl+Return (depending on platform) >>>>>> Insert a new line in snippet >>>>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>>>> Undo edit - repeat to undo more edits >>>>>> Delete >>>>>> Deletes the character at or after the cursor, depending on the >>>>>> operating system >>>>>> Backspace >>>>>> Deletes the character before the cursor >>>>>> Ctrl+K >>>>>> Deletes the text from the cursor to the end of the line >>>>>> Meta+D >>>>>> Deletes the text from the cursor to the end of the word >>>>>> Ctrl+W >>>>>> Deletes the text from the cursor to the previous white space >>>>>> Ctrl+Y >>>>>> Pastes the most recently deleted text into the line >>>>>> Meta+Y >>>>>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>>>>> Ctrl+X then Ctrl+K >>>>>> Delete whole snippet >>>>>> >>>>>> >>>>>> --- Shortcuts for jshell tool --- >>>>>> >>>>>> For details, see: /help shortcuts >>>>>> >>>>>> Tab >>>>>> Complete Java identifier or jshell command >>>>>> Shift+Tab then v >>>>>> Convert expression to variable declaration >>>>>> Shift+Tab then m >>>>>> Convert statement to method declaration >>>>>> Shift+Tab then i >>>>>> Add imports for this identifier >>>>>> >>>>>> >>>>>> --- More line and history editing --- >>>>>> >>>>>> Ctrl+L >>>>>> Clear screen and reprint snippet >>>>>> Ctrl+U >>>>>> Kill whole line >>>>>> Ctrl+T >>>>>> Transpose characters >>>>>> Ctrl+X then Ctrl+B >>>>>> Navigate to matching bracket, parenthesis, ... >>>>>> Ctrl+X then = >>>>>> Enter show current character position mode >>>>>> Ctrl+X then Ctrl+O >>>>>> Toggle overwrite characters vs insert characters >>>>>> Meta+C >>>>>> Capitalize word >>>>>> Meta+U >>>>>> Convert word to uppercase >>>>>> Meta+L >>>>>> Convert word to lowercase >>>>>> Meta+0 through Meta+9 then key >>>>>> Repeat the specified number of times >>>>>> >>>>>> Where, for example, "Ctrl+A" means hold down the control key and >>>>>> press A. >>>>>> Where "Meta" is "Alt" on many keyboards. >>>>>> Line editing support is derived from JLine 3. >>>>>> >>>>>> _______________________________________________________________________________ >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> >>>>>> -Robert >>>>>> >>>>>> >>>>>> >>>>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>>>> Thanks for updating. >>>>>>>> >>>>>>>> Good to have /help for line editing keys, however: >>>>>>>> (1) The supported keys should be listed without requiring that >>>>>>>> the >>>>>>>> user knows or looks-up readline. More so, since only some readline >>>>>>>> keys >>>>>>>> are supposed. >>>>>>>> (2) "/edit" is a command, so with this change, typing "/help >>>>>>>> edit" >>>>>>>> would give both the /edit and editing help -- which would be >>>>>>>> confusing. >>>>>>>> I suggest "/help keys", there are no "k" help items. >>>>>>> >>>>>>> Will do. >>>>>>> >>>>>>>> (3) In jshell tool online docs the tool is spelled "jshell >>>>>>>> tool" >>>>>>>> I'd be happy to write up suggested text. >>>>>>> >>>>>>> Thanks, that would be very welcome! >>>>>>> >>>>>>>> >>>>>>>> As to the alternative patch: I understand the motivation, it >>>>>>>> would be >>>>>>>> nice to just use the natural "Enter" as new line. Unfortunately >>>>>>>> it's >>>>>>>> functionality is then overloaded. I believe the alternative >>>>>>>> will be >>>>>>>> confusing and awkward: >>>>>>>> (1) It breaks backward compatibility in user experience, Enter >>>>>>>> has >>>>>>>> always been accept/evaluate >>>>>>>> (2) It would be very awkward and non-intuitive (particularly >>>>>>>> in a >>>>>>>> long multiline snippet) to have to navigate to the end of the >>>>>>>> snippet to >>>>>>>> accept. >>>>>>>> Note: must be the end both vertically and horizontally. >>>>>>>> (3) It is inconsistent: Mid snippet Enter on one line does >>>>>>>> accept. >>>>>>>> However, on a continuation line (say after "int x =") it adds a >>>>>>>> new >>>>>>>> line >>>>>>>> instead. >>>>>>>> (4) It doesn't solve the problem for the most common >>>>>>>> location for >>>>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>>>> inconsistency. >>>>>>> >>>>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>>>> shortcut we could use to add new lines. >>>>>>> >>>>>>> Thanks for the comments! >>>>>>> >>>>>>> Jan >>>>>>> >>>>>>>> >>>>>>>> Thanks, >>>>>>>> Robert >>>>>>>> >>>>>>>> >>>>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>>>> Hi, >>>>>>>>> >>>>>>>>> I've updated the patch to reflect the comments so far, the >>>>>>>>> current >>>>>>>>> version is here: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>>>> Delta since the previous version is here for convenience: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>>>> >>>>>>>>> In this version, while editing a snippet, a new line can be added >>>>>>>>> using Alt-Enter (on platforms that support that), or >>>>>>>>> Ctrl-Enter (on >>>>>>>>> Windows). >>>>>>>>> >>>>>>>>> >>>>>>>>> And alternative patch is here: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>>>> Delta: >>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>>>> >>>>>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>>>>> snippet when the cursor is at the end of the snippet, >>>>>>>>> otherwise it >>>>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>>>> but a >>>>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle >>>>>>>>> of a >>>>>>>>> multi-line snippet.) >>>>>>>>> >>>>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>>>> they >>>>>>>>> allow to add new lines into the multi-line snippets. Other >>>>>>>>> changes >>>>>>>>> are >>>>>>>>> the same. >>>>>>>>> >>>>>>>>> Any feedback on this is welcome. >>>>>>>>> >>>>>>>>> Thanks! >>>>>>>>> >>>>>>>>> Jan >>>>>>>>> >>>>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>>>> Hi Robert, >>>>>>>>>> >>>>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>>>> webrev. I >>>>>>>>>>> did >>>>>>>>>>> not review the nashorn changes. >>>>>>>>>> >>>>>>>>>> Thanks for looking at this! >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> Testing it: editing multi-line snippets is vastly easier and >>>>>>>>>>> more >>>>>>>>>>> intuitive. >>>>>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>>>>> as it >>>>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>>>> functionality). >>>>>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>>>>> this >>>>>>>>>>> JLine 3 version. Thoughts? >>>>>>>>>> >>>>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>>>> snippet >>>>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>>>> snippet >>>>>>>>>> would confirm that snippet. Could be fairly >>>>>>>>>> convenient/intuitive. >>>>>>>>>> What >>>>>>>>>> do you think? >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>>>> this, >>>>>>>>>>> found >>>>>>>>>>> nothing. However, most readline commands worked. Ctrl-u >>>>>>>>>>> however >>>>>>>>>>> did >>>>>>>>>>> not >>>>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>>>> beginning of >>>>>>>>>>> the line). I notice that the there is zero in-command >>>>>>>>>>> documentation of >>>>>>>>>>> command-line editing -- not even a mention. Independent >>>>>>>>>>> from the >>>>>>>>>>> review >>>>>>>>>>> of this port, it seems we should have in-command >>>>>>>>>>> documentation of >>>>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>>>> useful. >>>>>>>>>> >>>>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>>>> History >>>>>>>>>>> Navigation section. >>>>>>>>>> >>>>>>>>>> Where is that? >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Jan >>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> -Robert >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>>>> Hi, >>>>>>>>>>>> >>>>>>>>>>>> I'd like to update the internal JLine used by JShell and >>>>>>>>>>>> jjs to >>>>>>>>>>>> JLine >>>>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>>>> snippet >>>>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>>>> Windows). >>>>>>>>>>>> As a consequence, this patch drops EditingHistory, as it does >>>>>>>>>>>> not >>>>>>>>>>>> seem >>>>>>>>>>>> to be needed anymore. >>>>>>>>>>>> >>>>>>>>>>>> JBS: >>>>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>>>> >>>>>>>>>>>> The full patch is here: >>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>>>> jdk.internal.le, no >>>>>>>>>>>> changes to JLine code: >>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>>>> >>>>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>>>> j.u.l.Logger, >>>>>>>>>>>> adding hooks to wrap input streams with our stop-detecting >>>>>>>>>>>> input >>>>>>>>>>>> stream, adding unicode escapes to unicode characters, support >>>>>>>>>>>> for >>>>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>>>> (unfortunately, >>>>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the >>>>>>>>>>>> changes >>>>>>>>>>>> are >>>>>>>>>>>> substantial): >>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>>>> >>>>>>>>>>>> Any feedback is welcome! >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> Jan >>>> >>>> >>>> From jan.lahoda at oracle.com Mon Dec 10 13:03:51 2018 From: jan.lahoda at oracle.com (Jan Lahoda) Date: Mon, 10 Dec 2018 14:03:51 +0100 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0E3C8B.2040903@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> <5C0DF79F.7050500@oracle.com> <5C0E343C.8000705@oracle.com> <5C0E3C8B.2040903@oracle.com> Message-ID: <5C0E6437.8000307@oracle.com> Thanks for testing Sundar! I've tried to update the jjs completion handling to fix this problem here: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.05/ Delta from previous patch: http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.04.05/ What do you think? Thanks, Jan On 10.12.2018 11:14, Sundararajan Athijegannathan wrote: > Hi Jan, > > Tests are fine. Because there are not many UI automated tests for jjs, I > tried to manually test few features. > > Tab-completion seems to be messed up. Only top-level completion seems to > work. Property/method completion and inside multi-line method etc. don't > seem to work. > > Thanks, > -Sundar > > > On 10/12/18, 3:09 PM, Jan Lahoda wrote: >> Hi Sundar, >> >> Thanks for finding the problem! I was running tier1-3 tests, but seems >> these are not there. >> >> Seems the problem is how JLine(3) handles "dumb" terminals, it >> probably does not affect interactive use. So, adjusting the expected >> output should hopefully be OK. >> >> Updated patch: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.04/index.html >> Delta from previous: >> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.03.04/ >> >> How does this look? >> >> Thanks! >> >> Jan >> >> On 10.12.2018 06:20, Sundararajan Athijegannathan wrote: >>> I built jdk and ran nashorn tests with this patch. Two tests fail with >>> this patch - but those tests pass without this patch: >>> >>> [testng] Test test/nashorn/script/nosecurity/JDK-8055034.js failed >>> at line 1 - >>> [testng] expected: 'jjs> var x = Object.create(null);' >>> [testng] found: 'jjs> var x = Object.create(null)jjs> jjs> >>> print('PASSED')PASSED' >>> >>> [testng] Test test/nashorn/script/nosecurity/JDK-8130127.js failed >>> at line 5 - >>> [testng] expected: 'jjs> print('hello')' >>> [testng] found: 'jjs> print('hello')hello' >>> >>> Both tests involving exec'ing jjs and comparing with the expected >>> output. Either we need to add these to failing tests and/or address the >>> issue before push. >>> >>> Thanks, >>> -Sundar >>> >>> On 10/12/18, 4:15 AM, Jan Lahoda wrote: >>>> On 9.12.2018 16:40, Robert Field wrote: >>>>> Ok. Go ahead and incorporate the text. I'll make a separate bug to >>>>> sync >>>>> the representation of keys in the other help entries. >>>> >>>> An updated patch (with your text): >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ >>>> Delta from previous patch: >>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ >>>> >>>> Thanks for the comments and for the text! Any feedback is welcome. >>>> >>>> Thanks, >>>> Jan >>>> >>>> >>>>> >>>>> Robert >>>>> >>>>> >>>>> On December 9, 2018 6:36:26 AM Jan Lahoda >>>>> wrote: >>>>> >>>>>> Hi Robert, >>>>>> >>>>>> On 9.12.2018 02:40, Robert Field wrote: >>>>>>> OK, here is my thinking on a /help keys entry. Note: I'm using the >>>>>> >>>>>> I think this looks great! >>>>>> >>>>>>> representation for keys used by the User's Guide -- which I >>>>>>> assume is >>>>>>> the official tech pubs style -- seems we should be consistent; If >>>>>>> we are >>>>>>> however, the other /help entries should be brought into compliance >>>>>>> (they >>>>>>> seem to be all over the map already). May make sense to spin >>>>>>> this off >>>>>>> as a separate bug, which I'd be happy to take on. >>>>>> >>>>>> I'm happy with a separate bug, if you prefer/are OK with that. Or >>>>>> I can >>>>>> incorporate the text into upgrade patch, whichever you prefer. >>>>>> >>>>>> I've updated my current patch with only a rename "editing" -> "keys" >>>>>> and >>>>>> the fix to the jshell tool name: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>>>>> >>>>>> Delta from last: >>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>>>>> >>>>>> Jan >>>>>> >>>>>>> >>>>>>> Comments welcome --- >>>>>>> >>>>>>> __________________________________________________________________________________________________________________________ >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> /help keys >>>>>>> ========== >>>>>>> >>>>>>> The jshell tool provides line editing support to allow you to >>>>>>> navigate >>>>>>> within and edit snippets and commands. The current >>>>>>> command/snippet can >>>>>>> be edited, or prior commands/snippets can be retrieved from history, >>>>>>> edited, and executed. This support is similar to readline/editline >>>>>>> with >>>>>>> simple emacs-like bindings. There are also jshell tool specific key >>>>>>> sequences. >>>>>>> >>>>>>> --- Line and history navigation --- >>>>>>> >>>>>>> Return >>>>>>> Enters the current snippet >>>>>>> Left-arrow or Ctrl+B >>>>>>> Moves backward one character >>>>>>> Right-arrow or Ctrl+F >>>>>>> Moves forward one character >>>>>>> Up-arrow or Ctrl+P >>>>>>> Moves up one line, backward through history >>>>>>> Down arrow or Ctrl+N >>>>>>> Moves down one line, forward through history >>>>>>> Ctrl+A >>>>>>> Moves to the beginning of the line >>>>>>> Ctrl+E >>>>>>> Moves to the end of the line >>>>>>> Meta+B >>>>>>> Moves backward one word >>>>>>> Meta+F >>>>>>> Moves forward one word >>>>>>> Ctrl+R >>>>>>> Search backward through history >>>>>>> >>>>>>> >>>>>>> --- Line and history basic editing --- >>>>>>> >>>>>>> Meta+Return or Ctrl+Return (depending on platform) >>>>>>> Insert a new line in snippet >>>>>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>>>>> Undo edit - repeat to undo more edits >>>>>>> Delete >>>>>>> Deletes the character at or after the cursor, depending on the >>>>>>> operating system >>>>>>> Backspace >>>>>>> Deletes the character before the cursor >>>>>>> Ctrl+K >>>>>>> Deletes the text from the cursor to the end of the line >>>>>>> Meta+D >>>>>>> Deletes the text from the cursor to the end of the word >>>>>>> Ctrl+W >>>>>>> Deletes the text from the cursor to the previous white space >>>>>>> Ctrl+Y >>>>>>> Pastes the most recently deleted text into the line >>>>>>> Meta+Y >>>>>>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>>>>>> Ctrl+X then Ctrl+K >>>>>>> Delete whole snippet >>>>>>> >>>>>>> >>>>>>> --- Shortcuts for jshell tool --- >>>>>>> >>>>>>> For details, see: /help shortcuts >>>>>>> >>>>>>> Tab >>>>>>> Complete Java identifier or jshell command >>>>>>> Shift+Tab then v >>>>>>> Convert expression to variable declaration >>>>>>> Shift+Tab then m >>>>>>> Convert statement to method declaration >>>>>>> Shift+Tab then i >>>>>>> Add imports for this identifier >>>>>>> >>>>>>> >>>>>>> --- More line and history editing --- >>>>>>> >>>>>>> Ctrl+L >>>>>>> Clear screen and reprint snippet >>>>>>> Ctrl+U >>>>>>> Kill whole line >>>>>>> Ctrl+T >>>>>>> Transpose characters >>>>>>> Ctrl+X then Ctrl+B >>>>>>> Navigate to matching bracket, parenthesis, ... >>>>>>> Ctrl+X then = >>>>>>> Enter show current character position mode >>>>>>> Ctrl+X then Ctrl+O >>>>>>> Toggle overwrite characters vs insert characters >>>>>>> Meta+C >>>>>>> Capitalize word >>>>>>> Meta+U >>>>>>> Convert word to uppercase >>>>>>> Meta+L >>>>>>> Convert word to lowercase >>>>>>> Meta+0 through Meta+9 then key >>>>>>> Repeat the specified number of times >>>>>>> >>>>>>> Where, for example, "Ctrl+A" means hold down the control key and >>>>>>> press A. >>>>>>> Where "Meta" is "Alt" on many keyboards. >>>>>>> Line editing support is derived from JLine 3. >>>>>>> >>>>>>> _______________________________________________________________________________ >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> >>>>>>> -Robert >>>>>>> >>>>>>> >>>>>>> >>>>>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>>>>> Thanks for updating. >>>>>>>>> >>>>>>>>> Good to have /help for line editing keys, however: >>>>>>>>> (1) The supported keys should be listed without requiring that >>>>>>>>> the >>>>>>>>> user knows or looks-up readline. More so, since only some readline >>>>>>>>> keys >>>>>>>>> are supposed. >>>>>>>>> (2) "/edit" is a command, so with this change, typing "/help >>>>>>>>> edit" >>>>>>>>> would give both the /edit and editing help -- which would be >>>>>>>>> confusing. >>>>>>>>> I suggest "/help keys", there are no "k" help items. >>>>>>>> >>>>>>>> Will do. >>>>>>>> >>>>>>>>> (3) In jshell tool online docs the tool is spelled "jshell >>>>>>>>> tool" >>>>>>>>> I'd be happy to write up suggested text. >>>>>>>> >>>>>>>> Thanks, that would be very welcome! >>>>>>>> >>>>>>>>> >>>>>>>>> As to the alternative patch: I understand the motivation, it >>>>>>>>> would be >>>>>>>>> nice to just use the natural "Enter" as new line. Unfortunately >>>>>>>>> it's >>>>>>>>> functionality is then overloaded. I believe the alternative >>>>>>>>> will be >>>>>>>>> confusing and awkward: >>>>>>>>> (1) It breaks backward compatibility in user experience, Enter >>>>>>>>> has >>>>>>>>> always been accept/evaluate >>>>>>>>> (2) It would be very awkward and non-intuitive (particularly >>>>>>>>> in a >>>>>>>>> long multiline snippet) to have to navigate to the end of the >>>>>>>>> snippet to >>>>>>>>> accept. >>>>>>>>> Note: must be the end both vertically and horizontally. >>>>>>>>> (3) It is inconsistent: Mid snippet Enter on one line does >>>>>>>>> accept. >>>>>>>>> However, on a continuation line (say after "int x =") it adds a >>>>>>>>> new >>>>>>>>> line >>>>>>>>> instead. >>>>>>>>> (4) It doesn't solve the problem for the most common >>>>>>>>> location for >>>>>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>>>>> inconsistency. >>>>>>>> >>>>>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>>>>> shortcut we could use to add new lines. >>>>>>>> >>>>>>>> Thanks for the comments! >>>>>>>> >>>>>>>> Jan >>>>>>>> >>>>>>>>> >>>>>>>>> Thanks, >>>>>>>>> Robert >>>>>>>>> >>>>>>>>> >>>>>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>>>>> Hi, >>>>>>>>>> >>>>>>>>>> I've updated the patch to reflect the comments so far, the >>>>>>>>>> current >>>>>>>>>> version is here: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>>>>> Delta since the previous version is here for convenience: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>>>>> >>>>>>>>>> In this version, while editing a snippet, a new line can be added >>>>>>>>>> using Alt-Enter (on platforms that support that), or >>>>>>>>>> Ctrl-Enter (on >>>>>>>>>> Windows). >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> And alternative patch is here: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>>>>> Delta: >>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>>>>> >>>>>>>>>> In the alternative version, Enter will only "confirm" multi-line >>>>>>>>>> snippet when the cursor is at the end of the snippet, >>>>>>>>>> otherwise it >>>>>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>>>>> but a >>>>>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle >>>>>>>>>> of a >>>>>>>>>> multi-line snippet.) >>>>>>>>>> >>>>>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>>>>> they >>>>>>>>>> allow to add new lines into the multi-line snippets. Other >>>>>>>>>> changes >>>>>>>>>> are >>>>>>>>>> the same. >>>>>>>>>> >>>>>>>>>> Any feedback on this is welcome. >>>>>>>>>> >>>>>>>>>> Thanks! >>>>>>>>>> >>>>>>>>>> Jan >>>>>>>>>> >>>>>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>>>>> Hi Robert, >>>>>>>>>>> >>>>>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>>>>> webrev. I >>>>>>>>>>>> did >>>>>>>>>>>> not review the nashorn changes. >>>>>>>>>>> >>>>>>>>>>> Thanks for looking at this! >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> Testing it: editing multi-line snippets is vastly easier and >>>>>>>>>>>> more >>>>>>>>>>>> intuitive. >>>>>>>>>>>> There is one issue, with the old mechanism, as horridly clunky >>>>>>>>>>>> as it >>>>>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>>>>> functionality). >>>>>>>>>>>> Since is accept, I could find no way to add lines with >>>>>>>>>>>> this >>>>>>>>>>>> JLine 3 version. Thoughts? >>>>>>>>>>> >>>>>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>>>>> snippet >>>>>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>>>>> snippet >>>>>>>>>>> would confirm that snippet. Could be fairly >>>>>>>>>>> convenient/intuitive. >>>>>>>>>>> What >>>>>>>>>>> do you think? >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>>>>> this, >>>>>>>>>>>> found >>>>>>>>>>>> nothing. However, most readline commands worked. Ctrl-u >>>>>>>>>>>> however >>>>>>>>>>>> did >>>>>>>>>>>> not >>>>>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>>>>> beginning of >>>>>>>>>>>> the line). I notice that the there is zero in-command >>>>>>>>>>>> documentation of >>>>>>>>>>>> command-line editing -- not even a mention. Independent >>>>>>>>>>>> from the >>>>>>>>>>>> review >>>>>>>>>>>> of this port, it seems we should have in-command >>>>>>>>>>>> documentation of >>>>>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>>>>> useful. >>>>>>>>>>> >>>>>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>>>>> History >>>>>>>>>>>> Navigation section. >>>>>>>>>>> >>>>>>>>>>> Where is that? >>>>>>>>>>> >>>>>>>>>>> Thanks, >>>>>>>>>>> Jan >>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> -Robert >>>>>>>>>>>> >>>>>>>>>>>> >>>>>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>>>>> Hi, >>>>>>>>>>>>> >>>>>>>>>>>>> I'd like to update the internal JLine used by JShell and >>>>>>>>>>>>> jjs to >>>>>>>>>>>>> JLine >>>>>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>>>>> snippet >>>>>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>>>>> Windows). >>>>>>>>>>>>> As a consequence, this patch drops EditingHistory, as it does >>>>>>>>>>>>> not >>>>>>>>>>>>> seem >>>>>>>>>>>>> to be needed anymore. >>>>>>>>>>>>> >>>>>>>>>>>>> JBS: >>>>>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>>>>> >>>>>>>>>>>>> The full patch is here: >>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>>>>> jdk.internal.le, no >>>>>>>>>>>>> changes to JLine code: >>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>>>>> >>>>>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>>>>> j.u.l.Logger, >>>>>>>>>>>>> adding hooks to wrap input streams with our stop-detecting >>>>>>>>>>>>> input >>>>>>>>>>>>> stream, adding unicode escapes to unicode characters, support >>>>>>>>>>>>> for >>>>>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>>>>> (unfortunately, >>>>>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the >>>>>>>>>>>>> changes >>>>>>>>>>>>> are >>>>>>>>>>>>> substantial): >>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>>>>> >>>>>>>>>>>>> Any feedback is welcome! >>>>>>>>>>>>> >>>>>>>>>>>>> Thanks, >>>>>>>>>>>>> Jan >>>>> >>>>> >>>>> From sundararajan.athijegannathan at oracle.com Mon Dec 10 13:52:08 2018 From: sundararajan.athijegannathan at oracle.com (Sundararajan Athijegannathan) Date: Mon, 10 Dec 2018 19:22:08 +0530 Subject: RFR: JDK-8214491: Upgrade to JLine 3.9.0 In-Reply-To: <5C0E6437.8000307@oracle.com> References: <5C0054CF.3040009@oracle.com> <5C080880.2080407@oracle.com> <5C0BE192.8010404@oracle.com> <1fd7c4d3-b446-f695-025e-3ef3c0980744@oracle.com> <5C0C1FBA.2050602@oracle.com> <6eef7f37-897c-7f02-f430-13400cdbc80a@oracle.com> <5C0D2866.6020105@oracle.com> <16793a02408.2794.4011f3a8741ca2aabce58b8b81f42d24@oracle.com> <5C0D9B1A.3080409@oracle.com> <5C0DF79F.7050500@oracle.com> <5C0E343C.8000705@oracle.com> <5C0E3C8B.2040903@oracle.com> <5C0E6437.8000307@oracle.com> Message-ID: <5C0E6F87.3020206@oracle.com> Thanks for fixing! Interactive mode manual testing is fine - tab completion, multi-line edit, built-in/external editor, history object all seem fine. +1 Thanks, -Sundar On 10/12/18, 6:33 PM, Jan Lahoda wrote: > Thanks for testing Sundar! > > I've tried to update the jjs completion handling to fix this problem > here: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.05/ > > Delta from previous patch: > http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.04.05/ > > What do you think? > > Thanks, > Jan > > On 10.12.2018 11:14, Sundararajan Athijegannathan wrote: >> Hi Jan, >> >> Tests are fine. Because there are not many UI automated tests for jjs, I >> tried to manually test few features. >> >> Tab-completion seems to be messed up. Only top-level completion seems to >> work. Property/method completion and inside multi-line method etc. don't >> seem to work. >> >> Thanks, >> -Sundar >> >> >> On 10/12/18, 3:09 PM, Jan Lahoda wrote: >>> Hi Sundar, >>> >>> Thanks for finding the problem! I was running tier1-3 tests, but seems >>> these are not there. >>> >>> Seems the problem is how JLine(3) handles "dumb" terminals, it >>> probably does not affect interactive use. So, adjusting the expected >>> output should hopefully be OK. >>> >>> Updated patch: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.04/index.html >>> Delta from previous: >>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.03.04/ >>> >>> How does this look? >>> >>> Thanks! >>> >>> Jan >>> >>> On 10.12.2018 06:20, Sundararajan Athijegannathan wrote: >>>> I built jdk and ran nashorn tests with this patch. Two tests fail with >>>> this patch - but those tests pass without this patch: >>>> >>>> [testng] Test test/nashorn/script/nosecurity/JDK-8055034.js failed >>>> at line 1 - >>>> [testng] expected: 'jjs> var x = Object.create(null);' >>>> [testng] found: 'jjs> var x = Object.create(null)jjs> jjs> >>>> print('PASSED')PASSED' >>>> >>>> [testng] Test test/nashorn/script/nosecurity/JDK-8130127.js failed >>>> at line 5 - >>>> [testng] expected: 'jjs> print('hello')' >>>> [testng] found: 'jjs> print('hello')hello' >>>> >>>> Both tests involving exec'ing jjs and comparing with the expected >>>> output. Either we need to add these to failing tests and/or address >>>> the >>>> issue before push. >>>> >>>> Thanks, >>>> -Sundar >>>> >>>> On 10/12/18, 4:15 AM, Jan Lahoda wrote: >>>>> On 9.12.2018 16:40, Robert Field wrote: >>>>>> Ok. Go ahead and incorporate the text. I'll make a separate bug to >>>>>> sync >>>>>> the representation of keys in the other help entries. >>>>> >>>>> An updated patch (with your text): >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.03/ >>>>> Delta from previous patch: >>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.02.03/ >>>>> >>>>> Thanks for the comments and for the text! Any feedback is welcome. >>>>> >>>>> Thanks, >>>>> Jan >>>>> >>>>> >>>>>> >>>>>> Robert >>>>>> >>>>>> >>>>>> On December 9, 2018 6:36:26 AM Jan Lahoda >>>>>> wrote: >>>>>> >>>>>>> Hi Robert, >>>>>>> >>>>>>> On 9.12.2018 02:40, Robert Field wrote: >>>>>>>> OK, here is my thinking on a /help keys entry. Note: I'm using >>>>>>>> the >>>>>>> >>>>>>> I think this looks great! >>>>>>> >>>>>>>> representation for keys used by the User's Guide -- which I >>>>>>>> assume is >>>>>>>> the official tech pubs style -- seems we should be consistent; If >>>>>>>> we are >>>>>>>> however, the other /help entries should be brought into compliance >>>>>>>> (they >>>>>>>> seem to be all over the map already). May make sense to spin >>>>>>>> this off >>>>>>>> as a separate bug, which I'd be happy to take on. >>>>>>> >>>>>>> I'm happy with a separate bug, if you prefer/are OK with that. Or >>>>>>> I can >>>>>>> incorporate the text into upgrade patch, whichever you prefer. >>>>>>> >>>>>>> I've updated my current patch with only a rename "editing" -> >>>>>>> "keys" >>>>>>> and >>>>>>> the fix to the jshell tool name: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.02/ >>>>>>> >>>>>>> Delta from last: >>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.01.02/ >>>>>>> >>>>>>> Jan >>>>>>> >>>>>>>> >>>>>>>> Comments welcome --- >>>>>>>> >>>>>>>> __________________________________________________________________________________________________________________________ >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> /help keys >>>>>>>> ========== >>>>>>>> >>>>>>>> The jshell tool provides line editing support to allow you to >>>>>>>> navigate >>>>>>>> within and edit snippets and commands. The current >>>>>>>> command/snippet can >>>>>>>> be edited, or prior commands/snippets can be retrieved from >>>>>>>> history, >>>>>>>> edited, and executed. This support is similar to readline/editline >>>>>>>> with >>>>>>>> simple emacs-like bindings. There are also jshell tool >>>>>>>> specific key >>>>>>>> sequences. >>>>>>>> >>>>>>>> --- Line and history navigation --- >>>>>>>> >>>>>>>> Return >>>>>>>> Enters the current snippet >>>>>>>> Left-arrow or Ctrl+B >>>>>>>> Moves backward one character >>>>>>>> Right-arrow or Ctrl+F >>>>>>>> Moves forward one character >>>>>>>> Up-arrow or Ctrl+P >>>>>>>> Moves up one line, backward through history >>>>>>>> Down arrow or Ctrl+N >>>>>>>> Moves down one line, forward through history >>>>>>>> Ctrl+A >>>>>>>> Moves to the beginning of the line >>>>>>>> Ctrl+E >>>>>>>> Moves to the end of the line >>>>>>>> Meta+B >>>>>>>> Moves backward one word >>>>>>>> Meta+F >>>>>>>> Moves forward one word >>>>>>>> Ctrl+R >>>>>>>> Search backward through history >>>>>>>> >>>>>>>> >>>>>>>> --- Line and history basic editing --- >>>>>>>> >>>>>>>> Meta+Return or Ctrl+Return (depending on platform) >>>>>>>> Insert a new line in snippet >>>>>>>> Ctrl+_ (underscore may require shift key) or Ctrl-X then Ctrl-U >>>>>>>> Undo edit - repeat to undo more edits >>>>>>>> Delete >>>>>>>> Deletes the character at or after the cursor, depending on the >>>>>>>> operating system >>>>>>>> Backspace >>>>>>>> Deletes the character before the cursor >>>>>>>> Ctrl+K >>>>>>>> Deletes the text from the cursor to the end of the line >>>>>>>> Meta+D >>>>>>>> Deletes the text from the cursor to the end of the word >>>>>>>> Ctrl+W >>>>>>>> Deletes the text from the cursor to the previous white space >>>>>>>> Ctrl+Y >>>>>>>> Pastes the most recently deleted text into the line >>>>>>>> Meta+Y >>>>>>>> After Ctrl+Y, Meta+Y cycles through previously deleted text >>>>>>>> Ctrl+X then Ctrl+K >>>>>>>> Delete whole snippet >>>>>>>> >>>>>>>> >>>>>>>> --- Shortcuts for jshell tool --- >>>>>>>> >>>>>>>> For details, see: /help shortcuts >>>>>>>> >>>>>>>> Tab >>>>>>>> Complete Java identifier or jshell command >>>>>>>> Shift+Tab then v >>>>>>>> Convert expression to variable declaration >>>>>>>> Shift+Tab then m >>>>>>>> Convert statement to method declaration >>>>>>>> Shift+Tab then i >>>>>>>> Add imports for this identifier >>>>>>>> >>>>>>>> >>>>>>>> --- More line and history editing --- >>>>>>>> >>>>>>>> Ctrl+L >>>>>>>> Clear screen and reprint snippet >>>>>>>> Ctrl+U >>>>>>>> Kill whole line >>>>>>>> Ctrl+T >>>>>>>> Transpose characters >>>>>>>> Ctrl+X then Ctrl+B >>>>>>>> Navigate to matching bracket, parenthesis, ... >>>>>>>> Ctrl+X then = >>>>>>>> Enter show current character position mode >>>>>>>> Ctrl+X then Ctrl+O >>>>>>>> Toggle overwrite characters vs insert characters >>>>>>>> Meta+C >>>>>>>> Capitalize word >>>>>>>> Meta+U >>>>>>>> Convert word to uppercase >>>>>>>> Meta+L >>>>>>>> Convert word to lowercase >>>>>>>> Meta+0 through Meta+9 then key >>>>>>>> Repeat the specified number of times >>>>>>>> >>>>>>>> Where, for example, "Ctrl+A" means hold down the control key and >>>>>>>> press A. >>>>>>>> Where "Meta" is "Alt" on many keyboards. >>>>>>>> Line editing support is derived from JLine 3. >>>>>>>> >>>>>>>> _______________________________________________________________________________ >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> -Robert >>>>>>>> >>>>>>>> >>>>>>>> >>>>>>>> On 12/8/18 11:47 AM, Jan Lahoda wrote: >>>>>>>>> On 8.12.2018 20:39, Robert Field wrote: >>>>>>>>>> Thanks for updating. >>>>>>>>>> >>>>>>>>>> Good to have /help for line editing keys, however: >>>>>>>>>> (1) The supported keys should be listed without requiring >>>>>>>>>> that >>>>>>>>>> the >>>>>>>>>> user knows or looks-up readline. More so, since only some >>>>>>>>>> readline >>>>>>>>>> keys >>>>>>>>>> are supposed. >>>>>>>>>> (2) "/edit" is a command, so with this change, typing "/help >>>>>>>>>> edit" >>>>>>>>>> would give both the /edit and editing help -- which would be >>>>>>>>>> confusing. >>>>>>>>>> I suggest "/help keys", there are no "k" help items. >>>>>>>>> >>>>>>>>> Will do. >>>>>>>>> >>>>>>>>>> (3) In jshell tool online docs the tool is spelled "jshell >>>>>>>>>> tool" >>>>>>>>>> I'd be happy to write up suggested text. >>>>>>>>> >>>>>>>>> Thanks, that would be very welcome! >>>>>>>>> >>>>>>>>>> >>>>>>>>>> As to the alternative patch: I understand the motivation, it >>>>>>>>>> would be >>>>>>>>>> nice to just use the natural "Enter" as new line. Unfortunately >>>>>>>>>> it's >>>>>>>>>> functionality is then overloaded. I believe the alternative >>>>>>>>>> will be >>>>>>>>>> confusing and awkward: >>>>>>>>>> (1) It breaks backward compatibility in user experience, >>>>>>>>>> Enter >>>>>>>>>> has >>>>>>>>>> always been accept/evaluate >>>>>>>>>> (2) It would be very awkward and non-intuitive (particularly >>>>>>>>>> in a >>>>>>>>>> long multiline snippet) to have to navigate to the end of the >>>>>>>>>> snippet to >>>>>>>>>> accept. >>>>>>>>>> Note: must be the end both vertically and horizontally. >>>>>>>>>> (3) It is inconsistent: Mid snippet Enter on one line does >>>>>>>>>> accept. >>>>>>>>>> However, on a continuation line (say after "int x =") it adds a >>>>>>>>>> new >>>>>>>>>> line >>>>>>>>>> instead. >>>>>>>>>> (4) It doesn't solve the problem for the most common >>>>>>>>>> location for >>>>>>>>>> adding a new line, the end of snippet -- thus introducing more >>>>>>>>>> inconsistency. >>>>>>>>> >>>>>>>>> Ok. This was meant more as a backup in case there's no reasonable >>>>>>>>> shortcut we could use to add new lines. >>>>>>>>> >>>>>>>>> Thanks for the comments! >>>>>>>>> >>>>>>>>> Jan >>>>>>>>> >>>>>>>>>> >>>>>>>>>> Thanks, >>>>>>>>>> Robert >>>>>>>>>> >>>>>>>>>> >>>>>>>>>> On 12/8/18 7:21 AM, Jan Lahoda wrote: >>>>>>>>>>> Hi, >>>>>>>>>>> >>>>>>>>>>> I've updated the patch to reflect the comments so far, the >>>>>>>>>>> current >>>>>>>>>>> version is here: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01/ >>>>>>>>>>> Delta since the previous version is here for convenience: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01/ >>>>>>>>>>> >>>>>>>>>>> In this version, while editing a snippet, a new line can be >>>>>>>>>>> added >>>>>>>>>>> using Alt-Enter (on platforms that support that), or >>>>>>>>>>> Ctrl-Enter (on >>>>>>>>>>> Windows). >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> And alternative patch is here: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.01a/ >>>>>>>>>>> Delta: >>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.delta.00.01a/ >>>>>>>>>>> >>>>>>>>>>> >>>>>>>>>>> In the alternative version, Enter will only "confirm" >>>>>>>>>>> multi-line >>>>>>>>>>> snippet when the cursor is at the end of the snippet, >>>>>>>>>>> otherwise it >>>>>>>>>>> will add a new line (so that a special shortcut is not needed; >>>>>>>>>>> but a >>>>>>>>>>> snippet cannot be "confirmed" by pressing Enter in the middle >>>>>>>>>>> of a >>>>>>>>>>> multi-line snippet.) >>>>>>>>>>> >>>>>>>>>>> The only difference between the .01 and .01a patches is the way >>>>>>>>>>> they >>>>>>>>>>> allow to add new lines into the multi-line snippets. Other >>>>>>>>>>> changes >>>>>>>>>>> are >>>>>>>>>>> the same. >>>>>>>>>>> >>>>>>>>>>> Any feedback on this is welcome. >>>>>>>>>>> >>>>>>>>>>> Thanks! >>>>>>>>>>> >>>>>>>>>>> Jan >>>>>>>>>>> >>>>>>>>>>> On 5.12.2018 18:18, Jan Lahoda wrote: >>>>>>>>>>>> Hi Robert, >>>>>>>>>>>> >>>>>>>>>>>> On 4.12.2018 23:59, Robert Field wrote: >>>>>>>>>>>>> I saw no issues with JShell tool and test portions of the >>>>>>>>>>>>> webrev. I >>>>>>>>>>>>> did >>>>>>>>>>>>> not review the nashorn changes. >>>>>>>>>>>> >>>>>>>>>>>> Thanks for looking at this! >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> Testing it: editing multi-line snippets is vastly easier and >>>>>>>>>>>>> more >>>>>>>>>>>>> intuitive. >>>>>>>>>>>>> There is one issue, with the old mechanism, as horridly >>>>>>>>>>>>> clunky >>>>>>>>>>>>> as it >>>>>>>>>>>>> was, you could add new lines of code (a frequently needed >>>>>>>>>>>>> functionality). >>>>>>>>>>>>> Since is accept, I could find no way to add lines >>>>>>>>>>>>> with >>>>>>>>>>>>> this >>>>>>>>>>>>> JLine 3 version. Thoughts? >>>>>>>>>>>> >>>>>>>>>>>> One possibility that comes to mind: pressing Enter inside the >>>>>>>>>>>> snippet >>>>>>>>>>>> would add a new line, Enter at the very end of a (complete) >>>>>>>>>>>> snippet >>>>>>>>>>>> would confirm that snippet. Could be fairly >>>>>>>>>>>> convenient/intuitive. >>>>>>>>>>>> What >>>>>>>>>>>> do you think? >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> I looked into readline commands as an approach to addressing >>>>>>>>>>>>> this, >>>>>>>>>>>>> found >>>>>>>>>>>>> nothing. However, most readline commands worked. Ctrl-u >>>>>>>>>>>>> however >>>>>>>>>>>>> did >>>>>>>>>>>>> not >>>>>>>>>>>>> behave as documented in readline (instead deleting to the >>>>>>>>>>>>> beginning of >>>>>>>>>>>>> the line). I notice that the there is zero in-command >>>>>>>>>>>>> documentation of >>>>>>>>>>>>> command-line editing -- not even a mention. Independent >>>>>>>>>>>>> from the >>>>>>>>>>>>> review >>>>>>>>>>>>> of this port, it seems we should have in-command >>>>>>>>>>>>> documentation of >>>>>>>>>>>>> command editing -- even more so now that multiline editing is >>>>>>>>>>>>> useful. >>>>>>>>>>>> >>>>>>>>>>>> This is about enhancing /help, right? I'll see what I can do. >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> The JShell User Manual will also need a little edit in the >>>>>>>>>>>>> History >>>>>>>>>>>>> Navigation section. >>>>>>>>>>>> >>>>>>>>>>>> Where is that? >>>>>>>>>>>> >>>>>>>>>>>> Thanks, >>>>>>>>>>>> Jan >>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> -Robert >>>>>>>>>>>>> >>>>>>>>>>>>> >>>>>>>>>>>>> On 11/29/18 1:06 PM, Jan Lahoda wrote: >>>>>>>>>>>>>> Hi, >>>>>>>>>>>>>> >>>>>>>>>>>>>> I'd like to update the internal JLine used by JShell and >>>>>>>>>>>>>> jjs to >>>>>>>>>>>>>> JLine >>>>>>>>>>>>>> 3.9.0. Two notable advantages of this version is multi-line >>>>>>>>>>>>>> snippet >>>>>>>>>>>>>> editing and better UI on Windows (escape sequence support on >>>>>>>>>>>>>> Windows). >>>>>>>>>>>>>> As a consequence, this patch drops EditingHistory, as it >>>>>>>>>>>>>> does >>>>>>>>>>>>>> not >>>>>>>>>>>>>> seem >>>>>>>>>>>>>> to be needed anymore. >>>>>>>>>>>>>> >>>>>>>>>>>>>> JBS: >>>>>>>>>>>>>> https://bugs.openjdk.java.net/browse/JDK-8214491 >>>>>>>>>>>>>> >>>>>>>>>>>>>> The full patch is here: >>>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00/ >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> To make the changes more clear, I've split it into two: >>>>>>>>>>>>>> -replacement of existing JLine with the new on in >>>>>>>>>>>>>> jdk.internal.le, no >>>>>>>>>>>>>> changes to JLine code: >>>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.replace/ >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> -tweaks to JLine (repackaging, eliminating references to >>>>>>>>>>>>>> j.u.l.Logger, >>>>>>>>>>>>>> adding hooks to wrap input streams with our stop-detecting >>>>>>>>>>>>>> input >>>>>>>>>>>>>> stream, adding unicode escapes to unicode characters, >>>>>>>>>>>>>> support >>>>>>>>>>>>>> for >>>>>>>>>>>>>> Windows without JNA), adjustments to JShell and jjs >>>>>>>>>>>>>> (unfortunately, >>>>>>>>>>>>>> 3.9.0 is not compatible with the JLine 2 branch, so the >>>>>>>>>>>>>> changes >>>>>>>>>>>>>> are >>>>>>>>>>>>>> substantial): >>>>>>>>>>>>>> http://cr.openjdk.java.net/~jlahoda/8214491/webrev.00.update/ >>>>>>>>>>>>>> >>>>>>>>>>>>>> >>>>>>>>>>>>>> Any feedback is welcome! >>>>>>>>>>>>>> >>>>>>>>>>>>>> Thanks, >>>>>>>>>>>>>> Jan >>>>>> >>>>>> >>>>>>