When my REPL input fills the line, previously displayed lines get "eaten"

Say I am working at the REPL, and I have a few inputs and outputs displayed:

julia> 2 + 2
4

julia> exp(6)
403.4287934927351

julia>

Next I have a really long input line that exactly fills the width of my terminal:

julia> 2 + 2
4

julia> exp(6)
403.4287934927351

julia>"Now look what happens when I type something that goes to the end of the line. ----->

If I leave the line at that length to go back and edit something, lines above the one I’m editing start disappearing, typically one per keystroke. After hitting the left arrow once:

julia> 2 + 2
4

julia> exp(6)
403.4287934927351
julia>"Now look what happens when I type something that goes to the end of the line. ----->

Notice the lowest empty line has been “eaten”. Then hitting the left arrow 3 more times, the next 3 lines get eaten too:

julia> 2 + 2
4
julia>"Now look what happens when I type something that goes to the end of the line. ----->

If I add a character, so that the line carries over onto the next line, the disappearing behavior stops (after eating one more line):

julia> 2 + 2
julia> "Now look what happens when I type something that goes to the end of the line. --f---
>

This has been my REPL experience for as long as I can remember. Mostly I’ve just dealt with or avoided it, but I’m finally deciding to ask about it :sweat_smile:. Is there any way to change this behavior? Is it a bug in the way the REPL display works? Apologies if this is a duplicate, but I couldn’t find any topics that already addressed this.

1 Like

This sounds like a problem with a specific terminal emulator. I don’t see it on my computer. What terminal emulator are you using? What’s the setting of your TERM environment variable (assuming that you are using Linux)?

I see it on the Julia REPL in all of Windows’ builtin terminals, which can be nested in other apps. It’s quite literally “the width of my terminal”, the line-eating per keystroke can be set up by either typing a long enough line or by shrinking the terminal width to the line. Never found a Github issue about it.