Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Newline duplicaton on pasting into IPython console #14392

Open
kalocsaibotond opened this issue Apr 9, 2024 · 1 comment
Open

Newline duplicaton on pasting into IPython console #14392

kalocsaibotond opened this issue Apr 9, 2024 · 1 comment

Comments

@kalocsaibotond
Copy link

kalocsaibotond commented Apr 9, 2024

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 .

@Carreau
Copy link
Member

Carreau commented Apr 10, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants