bug-bash
[Top][All Lists]
Advanced

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

Re: bash long prompt, color going past the end of prompt after reaching


From: Ilkka Virta
Subject: Re: bash long prompt, color going past the end of prompt after reaching bottom of terminal
Date: Fri, 23 Mar 2018 00:36:22 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:52.0) Gecko/20100101 Thunderbird/52.6.0

On 22.3. 22:22, Chet Ramey wrote:
On 3/22/18 1:44 PM, Musse Abdullahi wrote:

Bash Version: 4.2
Patch Level: 46
Release Status: release

Description:
     look at Repeat-By section

If the version information above is accurate, you should investigate
newer versions of bash. Version 4.2 is two major versions behind and
was released around seven years ago.

I get the same with '4.4.12(1)-release' too, but it doesn't seem related to Bash or the prompt. I can get it with just a printf, the colored part just needs to get wrapped by the end of line.

 printf "%100s $(tput setab 1)colored part$(tput sgr0) normal again\n"

If the screen scrolls, the background color on the last character gets copied to the next line. At least one way to work around that seems to be to clear the end of the line after the colored part ends, by putting "$(tput el)" after "$(tput sgr0)". You probably don't have anything to the right of the cursor at that point, so it'll only reset the color.

--
Ilkka Virta / address@hidden



reply via email to

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