dundalek / closh

Bash-like shell based on Clojure
Eclipse Public License 1.0
1.62k stars 66 forks source link

Print + flush outputs a newline with rebel readline #122

Open dundalek opened 5 years ago

dundalek commented 5 years ago

Run following in a repl:

(defn my-fn [] (print "Namae wa? ") (flush) (->> (read-line) (println "Cheers")))
(my-fn)

When using rebel frontend clojure -m closh.zero.frontend.rebel the cursor will be incorrectly on a next line after the print. The same behavior happends when using rebel-readline directly with clojure -Sdeps "{:deps {com.bhauman/rebel-readline {:mvn/version \"0.1.4\"}}}" -m rebel-readline.main.

When running with the plain frontend clojure -m closh.zero.frontend.main the cursor is correctly on the same line.

Therefore the issue is likely caused by something in rebel readline.

dundalek commented 5 years ago

Looks like there is already an issue reported for rebel-readline: https://github.com/bhauman/rebel-readline/issues/175