Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

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

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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