7

JShell by default enables a persistent history of everything typed, which can be recalled by pressing the up arrow.

Where is the setting to turn this ❝feature❞ off?

Also, how do I even clear the current history? Maybe I'm dumb but I can't figure out the command. /reset seems to do nothing.

Boann
  • 48,794
  • 16
  • 117
  • 146
  • Really don't think there is yet an option for that(`/help /history` doesn't display one either), considering `/history -all` is what you're referring to. Possibly looking into https://github.com/jline/jline2/wiki/Configuration-Properties and making use of one such might help. Btw, I'd reached there from the article by Robert Field => http://cr.openjdk.java.net/~rfield/tutorial/JShellTutorial.html#search-and-more.... and to understand better, what is the need of doing that anyway? – Naman Oct 15 '18 at 02:31
  • Well maybe disable things like autocomplete, should be good or easy to run inside emacs for example – anquegi May 08 '19 at 20:48

1 Answers1

3

Also, how do I even clear the current history?

What I'm proposing is clearly a hack but it seems to be working, at least in Windows 10 with JDK11.0.4:

Run Registry Editor and search for the '/J/Shell' key. Once found (under HKCU and HKUsers), delete all /H/I/S/T/O/R/Y_/L/I/N/E_ values under HKUsers. That fixed it for me; so far, the darn thing works, nothing looks broken...

Igor Soudakevitch
  • 671
  • 10
  • 19