I took a look at 1.8 (somewhat outdated, I presume), and there is a new feature in REPL: each time I paste strings, it adds additional indentation. So this ends up rather ugly.
flameshot-2021-08-06T17-21-12.png
Does anyone know, when and where exactly it was introduced?
Does that happen consistently? I've seen a similarly weird behaviour from time to time in stable versions, but it doesn't bother me too much because it's fairly rare
It just happened and then disappeared again.
Very strange, I do not really know what is going.
This probably comes from the "auto-indent" feature of the REPL (set in Base.active_repl.options.auto_indent
). When you press enter, the next line is indented like the current one. Then, when you paste some code, this should be disabled (the REPL normally recognizes that you are pasting, so auto-indent is temporarily disabled). But in some circumstances (I don't remember when, maybe with some Windows shell?), this is not recognized, so each new line of the pasted code, presumably already indented, gets more spaces added in front because of auto-indentation.
Yep, that's what I thought as well.
It was not a windows shell, though, it was paste in neovim terminal.
But at the moment when I have figured out how to turn auto indentation off, this effect disappeared. Pure magic :-)
Probably an issue with bracketed pasting; some terminals (notably Windows' cmd) don't support it, so you get auto indentation because it looks like someone is just typing code to the REPL.
It was neovim terminal, not windows.
Now I know the cure, but I wonder, why it appear and disappear again \_(%)_/
Last updated: Nov 22 2024 at 04:41 UTC