X-Spam-Check-By: sourceware.org
To: cygwin@cygwin.com
Subject: RE: what's wrong with my cygwin command prompt?
In-Reply-To: <00ea01c70d99$90b7f200$a501a8c0@CAM.ARTIMI.COM>
Message-Id: <20061121191949.976F914CF67C@u53026a.matapp.unimib.it>
Date: Tue, 21 Nov 2006 20:19:49 +0100 (CET)
From: grenie@matapp.unimib.it (Loic Grenie)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
Precedence: bulk
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie.com@cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

> Nick@ACER-Nick
> $ g++ testing.cpp -o testing
>
> Nick@ACER-Nick
> $ ./testing
> Hello, i'm newbie to this forum.
>
> and what he was expecting to see:
>
>
> Nick@ACER-Nick
> $ g++ testing.cpp -o testing
> $ testing



>   First off, I don't see how you would expect the "\u@\h" to only be printed
> once.  That's part of the prompt and it's printed every time.

    Maybe simply because he (or she) didn't know that it was part of the
  prompt. His (or her) reaction looks very much like the one I had the first
  time I've had a multiline prompt without asking for it.

>   Second, the blank line between the end of one command and the prompt for
> another is casued by the \n in the prompt string.

>   IOW, the shell is behaving as if the prompt string was defined as
> PS1="\n\u@\h\n$ "

    From /etc/profile:

PS1='\[\e]0;\w\a\]\n\[\e[32m\]\u@\h \[\e[33m\]\w\[\e[0m\]\n\$ '

  which, apart from cosmetics, is

PS1='\n\u@\h \w\n\$ '

  (I can't see the effect of the \w in the first post though).

>   For the OP to get the desired result, he should add a command to .bashrc or
> one of the other startup scripts along the general lines of

> export PS1="$ "

    Seconded !

       Loïc

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

