Wednesday, January 9, 2008

Modifying Terminal's Prompt String, Revisited.

Soon after modifying my prompt string in Terminal, I wasn't too happy about the excessive length that this added to each Terminal Prompt. I also didn't like how it wasn't exactly 100% consistent with the look of Tiger's Terminal. So after a few days I decided to go back to the post that I originally saw this tip from and actually read it a bit more thoroughly this time.

After taking a glance at the table of environment variables, I quickly constructed a string, that I believe is identical to the prompt string that appears in Tiger.

export PS1="\h:\w \u\\$ "

The only thing that I am a bit confused with is the double "\\" near the end of the string and the use of double quotes. Some examples on the blog post use double quotes, whereas some use just single quotes. I'm assuming that these are interchangeable.

Another one I like, is even shorter, and I'll probably be switching in between these two depending on what I'm working on.

export PS1="\h:\w\\$ "

2 comments:

Lewis Leong said...

My manager called the iPod Touch the iTouch today. I died a little inside.

hartzd said...

a couple other command line tricks you might like...

if you're typing a really long command and realize you need to jump back to the start of the command

ctrl-a

when you're done and want to go back to the end of the command

ctrl-e

...had to share...