Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

357
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

0

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

over 4 years ago · Santiago Trujillo Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda