cider icon indicating copy to clipboard operation
cider copied to clipboard

REPL buffer doesn't show new output when the prompt is on the first line

Open alexander-yakushev opened this issue 6 years ago • 10 comments

However, if REPL prompt is on the second line or lower, it works correctly. In my case, REPL prompt gets on the first line after cider-repl-clear-buffer.

Latest CIDER from master.

bug

alexander-yakushev avatar Feb 21 '19 12:02 alexander-yakushev

That’s one super weird bug! Thanks for reporting it!

bbatsov avatar Feb 21 '19 17:02 bbatsov

Thanks for the report; let me know how you get on with the pushed fix.

cichli avatar Feb 21 '19 23:02 cichli

I can confirm that the above example works now, but the issue hasn't been solved completely. Steps to reproduce:

  1. cider-repl-clear-buffer (leaves only user=>).
  2. Press Return in the REPL buffer (now have:
user=>
user=>
  1. (println "Hello") C-x C-e from the code buffer. The output doesn't appear.

alexander-yakushev avatar Mar 28 '19 12:03 alexander-yakushev

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution and understanding!

stale[bot] avatar May 08 '19 15:05 stale[bot]

Nooo! The bug is still there 😄

alexander-yakushev avatar May 08 '19 15:05 alexander-yakushev

Nooo! The bug is still there 😄

Indeed, I can reproduce it using your recipe from above.

manuel-uberti avatar May 15 '24 06:05 manuel-uberti

Actually, setting cider-repl-display-output-before-window-boundaries to t fixes it. Sorry for the noise.

manuel-uberti avatar May 15 '24 06:05 manuel-uberti

@manuel-uberti Turning that variable on hurts performance when a lot of data is printed to the REPL. For myself, I made a very low-tech solution:

(defun cider-clear-repl-buffer-with-shift ()
    "Needed to side-step https://github.com/clojure-emacs/cider/issues/2595."
    (interactive)
    (cider-repl-clear-buffer)
    (insert "(symbol \"\")")
    (cider-repl-return))

And then I bind it to C-c C-l in the REPL buffer. Now, when I clear the REPL, the prompt is on the second line, and all output becomes immediately visible.

alexander-yakushev avatar May 15 '24 06:05 alexander-yakushev

More context here https://github.com/clojure-emacs/cider/issues/3219 Basically we had a fix, but I had to make it "optional" because it degraded the performance quite a lot for some people.

bbatsov avatar May 15 '24 07:05 bbatsov

Thank you both for the explanation. I see what you mean @alexander-yakushev and I think I'll use your snippet.

manuel-uberti avatar May 15 '24 08:05 manuel-uberti