1

When ssh'd into a work server via PuTTY I'm seeing strange behavior with the left margins when using GNU screen and vim. For example, I'll open up a Python script and all indentations will be gone i.e.

def __init__(self):
self.name = str(self.__class__.__name__)
self.nestables = None
self.attributes = {}

and not

def __init__(self):
    self.name = str(self.__class__.__name__)
    self.nestables = None
    self.attributes = {}

However if I scroll down one line at a time newly appearing lines on screen will have proper indentation. I see similar behavior in htop, with the left margin getting overwritten or being indented incorrectly.

I figure there's a termcap/terminfo setting I can put in my .screenrc but everything I've tried so far has not worked.

I see this both in Debian 7 and CentOS 6.

Anyone else encountered this before?

Edit: I am indenting with spaces, not tabs, and am using PuTTY from my Windows 7 workstation. I tried to reproduce the issue at a normal Windows cmd window using Cygwin/SSH and the margins are just fine, so it does appear to be PuTTY specific.

... and it turns out that I had "Implicit CR in every LF" checked by default in PuTTY and that was the culprit. Screen was a red herring.

1

I had "Implicit CR in every LF" checked by default in PuTTY and that was the culprit. Screen was a red herring.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.