Nifty cmd.exe Trick

Aug 25th, 2005

Working on Windows is a chore, made moreso by the lameness of its commandline1. cmd.exe has consistently improved over time but is still very lacking if you use a real unix box (like my Powerbook) on a regular basis. Anyhow, today I discovered a nifty cmd.exe trick by accident: I accidentally hit the ESC key with a full prompt, which I now know clears it out. Now, you might think this was irritating, but not so: it doesn’t wipe out the command history, so I didn’t lose anything, and I’ve wanted something to clear the thing out forever. At a typical bash prompt, just going to the end of the command history gives you a clean prompt, but on Windows, it gives you the last command, which might be really long. Now, instead of having to lean on the backspace key, I can simply hit ESC, making me a happy hacker.

1 While I have Cygwin installed, I don’t use it for my command prompt because it’s such a weird half-breed of Windows and Unix, particularly in how it treats paths.