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

Re: bash prompt won't wrap properly



On 2007-04-15, Gerard Robin <g.robin3@free.fr> wrote:

> I encountered the same problem and I solved it adding \]\n[\ in my PS1.
>
> my PS1:
>
> PS1="${magenta}[\[$TIME\] \[$LOAD\]]\[${NC}\]\n[\u@\h
> \[${BLUE}\]\#\[$NC\]]\w\$ "
>
> hth.


That's interesting. If I put the \n at the end of my prompt it works
right. If I put it at the beginning or in the middle I get the same
problem - the first line wraps at 66 characters, and overwrites the
line rather than spilling onto the next line. I've discovered that the
second and presumably all subsequent lines wrap correctly at 80
characters and spill onto the following line, rather than overwriting
the current line.

So the only functional option so far is to add the \n at the end of my
prompt. However, I'd rather have my prompt on the same line as the
input, which doesn't seem like an unreasonable demand. Any other
suggestions?

Thanks,

Tyler



Reply to: