This is the mail archive of the
cygwin
mailing list for the Cygwin project.
RE: what's wrong with my cygwin command prompt?
- From: grenie at matapp dot unimib dot it (Loic Grenie)
- To: cygwin at cygwin dot com
- Date: Tue, 21 Nov 2006 20:19:49 +0100 (CET)
- Subject: RE: what's wrong with my cygwin command prompt?
> 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/