Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

367
Views
VS Code integrated terminal is messing up the clipboard python code when pasting

In a clean installation of VS Code (1.59.1) the code pasted in the integrated terminal has a different indentation than the one available in the editor. I tried changing the parameter "editor.formatOnPaste": true and there was no improvement. This problem does not exist when I copy the same content and paste it into the powershell or command prompt. Any ideas on how to solve this?

error description

enter image description here

over 4 years ago · Santiago Trujillo
3 answers
Answer question

0

I just tried to reproduce your problem on Linux (bash, tmux, zsh, etc.) and Windows (PowerShell, Command Prompt, etc.) without much success.

I am willing to bet it is a problem with the 'ipython' you are running in PS.

Have you tried installing a different Python version just to see if that is the issue?

over 4 years ago · Santiago Trujillo Report

0

I think you have to import and initialize ipython or you have given an extra space.

over 4 years ago · Santiago Trujillo Report

0

I couldn't reproduce your problem myself, but here are some solutions I think they might work.

I believe the source of this problem may have something to do with Ipython's automatic indentation when working with the vscode version you are using. You could use Ipython's built-in magic command: %autoindent to turn off the automatic indentation.

Just run the magic command: %autoindent and you will see in your prompt the message:

Automatic indentation is: OFF (You can run it again to turn it back on if you want)

After that you should be able to copy and paste your code (keeping the original indentation) and Ipython won't add new indentation.

Another solution is using the magic command: %paste This command paste and execute the code from clipboard (here you can find more information about this command).

If you want to edit the code in the prompt before executing it, remember you can use: %cpaste instead.

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!