<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Best bash prompt. Ever.</title>
	<atom:link href="http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/feed/" rel="self" type="application/rss+xml" />
	<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/</link>
	<description>Your blog is probably better than mine.</description>
	<lastBuildDate>Wed, 10 Mar 2010 22:03:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: William Dye ("willdye")</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-98737</link>
		<dc:creator>William Dye ("willdye")</dc:creator>
		<pubDate>Fri, 19 Feb 2010 18:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-98737</guid>
		<description>For what it&#039;s worth, I tend to avoid using the ASCII escape codes directly, preferring code such as &quot;blue=$(tput setaf 4 2) instead.  According to http://mywiki.wooledge.org/BashFAQ/037 and http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes the tput method is preferred, though I can&#039;t think of an instance in which either method caused a serious problem for me.</description>
		<content:encoded><![CDATA[<p>For what it&#8217;s worth, I tend to avoid using the ASCII escape codes directly, preferring code such as &#8220;blue=$(tput setaf 4 2) instead.  According to <a href="http://mywiki.wooledge.org/BashFAQ/037" rel="nofollow">http://mywiki.wooledge.org/BashFAQ/037</a> and <a href="http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes" rel="nofollow">http://bash-hackers.org/wiki/doku.php?id=scripting:terminalcodes</a> the tput method is preferred, though I can&#8217;t think of an instance in which either method caused a serious problem for me.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ice</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-98483</link>
		<dc:creator>Ice</dc:creator>
		<pubDate>Sat, 13 Feb 2010 17:50:50 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-98483</guid>
		<description>Great tip, thanks. I love your blog!

I&#039;m using it with some modifications (root in red, full path, shows svn revision):
&lt;pre&gt;
export PS1=&#039;`if [ \\$? = 0 ];
    then
        echo -e &quot;33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m &#124;&#124; echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 &#124; grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n &quot;33[1;34m&quot; ; echo -n $(svn info &#124; grep Revision:) ; echo -n &quot;33[0m&quot;))]33[32m\$33[0m &quot;;
    else
        echo -e &quot;33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m &#124;&#124; echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 &#124; grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n &quot;33[1;34m&quot; ; echo -n $(svn info &#124; grep Revision:) ; echo -n &quot;33[0m&quot;))]33[31m\$33[0m &quot;;
    fi; `&#039;
&lt;/pre&gt;
</description>
		<content:encoded><![CDATA[<p>Great tip, thanks. I love your blog!</p>
<p>I&#8217;m using it with some modifications (root in red, full path, shows svn revision):</p>
<pre>
export PS1='`if [ \\$? = 0 ];
    then
        echo -e "33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m || echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 | grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n "33[1;34m" ; echo -n $(svn info | grep Revision:) ; echo -n "33[0m"))]33[32m\$33[0m ";
    else
        echo -e "33[0m[$(test \u = root &amp;&amp; echo 33[31mroot33[0m || echo \u)@\h $(pwd) $(svn info 2&gt;&amp;1 | grep Revision &amp;&gt; /dev/null &amp;&amp; (echo -n "33[1;34m" ; echo -n $(svn info | grep Revision:) ; echo -n "33[0m"))]33[31m\$33[0m ";
    fi; `'
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-89447</link>
		<dc:creator>Tobias</dc:creator>
		<pubDate>Mon, 12 Oct 2009 22:16:59 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-89447</guid>
		<description>Saw it, used it (with modifications), love it. Bonta-kun&#039;s suggestion is great.</description>
		<content:encoded><![CDATA[<p>Saw it, used it (with modifications), love it. Bonta-kun&#8217;s suggestion is great.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kathryn</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-84162</link>
		<dc:creator>Kathryn</dc:creator>
		<pubDate>Mon, 03 Aug 2009 18:09:47 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-84162</guid>
		<description>This is great, totally using it. :)</description>
		<content:encoded><![CDATA[<p>This is great, totally using it. :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bonta-Kun</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-76813</link>
		<dc:creator>Bonta-Kun</dc:creator>
		<pubDate>Sat, 25 Apr 2009 21:11:33 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-76813</guid>
		<description>It&#039;s not so bad, especially the coloring by exit-code. 

However, you might want to do something like: user@host:cwd (that is, put the current directory next to the host). Then you can use the whole string as an ssh/scp target/source...

Also, coloring the username differently depending on being root or not can really save you :)</description>
		<content:encoded><![CDATA[<p>It&#8217;s not so bad, especially the coloring by exit-code. </p>
<p>However, you might want to do something like: user@host:cwd (that is, put the current directory next to the host). Then you can use the whole string as an ssh/scp target/source&#8230;</p>
<p>Also, coloring the username differently depending on being root or not can really save you :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jamie Smith</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-71382</link>
		<dc:creator>Jamie Smith</dc:creator>
		<pubDate>Fri, 30 Jan 2009 15:18:28 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-71382</guid>
		<description>I would like to prompt your bash.</description>
		<content:encoded><![CDATA[<p>I would like to prompt your bash.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Evan Farrer</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-69729</link>
		<dc:creator>Evan Farrer</dc:creator>
		<pubDate>Tue, 13 Jan 2009 16:10:32 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-69729</guid>
		<description>For users of git I recommend a slight modification.  This adds the current git branch when you&#039;re in a git controlled directory.  It&#039;s not as elegant (multiple echo&#039;s) but more awesome. 

&lt;pre&gt;
export PS1=&quot;\`if [ \$? = 0 ];
              then
                  echo -en &#039;$GREEN--( $LIGHT_CYAN\u$YELLOW@$LIGHT_CYAN\h$GREEN )--( $YELLOW\w$GREEN )--( $PURPLE&#039;; __git_ps1 &quot;%s&quot;; echo -n &#039;$GREEN )-- :)\n--\$$DEFAULT_COLOR &#039;;
              else
                  echo -en &#039;$LIGHT_RED--( $LIGHT_CYAN\u$YELLOW@$LIGHT_CYAN\h$LIGHT_RED )--( $YELLOW\w$LIGHT_RED )--( $PURPLE&#039;; __git_ps1 &quot;%s&quot;; echo -n &#039;$LIGHT_RED )-- :         (\n--\$$DEFAULT_COLOR &#039;;
              fi; \`&quot; 

&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>For users of git I recommend a slight modification.  This adds the current git branch when you&#8217;re in a git controlled directory.  It&#8217;s not as elegant (multiple echo&#8217;s) but more awesome. </p>
<pre>
export PS1="\`if [ \$? = 0 ];
              then
                  echo -en '$GREEN--( $LIGHT_CYAN\u$YELLOW@$LIGHT_CYAN\h$GREEN )--( $YELLOW\w$GREEN )--( $PURPLE'; __git_ps1 "%s"; echo -n '$GREEN )-- :)\n--\$$DEFAULT_COLOR ';
              else
                  echo -en '$LIGHT_RED--( $LIGHT_CYAN\u$YELLOW@$LIGHT_CYAN\h$LIGHT_RED )--( $YELLOW\w$LIGHT_RED )--( $PURPLE'; __git_ps1 "%s"; echo -n '$LIGHT_RED )-- :         (\n--\$$DEFAULT_COLOR ';
              fi; \`" 
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-69259</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Wed, 07 Jan 2009 19:18:18 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-69259</guid>
		<description>Yeah, my bash does handle the wrapping. However, if yours does not, you can just put all that &quot;export PS1&quot; stuff on a single line.</description>
		<content:encoded><![CDATA[<p>Yeah, my bash does handle the wrapping. However, if yours does not, you can just put all that &#8220;export PS1&#8243; stuff on a single line.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Hans</title>
		<link>http://thesmithfam.org/blog/2009/01/06/best-bash-prompt-ever/comment-page-1/#comment-69254</link>
		<dc:creator>Hans</dc:creator>
		<pubDate>Wed, 07 Jan 2009 18:25:18 +0000</pubDate>
		<guid isPermaLink="false">http://thesmithfam.org/blog/?p=136#comment-69254</guid>
		<description>Does your version of bash handle the wrapping ok when you do this? I used to have color on my input line and finally gave up. My current prompt is this:

&lt;pre&gt;$(r=$?; [ 0 == $r ] &#124;&#124; echo &quot;\[\e[0;33m\]$r\[\e[0m\] &quot;)\u@\h \[\e[0;32m\]\w\[\e[0m\]\n\$&lt;/pre&gt;

This gives me a little color, which makes finding previous prompts easy when scrolling up, and the return status is there in yellow if it&#039;s not 0. But no color on the actual input line, and also the longest input line possible, and so I have minimal issues with different versions of bash and their myriad wrapping bugs.</description>
		<content:encoded><![CDATA[<p>Does your version of bash handle the wrapping ok when you do this? I used to have color on my input line and finally gave up. My current prompt is this:</p>
<pre>$(r=$?; [ 0 == $r ] || echo "\[\e[0;33m\]$r\[\e[0m\] ")\u@\h \[\e[0;32m\]\w\[\e[0m\]\n\$</pre>
<p>This gives me a little color, which makes finding previous prompts easy when scrolling up, and the return status is there in yellow if it&#8217;s not 0. But no color on the actual input line, and also the longest input line possible, and so I have minimal issues with different versions of bash and their myriad wrapping bugs.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
