Julia: Julia REPL is slow when pasting a large block of code.

Created on 7 Apr 2016  Â·  23Comments  Â·  Source: JuliaLang/julia

If i copy/paste a large block of code spanning multiple lines directly into the REPL then it is really slow. It looks like each code block is backspaced away and then completely retyped for every character in the pasted block of code.

To illustrate: try copy/pasting this piece of code into the REPL
https://raw.githubusercontent.com/jheinen/GR.jl/master/examples/mandel.jl

REPL windows

Most helpful comment

I've found that if you shrink the window to show just one line, windows cmd.exe is able to update the screen much faster

All 23 comments

This is on windows right?

Yes. On Windows.

Some related discussion: https://groups.google.com/forum/#!topic/julia-users/MoNy5BLIbSs and #7267

I've found that if you shrink the window to show just one line, windows cmd.exe is able to update the screen much faster

Thank you. Additional info : it makes no difference if i use conemu or plain cmd.exe.

conemu is also backed by cmd.exe, it just hides the window and copies the text from that window, as it appears, onto the text area you can see.

I suppose Windows does not have bracketed paste mode. Is our heuristic to not redraw when inserting at the end not firing?

we don't have a heuristic for that, since the printing logic keeps the count of how many lines have been printed

I don't understand. We definitely used to have that heuristic. If the cursor is at the end of a non-full line, and we're inserting one character, there's no need to clear the screen.

true, the heuristic (in edit_insert – LineEdit.jl:449) looks like it isn't supposed to be using this information (which is likely private to refresh_multi_line – LineEdit.jl:1034)

Looks like somebody (probably me) just forgot that the position in the buffer is not the same as the column offset if there's multiple lines. Seems like that heuristic should be fixable.

It does this on Mac in iTerm2 but not in Terminal.app.

This should be significantly improved now with #17868. The original code is now pretty much instant to paste. Please reopen if there are still problems with the Windows pasting.

julia_slow_repl

I believe I am getting this again on Julia 1.1. - editor VSCode, Win10, ohMyRepl used in the example

OhMyREPL makes this worse (on Windows).

Please, reopen!

My REPL flickers heavily when I paste a large text. This is under Win10 and several Julia versions (at least 1.0.x, 1.3.0, and also 1.4.0).

capture
capture2

I posted this issue on Discourse to no avail.

Are you using OhMyREPL?

No.

I just tried it on a MacOS 10.11.6 with Julia 1.3.0 and pasting works fine. The issue seems to be on Windows only.

I suffered this problem on Emacs ansi-term for a long time.... Also, OhMyREPL makes it even worse.

On a Windows machine?

No, on a macbook pro.

Edit. Pretty sure this is fixed on 1.6/master

Was this page helpful?
0 / 5 - 0 ratings

Related issues

yurivish picture yurivish  Â·  3Comments

i-apellaniz picture i-apellaniz  Â·  3Comments

TotalVerb picture TotalVerb  Â·  3Comments

manor picture manor  Â·  3Comments

omus picture omus  Â·  3Comments