Flush adds an extra newline
Opened this issue · 1 comments
aaronlahey commented
Hi! It seems that calling (flush)
adds an extra newline to the output. Is this expected or is there a way to disable this behavior?
Thanks!
~ :: clj
Clojure 1.9.0
user=> (do (print \.) (flush) (print \.) (flush))
..nil
user=>
~ :: clojure -Sdeps "{:deps {com.bhauman/rebel-readline {:mvn/version \"0.1.4\"}}}" -m rebel-readline.main
[Rebel readline] Type :repl/help for online help info
user=> (do (print \.) (flush) (print \.) (flush))
.
.
nil
dundalek commented
I encountered this also. Looks like it is an intentional behavior to ensure the prompt is displayed properly:
An alternative might be to read out the cursor positon and insert a newline only if the cursor is not on the first column.