On 3/23/18 12:47 PM, Musse Abdullahi wrote: > Virta, > > your workaround solves the first issue but creates another one. > > Here is the script with your workaround > > |calculate_prompt1(){host="my-linux"git_branch="a very very very very very > very very very very very very very very very long prompt"prompt="@$host \\w > : \[$(tput bold)$(tput setab 1)$(tput setaf 7)\]${git_branch}\[$(tput > sgr0)||$(tput el)\]\$ "export > PS1="$prompt"}PROMPT_COMMAND="calculate_prompt1;" > | > > | > | > > |Now keep pressing enter to the bottom of the terminal, and > | > > |you will see that the initial problem is solved. next write anything that > flows to the next line (forcing a scroll). Then press "Home" button to go > back to the beginning of what you wrote. > | > > |you will see that the entire line after the prompt is deleted.
I can't reproduce this with bash-4.4.19, using ^A for HOME (no HOME button on my keyboard). -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/