Bug 789355 - migrate CLI and Agent from JLine to JBoss jreadline
migrate CLI and Agent from JLine to JBoss jreadline
Status: NEW
Product: RHQ Project
Classification: Other
Component: Agent, CLI (Show other bugs)
4.4
Unspecified Unspecified
medium Severity medium (vote)
: ---
: ---
Assigned To: RHQ Project Maintainer
Mike Foley
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-02-10 10:06 EST by Ian Springer
Modified: 2015-02-01 18:29 EST (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Ian Springer 2012-02-10 10:06:05 EST
1.0 contains a whole slew of bugfixes, so it looks like a worthwhile upgrade. Here's the git log from https://github.com/jline/jline.git that shows all the fixes that went into 1.0:

commit 3d9817001eae34e220e1cf78f2670814f69e0274
Author: Joris Kuipers <joriskuipers@gmail.com>
Date:   Mon Apr 11 22:05:25 2011 +0200

    patched getCursorPosition to strip ANSI codes from the prompt to calculate its display length

commit 8509b6570a2a2e8179e0f09d3cca9a5dcc4c590b
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Mon Apr 11 10:46:54 2011 -0500

    Bump to 1.0.

commit c0e4b8319fae8c1381bdac7d2fe871bc46dd4653
Merge: d538ed5 ef7fab5
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 8 00:16:10 2011 +0200

    Merge branch 'master' of github.com:hns/jline
    
    Conflicts:
    	src/main/java/jline/ConsoleReader.java
    	src/main/java/jline/UnixTerminal.java

commit d538ed5161e4ccab877153651ccc61aaa8efbba1
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Tue Apr 5 12:19:09 2011 -0500

    Update pom for 1.0-SNAPSHOT

commit 5fff5fdb846372d7e7485f4e4dd0a09efa38af7b
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Tue Apr 5 11:43:51 2011 -0500

    We found an issue when running it on OS X, we get this exception:
    
    java.util.zip.ZipException: error in opening zip file
        at java.util.zip.ZipFile.open(Native Method)
        at java.util.zip.ZipFile.<init>(ZipFile.java:114)
        at java.util.jar.JarFile.<init>(JarFile.java:135)
        at java.util.jar.JarFile.<init>(JarFile.java:99)
        at jline.ClassNameCompletor.getClassNames(ClassNameCompletor.java:89)
        at jline.ClassNameCompletor.<init>(ClassNameCompletor.java:33)
    
    adding some debug here and there, we found that the ClassNameCompletor tried to find some non jar files, i.e:
    /System/Library/Java/Extensions/libAppleScriptEngine.jnilib
    
    From 6dab177d2eb23a99933fdffae4c6fb7ebd33d2c9 Mon Sep 17 00:00:00 2001
    From: Alejandro Revilla <apr@jpos.org>
    Date: Thu, 16 Dec 2010 14:02:09 -0200
    Subject: [PATCH] Ignore non jars (i.e. .jnilib, etc)

commit be1515737d105bb8fb295be76e5b7e6aef784a68
Author: Rodrigo Rosenfeld Rosas <rodrigo@geocontrol.com.br>
Date:   Tue Oct 19 15:43:44 2010 -0200

    Revert commit 95730df: fix behavior for the delete key.
    
    Signed-off-by: Charles Oliver Nutter <headius@headius.com>

commit 3582abca134ace8d1cc351204f70813506ea4a64
Author: Rodrigo Rosenfeld Rosas <rr_rosas@yahoo.com.br>
Date:   Mon Nov 1 13:37:43 2010 -0200

    Separate normal unix bindings from Mac OS bindings
    
    The Delete behavior is the only change currently.
    
    Signed-off-by: Charles Oliver Nutter <headius@headius.com>

commit fb81820d61f39fe0b121365c85081eb92c2357a3
Author: Rodrigo Rosenfeld Rosas <rr_rosas@yahoo.com.br>
Date:   Mon Nov 1 13:40:45 2010 -0200

    Refactoring: code simplified
    
    Signed-off-by: Charles Oliver Nutter <headius@headius.com>

commit d65234151d3b8fce2233cd4fe6d9821cb4636566
Author: Rodrigo Rosenfeld Rosas <rodrigo@geocontrol.com.br>
Date:   Tue Oct 19 15:21:43 2010 -0200

    Fix .jlinebindings.properties overriding.
    
    Signed-off-by: Charles Oliver Nutter <headius@headius.com>

commit 406854b97c5c9aa7d55320dbd47b5057f30aae65
Author: Peter Collingbourne <peter@pcc.me.uk>
Date:   Fri Apr 9 22:31:15 2010 +0100

    Fix behaviour of ConsoleReader.setBuffer() if cursor is not at end of line
    
    If the cursor is not at the end of the line and the old and new
    buffers have a common prefix then setBuffer will call backspace
    with an incorrect argument and the buffer will be mangled.  This
    patch fixes the bug.
    
    Signed-off-by: Charles Oliver Nutter <headius@headius.com>

commit 1256af3027811d4369c8b3d454731f19d1aada1e
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 16:03:17 2010 +0200

    Fix for 1806950: No way to replace ConsoleRunner TAB-completors

commit b2b71b7b9a75a01477ffb90f6f66497d62d0c50c
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 15:50:05 2010 +0200

    Fix for 2333609: disable console property incorrect in documentation

commit e1613afeeb9082cefbfa8853f7e93525be17e006
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 14:09:31 2010 +0200

    Fix for 2895546: WindowsTerminal.loadLibrary patches
    
    Patches from Joris Kuipers

commit 4fa43f141cb94eaa55f6249a046d1c24fa2b56c0
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 14:00:21 2010 +0200

    Another fix for leaking streams: need to get and close Process.getOutputStream too.

commit 5e6d1b17ea8242ddee026fffa566222b6b0baf04
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 13:45:01 2010 +0200

    Fix for #2608344: Ctrl-D to delete character when buffer is not empty

commit faa159d4a7ef48fa61def368a16864cc5107fd17
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Thu May 13 13:32:10 2010 +0200

    Fix lazy "leak" of streams during stty/exec logic for UnixTerminal.

commit ef7fab5d304e81618de786f77862fbfee89f0677
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 18:42:18 2010 +0200

    Restore original behaviour to put cursor on beginning of match in CTRL-R search.

commit 638b5217fd4c877a86c1c70e7baf9b31abf3ba72
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 17:35:55 2010 +0200

    Make sure searchIndex is initialized when we enter CTRL-R search mode

commit d602e9d23c40f358f14b5bbb5aaef410870db64e
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 17:25:18 2010 +0200

    Add PREV_WORD as CTRL-X to keybindings to make the unit tests pass.

commit 7cf67c79747053082da1b565451f1654ab2076d9
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 14:14:41 2010 +0200

    Various minor fixes for CTRL-R history search mode.

commit 43e61dfc99df05c1456effd1db2f253e0f626a91
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 14:13:21 2010 +0200

    Make Escape key available on UnixTerminals

commit af73cc5480db8e8c9830b4708668519986821af0
Author: Mikio L. Braun <mikio@cs.tu-berlin.de>
Date:   Thu Aug 13 13:04:32 2009 +0200

    fixed the CTRL-D issue
    
    If the buffer is empty, CTRL-D exits, if not,
    it deletes the next character.
    
    Also fixed it for the DELETE key.

commit 1e6c9577450d0d6511b4a3a902086d325aa42f09
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Fri Apr 30 11:49:59 2010 +0200

    adding basic search backwards capabilities
    
    CTRL-R now maps to the reverse-i-search as known from readline.
    
    Still not perfect, though:
    
    - not possible to leave mode through ESC or CTRL-G because the
      terminal is not really in raw mode, as it seems.
    - Hitting CTRL-R twice does not lead to the last search term
      being used (bug?)

commit d154af3b4cfa17472bdc7223e70ad3b22ff6be9b
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Wed Oct 21 22:01:28 2009 +0200

    Fix delete key regression on non-ANSI terminals

commit de5f3664425cbfeb683e7b0c8abd40f475444cbc
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Wed Oct 21 21:22:02 2009 +0200

    Use some ANSI magic to get most wrapped line stuff working.

commit 31e883a13f0fdd3385443231294fd36389a02243
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Wed Oct 21 01:08:05 2009 +0200

    Dirty fix for backspace not working over multiline input

commit 5b9a192c3187f6894d53d13267837cc373ce9a0b
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Wed Oct 21 00:24:04 2009 +0200

    Presumably fix backspace on Mac OS X and other BSD based systems. Patch adapted from http://bugs.jython.org/issue1293

commit e1c87ff6bc173937302773302f750a9c4bcfce2b
Author: Hannes Wallnöfer <hannesw@gmail.com>
Date:   Wed Oct 21 00:22:23 2009 +0200

    Fix delete button on Ubuntu

commit 7d9e0b984e954390ae6af18b87a4b4083c2f5373
Author: Guillaume Nodet <gnodet@gnodet-macpro.local>
Date:   Thu Jul 9 13:57:36 2009 +0200

    Allow UnixTerminal subclasses to access the stty() method

commit 7d7b91292a7b31dd3a7eff462627ca688e21493c
Author: Guillaume Nodet <gnodet@gnodet-macpro.local>
Date:   Thu Jul 9 13:35:42 2009 +0200

    Use the provided terminal when determining the height / width in the ConsoleReader

commit 0395d2e5af376346ecb45261b0f6352925815796
Author: Charles Oliver Nutter <headius@headius.com>
Date:   Tue Jul 21 11:02:48 2009 -0500

    Fix to allow Jline as an OSGi bundle, by Guillaume Nodet.
Comment 1 Mike Foley 2012-02-13 11:59:37 EST
per triage 2/13/2012 (asantos, crouch, foley, loleary)
Comment 2 Ian Springer 2012-05-07 11:03:27 EDT
Actually, it looks like we should eventually switch over to jreadline, which is what AS7 will be switching to for AS 7.2, for the CLI and the Agent Command Prompt...

From a post to the jboss-as7-dev list by Stale Pedersen:

hi, to give you the history behind jreadline it started because i wanted 
vi-mode in jboss-cli. i started hacking on jline and asked the people 
behind it if they would be interested in the new features i wrote. the 
response was that they had stopped development of jline and would rather 
see me provide that for jline2.
i started with jline2, but it took 2+ months for pull requests to be 
accepted and one night i thought i could make something better myself. 
so i did.

to answer your question, jline2 do have issues with multiple line 
breaking, etc. i know forge is using it, but they have heavily modified 
it and has basically forked it into forge-core afaik.
mike brock rewrote the input functionality for forge-jline2 which 
jreadline is also using.
its been a while since i talked to lincoln regarding using jreadline, 
but we'll probably pick that up later if he thinks its useful.

ståle

Note You need to log in before you can comment on or make changes to this bug.