delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2006/11/21/13:57:13

X-Spam-Check-By: sourceware.org
To: cygwin AT cygwin DOT 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 AT matapp DOT unimib DOT it (Loic Grenie)
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT cygwin DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

> Nick AT ACER-Nick
> $ g++ testing.cpp -o testing
>
> Nick AT ACER-Nick
> $ ./testing
> Hello, i'm newbie to this forum.
>
> and what he was expecting to see:
>
>
> Nick AT 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/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019