Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 7 Jan 2002 00:13:53 +0100
From:      Rogier Steehouder <r.j.s@gmx.net>
To:        "J . S ." <johann@broadpark.no>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: Shell prompt contest
Message-ID:  <20020107001353.B837@localhost>
In-Reply-To: <20020102150618.04ae22ff.johann@broadpark.no>; from johann@broadpark.no on Wed, Jan 02, 2002 at 03:06:18PM %2B0100
References:  <20020102150618.04ae22ff.johann@broadpark.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On 02-01-2002 15:06 (+0100), J . S . wrote:
> Let's see who has the prettiest one :-)
> 
> -- LET THE GAMES BEGIN!

I use bash.

On ANSI terminals with the correct codepage (basically the console):

PS1="\[\e[0;36m\]ÚÄ(\$?)Ä(\u@\h on $(tty|cut -d/ -f3))Ä(\$(date +'%H:%M %d-%m-%Y'))ÄÄ\[\e[1;30m\]Ä\[\e[0m\]\n\[\e[0;36m\]ÀÄ(\w)ÄÄ\[\e[1;30m\]Ä\[\e[0m\]"
PS2="\[\e[0;36m\e[1A\]Ã\[\e[1D\e[1B\]ÀÄÄ\[\e[1;30m\]Ä\[\e[0m\]"

Looking like (it uses box-drawing characters and colors):

ÚÄ(i0)Ä(root@localhost on tty7)Ä(0:06 06-01-2002)ÄÄÄ
ÀÄ(~)ÄÄÄ

ÚÄ(i0)Ä(root@localhost on tty7)Ä(0:06 06-01-2002)ÄÄÄ
ÃÄ(~)ÄÄÄ
ÀÄÄÄ

With PS2 it replaces the first character of the second line, so the
lines continue. Combined with color makes it a good visual aid to find
your command lines.

For non-ansi/wrong codepage terminals I use:

PS1="[\$?]-[\u@\h: \w]> "
PS2="> "

Just standard, but I do include the previous program's exit code.

With kind regards, Rogier Steehouder

-- 
                          ___                          _
-O_\                                                  //
 | /               Rogier Steehouder                 //\
/ \                  r.j.s@gmx.net                  //  \
  <---------------------- 25m ---------------------->

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20020107001353.B837>