Fix double-escape of user/root ($/#) indicator (fixes #315)

If our segment is ' \\$ ' then it is already sanitized and should not be escaped again, so we avoid it.
This commit is contained in:
Igor Tarasov 2018-02-12 00:16:04 +04:00 committed by GitHub
parent 87b176037f
commit 235d3a8fda
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -129,7 +129,7 @@ class Powerline(object):
def draw_segment(self, idx):
segment = self.segments[idx]
if self.args.shell == "bash":
if self.args.shell == "bash" and segment[0] != ' \\$ ':
sanitized = re.sub(r"([`$])", r"\\\1", segment[0])
else:
sanitized = segment[0]