Xshell Forum

Code block paste adding additional indent

Last post: Friday, September 15, 2017 4:54 PM by Support, 3 reply

 
Sunday, March 26, 2017 4:43 AM - MingXian Wu

Code block paste adding additional indent

 
when pasting a block of python code in ipython, Xshell 5 adding addtional indent. And this results in an indent match error, but putty has not this problem

Program Ver. : Xshell 5
Thursday, March 30, 2017 5:48 PM - Support

Re: Code block paste adding additional indent

 
In programs such as vim, the auto indent feature can create issues. I believe ipython does this as well.

You need to temporarily set auto indentation off when pasting long lines using the following:

In [1] : $autoindent
Automatic indentation is: OFF

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Wednesday, September 13, 2017 3:22 PM - Ce Ge

Re: Code block paste adding additional indent

 
This is the most annoying issue when I use Xshell. Sure, it's easy to turn autoindent off in vim, but in "jupyter console" it's impossible. I have to copy&paste code line by line all the time!

I've been putting up with this for a long time. I just tried putty, it works very well. I'm considering switching to putty if this issue is still not resolved recently.
Friday, September 15, 2017 4:54 PM - Support

Re: Code block paste adding additional indent

 
I'm no expert in jupyter or python, but my test shows the same behavior in Xshell and Putty. Please see the attached image.

Xshell cannot dictate how the tab chars should act in certain applications. I believe Putty is the same in this regard.

In the case of ipython, there are the %paste, %cpaste, %autoindent commands for pasting strings. But Jupyter doesn't seem to have these commands. If Putty has some kind of past mode or something similar, can you let me know the version or the related configuration you are using?

Technical Support

Like us on Facebook
Follow us on Twitter
Visit our blog Blog
Attachment image.png (53.7 KB)