What I tend to do is have all text as red to indicate that I'm on a production box, but Hamish's prompt is nice and not as offensive as a screen full of red.<br><br>Alfie<br><br><div class="gmail_quote">On Thu, May 13, 2010 at 2:37 PM, Sam Watkins <span dir="ltr"><<a href="mailto:sam@nipl.net">sam@nipl.net</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="im">On Thu, May 13, 2010 at 01:44:33PM +1000, Hamish Carpenter wrote:<br>
> As briefly discussed last night, I mentioned I'd changed my prompt to<br>
> be red on error (return code != 0). This helps me detect failed<br>
> commands and also helps in another case where you type a command then<br>
> cancel it by pressing ctrl+c. This was what prompted me to change my<br>
> prompt as someone watching your terminal cannot easily tell that<br>
> command was canceled, especially if it is a command that would have no<br>
> output on success (eg rf -f project_directory).<br>
><br>
> add the following to your .bash_profile:<br>
><br>
> # needs PS1 to be previously defined so add nearer the end of your<br>
> .bashrc/.bash_profile<br>
> # will turn entire prompt red (31) or green (32)<br>
> # depending on previous output return code<br>
> export PS1="\[\e[\`if [ \$? = 0 ]; then echo '0;32m'; else echo<br>
> '0;31m'; fi\`\]$PS1\[\e[0m\]"<br>
<br>
</div>cool, a friend showed me something similar, giving<br>
^_^ for a success prompt, and O_o for failure :)<br>
<br>
# SmiliePrompt - from <a href="http://x-demon.org/" target="_blank">http://x-demon.org/</a><br>
smiley() { if [ $? == 0 ]; then echo '^_^'; else echo '0_o'; fi; }<br>
export PS1='$(smiley) '<br>
<br>
It's important to know exit status, so I use this all the time. The shell<br>
should really do something like this by default, maybe not the cute emoticon<br>
version though.<br>
<br>
enjoy! :)<br>
<div><div></div><div class="h5">_______________________________________________<br>
Melbourne-pm mailing list<br>
<a href="mailto:Melbourne-pm@pm.org">Melbourne-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/melbourne-pm" target="_blank">http://mail.pm.org/mailman/listinfo/melbourne-pm</a><br>
</div></div></blockquote></div><br>