My New Prompt

CraigBlog

Syndication

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!


Posted Jan 12 2005, 10:22 AM by craig-andera

Comments

Derek wrote re: My New Prompt
on 01-12-2005 9:37 AM
How do you get the prompt setting to persist?

Thanks!
Craig wrote re: My New Prompt
on 01-12-2005 9:38 AM
By setting the PROMPT environment variable.
Derek wrote re: My New Prompt
on 01-12-2005 9:56 AM
That was it - thanks!
Kevin Dente wrote re: My New Prompt
on 01-12-2005 5:14 PM
I 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.
George wrote re: My New Prompt
on 01-12-2005 7:41 PM
Hmmm. I don't get the pluses, no matter how deep I go into a directory. I set my PROMPT environment variable to $P$_$+$G.
Sahil Malik wrote re: My New Prompt
on 01-12-2005 11:14 PM
George, try "Pushd" and "popd"
(I'm a commandline freak myself).

Try this press F7 on a dos window.
Luminos Cerebrae wrote A Killer Command Prompt
on 01-13-2005 7:03 AM
Luminos Cerebrae wrote A Killer Command Prompt
on 01-13-2005 7:09 AM
ComputerZen.com - Scott Hanselman's Weblog wrote Prompt(s) along with PushD and PopD
on 01-20-2005 3:28 PM
Craig T wrote I've been enjoying this one for a few years...
on 01-22-2005 7:31 PM
[%computername%] $d$s$t$_$p$_$_$+$g
Craig wrote re: My New Prompt
on 01-22-2005 9:19 PM
That's a bit too much for me.

what 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.
Sahil Malik : System.DotNetAwareMonkey wrote Command Line Tricks
on 01-28-2005 1:45 AM
Sahil Malik : System.DotNetAwareMonkey wrote Command Line Tricks
on 01-28-2005 1:54 AM
Sahil Malik wrote re: My New Prompt
on 01-28-2005 1:55 AM
Craig,

The 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
Sahil Malik wrote re: My New Prompt
on 01-28-2005 1:59 AM
Oh sorry .. I fast read .. you meant "prompt" color ..

That's over here - http://kb.indiana.edu/data/aamm.html?cust=06626097.706.30
Craig wrote re: My New Prompt
on 01-28-2005 3:24 AM
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
David wrote re: My New Prompt
on 05-07-2005 11:34 AM
Change 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).
John wrote re: My New Prompt
on 05-08-2005 9:57 AM
I use this one:

@set prompt================================================================================$_$P\$_-------------------------------------------------------------------------------$_$D$T$G
Sahil Malik - blah.winsmarts.com wrote Command Line Tricks
on 05-29-2006 5:32 PM
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 ...
ComputerZen.com - Scott Hanselman wrote A better PROMPT for CMD.EXE or Cool Prompt Environment Variables and a nice tran
on 07-13-2006 9:47 PM

Add a Comment

(required)  
(optional)
(required)  
Remember Me?