This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 260758

Summary: [JShell] commands from previous session aren't kept in the history
Product: java Reporter: Jaroslav Tulach <jtulach>
Component: JShellAssignee: Svata Dedic <sdedic>
Status: RESOLVED FIXED    
Severity: normal CC: muellermi
Priority: P2    
Version: 8.2   
Hardware: PC   
OS: Linux   
Issue Type: DEFECT Exception Reporter:

Description Jaroslav Tulach 2016-05-10 07:41:32 UTC
In bash, I can use arrow up to access commands used recently in other, no longer open shells. I find it quite useful as often you need to re-execute the same task over and over again.

In JShell integration the history is lost. Thus I need to type over and over the same commands. I find it annoying.
Comment 1 Jaroslav Tulach 2016-06-06 05:31:34 UTC
The feature is still missing even in most recent build of Java "REPL" NetBeans support: http://deadlock.netbeans.org/job/prototypes-repl/13/
Comment 2 muellermi 2016-06-06 11:52:06 UTC
Is this a NetBeans feature or JShell feature?
As far as I remember (I'm going to check tonight), I could browse jshell's history from a former usage (I used jshell at the Ubuntu terminal before)
Comment 3 muellermi 2016-06-06 20:25:09 UTC
I just double-checked on Ubuntu:

* open jshell at linux terminal
* key in some statements
* /exit
* open jshell at linux terminal
* try arrow up: history ok
* /exit
* start NetBeans
* open jshell at NB terminal
* try arrow up: history ok
Comment 4 Jaroslav Tulach 2016-06-07 03:27:46 UTC
Glad to hear that in command line version the history works across invocations. I've just tried the NetBeansREPL build #13:

Tools/Open Java Platform Shell

type something. Evaluate. Close the window (btw. I tried "/exit", but that doesn't work). Open another

Tools/Open Java Platform Shell

the arrow up doesn't show the commands from the previous session.
Comment 5 muellermi 2016-06-07 04:49:50 UTC
amazing: 
Tools/Open Java Platform Shell

I checked something different: jshell within NetBeans terminal window.

I'm goin to check the new tool by the end of this week
Comment 6 Svata Dedic 2016-06-07 08:40:36 UTC
OK OK, should be the history local to the project (in the case Run/Open JShell is used) or is it sufficient to have one global history for all JShells ?
Comment 7 Jaroslav Tulach 2016-06-07 09:34:16 UTC
I don't have any strong preference. Choose what is easier.

Btw. Bash has local history until you exit which gets shared when you start new. Horrible but I could live with that too...
Comment 8 Svata Dedic 2016-10-07 08:47:37 UTC
Moving to an appropriate component
Comment 9 Svata Dedic 2016-11-22 15:53:09 UTC
Please note that although the history from preceding sessions will be available, the history item might not be valid in the current session: some referenced symbols may not be defined (relevant commands from history were not replayed)
Comment 10 Svata Dedic 2016-11-25 12:31:44 UTC
Implemented in jet-main#1c221d223805
Comment 11 Quality Engineering 2016-11-27 02:51:38 UTC
Integrated into 'main-silver', will be available in build *201611270001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/1c221d223805
User: Svata Dedic <sdedic@netbeans.org>
Log: #260758: persistent history provided for projects and for the global shell