ipython / ipython

Official repository for IPython itself. Other repos in the IPython organization contain things like the website, documentation builds, etc.

Home Page:https://ipython.readthedocs.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Newline duplicaton on pasting into IPython console

kalocsaibotond opened this issue · comments

I test my python code using the IPython console on Windows 10, however, when I paste chunks of code into it, the newlines in the pasted code are duplicated.
I know that there is a %paste magic for that, but I am doing the pasting in a convenient automated way, using iron.nvim repl, since I use neovim. Though I could reproduce the pasting newline duplication manually as well.

I also tried out the --simple-prompt command line option. Even though it fixes the double newlines, it is unusable because it enters subchunks of the code that separated with more spaces. Of course this results in a ton of error messages from the python interpreter, understandably.

Fortunately, in python, the newline duplicatation rarely ruins the code, but it is still interfereing with the development process.

To be specific, I mean the following under newline duplication:
If I have the following piece of code:

test_string = """
ipython
repl
pasting
test
"""

When I copy and paste this code chunk, IPython will paste the following:

test_string = """

ipython

repl

pasting

test

"""

I am using IPython 8.20.0 .

Does it do it with any prompt_toolkit application ? Does windows have other terminal emulators that do that ? I don't think this is an IPython issue.