Re: still having cursor problems on MacOSX Terminal and iTerm

2006-12-22 Thread dearvoid

On 12/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:



I've seen visual glitches like this for so long, I think they
might be more to do with Apple than with GNU-&-company.

I've applied all nine official patches thus-far to bash-3.2 and
the one official patch to readline-5.2, have pointed their
builds to use my build of ncurses-5.5+patches residing in
/usr/local, have the latest versions (some from cvs/svn) for
almost every other open source project (hundreds) I also put
into /usr/local including iconv/intl, gettext, etc.

I like to use hilighting for the bash prompt, and put the
settings in /etc/bashrc.  I was using this one-line PS1 string:
PS1='\e[0;7m\h[\w]\u\$\e[0m '
but decided to start using a two-line string:
PS1='\e[0;7m\h[\w]\n\u\$\e[0m '
. ^^
so we could see long 'pwd's.  ;)


In PS1 we must enclose sequence of non-printing characters within \[ and \],
just like this:

$ PS1='\[\e[0;7m\]\h[\w]\u\$\[\e[0m\] '

For details you can refer to Bash's man page.
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash


Re: still having cursor problems on MacOSX Terminal and iTerm

2006-12-22 Thread dearvoid

On 12/22/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:


On 2006-12-22 04:34:22 -0600, dearvoid <[EMAIL PROTECTED]> said:

I will need to "close" each prompt line with an end-hilight
code, do the \n, then begin the next line with a start-hilight
code, such as:
PS1='\[\e[0;7m\]\h[\w]\[\e[0m\]\n\[\e[0;7m\]\u\$\[\e[0m\] '
. ^  ^^^


But do I put \[ \] around a \n (or include it there-in) ?


Bash knows exactly what \n means in PS1 and can handle it well so we need
not put \[ \] around \n .

BTW: I also use MacOSX on my iBook G4.
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash