Copy/Paset with VSCode and Putty
Posted: Thu Feb 18, 2021 9:50 pm
I've been having an odd issue with Putty and VSCode when copy/paste is used from VSCode to a terminal window. Whenever I paste indented code, the terminal adds additional spaces for each line. For example, if it looks like this in VSCode:
It gets pasted like this in the terminal window:
This obviously leads to a "unexpected indent" error.
The only terminal I had that worked was Pymakr, in the command window inside VSCode. But Pymakr has stopped working and I was having so many other issues with it that I uninstalled it. I've tried Putty and the uPyCraft terminal and both have the same issue. I'm thinking that it has something to do with a LF/CR difference, and I'm convinced it's how VSCode is copying the text, but I'm not sure how to work around that.
Code: Select all
for i in range(0, len(switchPins)):
buttons.append(Pin(switchPins[i],Pin.IN))
buttonState.append(0)
Code: Select all
for i in range(0, len(switchPins)):
buttons.append(Pin(switchPins[i],Pin.IN))
buttonState.append(0)
The only terminal I had that worked was Pymakr, in the command window inside VSCode. But Pymakr has stopped working and I was having so many other issues with it that I uninstalled it. I've tried Putty and the uPyCraft terminal and both have the same issue. I'm thinking that it has something to do with a LF/CR difference, and I'm convinced it's how VSCode is copying the text, but I'm not sure how to work around that.