[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Broken Termcaps

From: Greg Wooledge
Subject: Re: Broken Termcaps
Date: Wed, 1 Mar 2017 17:08:38 -0500
User-agent: Mutt/

On Wed, Mar 01, 2017 at 05:02:32PM -0500, Lfabbro wrote:
> > echo $PS1
> \[\033[01;address@hidden;37m\] \W$(__git_ps1 " 
> (\033[31m%s\033[37m)")\033[32m]\$\[\033[00m\]

There are some unprotected escape sequences inside the $(...) but I have
absolutely no idea what that command substitution is doing, so I can't
even guess whether that's relevant.

If the command sub actually *outputs* those escape sequences, then you
have a problem here.  The output of the command sub isn't protected
by \[...\] so bash will think that each character actually produces
visible screen output.

If the command sub emits some mangled stream that contains both escape
sequences *and* regular visible output, then there is no viable solution
to this problem at all.  You will have to rewrite it.

> >uname -a
> Linux time-travel 4.4.48-1-MANJARO #1 SMP PREEMPT Thu Feb 9 22:17:50 UTC 2017 
> x86_64 GNU/Linux
> >infocmp
> # Reconstructed via infocmp from file: /usr/share/terminfo/x/xterm-256color
> xterm-256color|xterm with 256 colors,
> am, bce, ccc, km, mc5i, mir, msgr, npc, xenl,
> colors#256, cols#80, it#8, lines#24, pairs#32767,

OK, the good news is that you're on a very recent Linux distribution of
some kind, so you should be using terminfo and not termcap.  Your
infocmp command verifies that your system recognizes your $TERM variable,
which is also good.

I suspect the issue is in that $(git) thing.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]