Courtesy of the clever Shawn Van Ness, my new command-line prompt is now
$P$_$+$G
Which, when I set it via either the prompt command or the PROMPT environment variable, gives me a command line that looks like this:
C:\data\Projects\flexwiki\FlexWikiCore
++>
The plusses indicate that I'm two levels deep in pushd, and I like that the working directory appears on the line before, obliterating the problem of long paths making commands linewrap. Nice!
How do you get the prompt setting to persist?
ReplyDeleteThanks!
By setting the PROMPT environment variable.
ReplyDeleteThat was it - thanks!
ReplyDeleteI find this somehow both cool and disturbing at the same time. ;) Not sure if my brain can handle two line command prompts after all these years.
ReplyDeleteHmmm. I don't get the pluses, no matter how deep I go into a directory. I set my PROMPT environment variable to $P$_$+$G.
ReplyDeleteGeorge, try "Pushd" and "popd"
ReplyDelete(I'm a commandline freak myself).
Try this press F7 on a dos window.
[%computername%] $d$s$t$_$p$_$_$+$g
ReplyDeleteThat's a bit too much for me.
ReplyDeletewhat I am curious about is how one would go about setting the prompt color to something other than the default. I'd like it to stand out a bit.
Craig,
ReplyDeleteThe way you'd do that is
color 8f.
For more command line tricks from another command line junkie (me) - check my blog at -
http://codebetter.com/blogs/sahil.malik/archive/2005/01/28/48715.aspx
Oh sorry .. I fast read .. you meant "prompt" color ..
ReplyDeleteThat's over here - http://kb.indiana.edu/data/aamm.html?cust=06626097.706.30
That's how you change your prompt color in DOS. I'm not running DOS - haven't for years. I'm using the Windows 2003 command shell. Ian Griffiths writes at length about the difference here: http://www.interact-sw.co.uk/iangblog/2004/03/04/notdos
ReplyDeleteChange your prompt color using ANSI commands. Probably doesn't work in plain-vanilla CMD, but works mighty fine with TakeCommand/32 :) (http://jpsoft.com/tcmddes.htm).
ReplyDeleteI use this one:
ReplyDelete@set prompt================================================================================$_$P\$_-------------------------------------------------------------------------------$_$D$T$G
p{color:black;} I am a self confessed Command Line Junkie. Here are a few tricks I use commonly that I can think off the top of my head. 1. Find a file on your hard disk - (This beats the Search doggie in ...
ReplyDeleteThis did the trick.. Thanks a lot Craig..
ReplyDeleteI've got an .exe (batch, just converted. Not made by me but by my friend.) that does this this. I'm trying to recreate it inside a project of my own but i can't figure out how he has manged to be able to change the title permanently and also the color. Anybody care to help ? Please email me at backtrack@stoned.com. Thanks for your time.
ReplyDelete