Trouble in RXVT with line wrap

Michael Schaap cygwin@mscha.com
Tue Jul 3 17:48:00 GMT 2001


At 01:08 4-7-2001, Sandeep Tamhankar wrote:
>I saw this too when I moved to rxvt.  The problem is that when you specify 
>escape characters in your PS1 (primary prompt) bad things like this 
>happen.  By default when you start up Cygwin, your PS1 is set to show the 
>current directory in your window title bar and your username (possibly 
>with host but I can't remember for certain) as your actual prompt in 
>green.  Even in the standard Windows console-app window, I get all sorts 
>of problems when I have multi-screenline commands and start doing Ctrl-a 
>and Ctrl-e.  I ended up living with it for a while, but once I started 
>using rxvt (which exploits the cr or cr/lf issue you mention), my only 
>choices were to
>
>1. Remove all escape characters from PS1 and make my cwd be at the 
>beginning of my prompt.  (Annoying since some paths can be quite long.)
>2. Bite the bullet and build zsh, which is the shell I love anyway but was 
>otherwise too lazy to build in the past.

3. Use the \[ and \] special characters in PS1 to encapsulate non-printing 
characters (e.g. escape characters).  See the PROMPTING section of "man bash".

As an example, here's my PS1, which puts some info in the title bar, and 
makes the prompt bold:

export PS1='\[\e]0;\h:\u - \w\a\]\['`tput bold`'\]\n\u@\h ($OS) : \w\n\$ 
\['`tput sgr0`'\]'

  - Michael


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list