News for hackers. Stuff that matters.
Re:Your Bash Prompt Needs This by arjunnarayan on Friday April 27, 2012 @12:04PM (#3899680)
Yes. I have a two line bash prompt: the first line with a whole bunch of info like the exit status of the last command, the number of background jobs, the hostname, current username (very useful when you have 5 different ssh sessions to different machines), and the current working directory. In real world usage I have experienced almost no loss of utility from only having 50% of my command history on screen. In fact, given how many commands are just ls,whoami,jobs,pwd, that info gets condensed into one line.
Re:Your Bash Prompt Needs This by pavel_lishin on Friday April 27, 2012 @01:33PM (#3900165)
Mine's very similar, and includes the current date and time; it also wraps onto the next line and starts with a # (mostly because I'm an idiot, and have burned myself by copying-and-pasting an entire-line-plus-newline and ran a command instead of just copying it in order to edit it.)

    [\[\033[1;32m\]\D{%Y-%m-%d %H:%M:%S}\[\033[0m\]] \[\033[1;32m\]\u\[\033[0m\]\[\033[1;32m\]@\h\[\033[0m\]:\[\033[1;36m\]\w\[\033[0m\]\n#
It's actually dynamically generated by my .bashrc so that different servers have different colors; at a glance, I can generally tell whether I'm on one of my machines, or on a work build server, or an amazon ec2 instance.
Re:Your Bash Prompt Needs This by TimothyFitz on Friday April 27, 2012 @12:25PM (#3899803)
Cool! Do you mind posting your PS1 so other people can try out your config?
Re:Your Bash Prompt Needs This by arjunnarayan on Friday April 27, 2012 @01:54PM (#3900264)
Here's the PS1:

  PS1="\[\e[32;1m\]\[\e[37;1m\]\`if [ \$? = 0 ]; then echo \[\e[33m\] :\)\[\e[0m\]; else echo \[\e[31m\] X\(\[\e[0m\]; fi\`\[\e[32;1m\] \[\e[32;1m\](\[\e[37;1m\]\h:\u\[\e[32;1m\])-(\[\e[37;1m\]\j\[\e[32;1m\])-(\[\e[37;1m\]\w\[\e[32;1m\])\n\[\e[0m\]"
Here's how it appears:

   :) (seas456:narayana)-(0)-(~/personal)
  [this line is where your cursor blinks; notice no symbol at the start of this line]
You can't see the colors here. The smiley face turns into a bright red frowny face if the exit code of the last job is nonzero.
Re:Your Bash Prompt Needs This by jamii on Friday April 27, 2012 @02:36PM (#3900493)
It looks like the your markup got mangled a little. Would you mind posting a gist?
Re:Your Bash Prompt Needs This by india on Friday April 27, 2012 @12:24PM (#3899795)
Could you share your prompt?