bhauman / rebel-readline

Terminal readline library for Clojure dialects
Eclipse Public License 1.0
684 stars 37 forks source link

0x0D (newline) literals in .rebel_readline_history breaks repl #198

Open djtango opened 5 years ago

djtango commented 5 years ago

If I accidentally enter 0x0D newline characters into my session and they are saved into the repl history, on subsequent startup an exception is thrown:

[Rebel readline] Type :repl/help for online help info
Execution error (StringIndexOutOfBoundsException) at java.lang.String/substring (String.java:1967).
String index out of range: -1

Additional evaluation of forms also throws an exception:

user=> (println "foo")
Execution error (IndexOutOfBoundsException) at java.util.SubList/<init> (AbstractList.java:620).
fromIndex = -11

Steps to replicate: