cmd.exe on Windows sucks. Cygwin and MinGW aren’t really Windows (though they are certainly better and cygwin is what I use). So, I ask the lazyweb: is there a better command line for Windows? It looks like the company that made 4DOS (JPSoft) is still around and makes better command lines. They’re not entirely cheap though. Are there any free choices?

Seems like this would be a good Python project, given the tools for making Python command prompts and the excellent Windows integration that’s available.

32 Responses to “A better command line for Windows?”
  1. john says:

    http://www.steve.org.uk/Software/bash/

    Just spotted this today, don’t know if it’s what you wanted. Also I think that MS do have a new scripting shell to replace cmd but I can’t remember what it was called.

    john

  2. Ferrik Bromyde says:
  3. Ville Vainio says:

    IPython. Try easy_install ipython==dev and starting it with “ipython -p sh”, or “ipython -p pysh” for released stable versions.

    Works better on windows if you get the new pyreadline from SVN, at

    http://ipython.scipy.org/svn/ipython/pyreadline/trunk

  4. Jay P. says:

    I know that IPython comes with a shell (psh?), which gives you Python as your shell scripting language. I’ve never tried it myself, but seems like a nice way to do it.

  5. tazzzzz says:

    Great tips so far!

    A Windows-oriented bash may be an option.

    I didn’t realize that you could actually download Monad now. That’s possibly a great option

    I use IPython quite a bit myself, but I’ve never thought much of it as a system shell. Maybe I’ll take another look in that regard myself.

    By the way, some background on this: many Windows users (even developers) are not particularly used to the command line. It can be a very productive way to work (and some command line use is required for TurboGears), so it would be nice to publicize a *good* way to do command line work on Windows.

  6. Ville Vainio says:

    You definitely should play with ipython in shell mode. I use it as windows system shell all the time, especially on windows. I’m also the maintainer of the stable branch and consider the shell functionality a definitive priority.

    BTW, easy_install pyreadline==dev works now as well so there is no need to play w/ svn.

  7. Ville Vainio says:

    Eh, unsurprisingly I use it as windows shell on windows. Too bad you can’t edit your posts after-the-fact. :)

  8. David Wilson says:

    I’m surprised nobody else mentioned this: the shell that Microsoft were almost going to ship as default with Vista is called Monad, built entirely on .NET. The syntax is a little quirkly, but to say the system is powerful would be a massive understatement.

    If it makes you happy, you can probably already write new commands for it in IronPython if you so felt the need. :)

    David.

    http://en.wikipedia.org/wiki/MSH_(shell)
    http://www.microsoft.com/technet/scriptcenter/hubs/msh.mspx
    http://www.microsoft.com/technet/scriptcenter/topics/msh/download.mspx

  9. Steve Bain says:

    At PyCon there was a hint from Jim Hugunin of a possible Windows shell option to come that might involve some kind of mashup (my word, not his) of IronPython and Monad/MSH.

  10. Benjamin Niemann says:

    What sucks most about cmd.exe are the clumsy copy&paste operations. I’m quite happy with cygwin/bash running in a cmd.exe window. My primary OS is Linux and I’m using Windows only to build and test Windows ports of my projects, so I prefer to get as much ‘Linux-feeling’ under Windows as possible.
    But copy&paste is a feature of the console window and independent of the shell being used. What we really need is a better terminal emulation for Windows…
    I probably should get used to run the shell under emacs ;)

  11. Per Olesen says:

    Tried the Monad shell myself in an early beta. Even though it seems quite powerfull it still lacks a lot. It has what I think is a really splendid idea. It does not use simple text-based format for pipes, but keeps it typed in “objects”.

    Example, when you do “ls”, in a linux-shell you would get a lot of ascii output. This coould be piped into the next command, possibly grep, which could do some text-based finding ind the ascii. In monad, “ls” outputs on its “pipe”, a list of objects of class File which the next command in the pipe can work on. That’s pretty cool, as if you want filesizes for instance, you simply do “file.size” (or something like it). In addition to this, you can extend with any language that compiles to the .net platform.

    Well, so much for Monad. The actuall shell/command-line you work in still sucks bigtime. It has the same editing craziness as cmd.exe, it can’t be resized easily, it looks and feels like the old shitty cmd.exe.

    I know you said you did’nt like cygwin, but if you haven’t tried poderosa (http://poderosa.org/) you should give it a run. It can integrate ssh or cygwin shells into a multitabbed, easily resized windows. A lot like KDEs konsole or gnomes gnome-terminal. It makes windows a little less handicapped to work with.

    Now, if someone would only:
    1) write a good commandline for Monad (maybe integrate into poderosa?)
    2) port all of linux’ many small tools to build oneliners with into monad

    Really, much of the power of the unix shell comes from all the thousands of small utilities like grep, awk, tr, cat, sort, head, tail, cut, … which you as a power-user can combine into real work horses.

  12. David Wilson says:

    Just a small note regarding the annoying cut/paste facility in console windows: have you enabled QuickEdit mode? It allows mouse selection almost as good as Putty.

  13. Benjamin Niemann says:

    Per: Thanx for the poderosa tip! Looks like it is exactly what I was looking for :)

  14. shibinck says:

    try jedit console plugin .. or emacs shell mode (M-x shell)

  15. JanC says:

    4DOS is free (as in beer) now:
    http://www.jpsoft.com/download.html
    See under “Older Unsupported (FREE) Products”.

  16. Naif Blog says:

    Making Windows Usable…

    I previously talked about build environments in Windows and promised to do some more testing of the reliability of certain tools. I turns out that the only set of tools which actually works as expected are the ones provided by Cygwin. I could not ge…

  17. Naif Blog » Blog Archive » Making Windows Usable says:

    [...] The comments over here also provide some potential terminal emulator and shell alternatives for Windows. [...]

  18. Alexander Belchenko says:
  19. Joe says:

    “Really, much of the power of the unix shell comes from all the thousands of small utilities like grep, awk, tr, cat, sort, head, tail, cut, … which you as a power-user can combine into real work horses.”

    That’s the beauty of MSH (Monad)… all of those little utiliities’ functionality is available in MSH as “cmd-lets” (built-in commands) and you can pipe them together without really worrying about what their text output looks like (unlihe in an Unix shell.)

    As far as the general ugliness of the “command-line/shell,” which I guess I’d call the text console, that’s a component of the operating system and not Monad or CMD. All text-based applications are displayed inside that “console” window, whether they are cmd, msh, ipconfig, or anything. That window definately needs a major overhaul, but it is a separate issue in windows. (Other programs that provide enhanced windows for text console operations aren’t strictly console applications, but are providing a GUI with text in it.)

    I do sincerely hope MS updates it console window, and perhaps they will as a Windows update for Vista to coincide with MSH’s release.

  20. Joe says:

    Also check out this program, which provides an alternate and signigicantly advanced environment for MSH (instead of running it in the console window.) It has all sorts of cool stuff, including context highlighting and “intellisense”

    http://www.karlprosser.com/coder/?page_id=14

  21. Aurelien says:

    Thanks for all those excellent hints everyone!

  22. Matt says:

    Take another look at MS monad now called windows power shell. It inherits the entire .net framework and is unbelievably powerful. It makes cygwin bash look like a sick puppy. It has the easiest and most powerful shell programming features I’ve ever used and I’m not a big microsoft fan either.

    For managing a windows box it is unequaled. It makes it a snap to breeze through the system registry and it’s text processing abilities are pretty sweet. Just compare the readability of it vs. say something like sed or even grep. There are only two issues with it in my opinion. The first is that it takes a while to load while it gets jit compiled into memory. (There is a simple fix for this supposedly). The other annoyance is that you have to edit a registry setting in order to enable it to interpret your own shell script files thanks to an overly aggresive security policy.

  23. netzooid » Tabbed shell for Windows? says:

    [...] And Per Olesen has some comments on his blog… [...]

  24. BRPXQZME says:

    I’m surprised that nobody mentioned what I’ve done for years!

    Start up a Cygwin SSH server and use PuTTY for the terminal. Weird, convoluted, and painful, but not as much as Windows usually is to me. I don’t mind typing the password, either; others among us may be interested in using keys for this. Of course, there are better ways now.

    If you have Cygwin X…

    Make a shortcut to C:\cygwin\usr\x11r6\bin\startxwin.bat. Bam, xterm! Copy and pasting with the mouse goes straight to the Windows clipboard.

    Moreover, with KDE4 on the horizon, there’s a good chance that we may see Konsole for Windows not under X reasonably soon. I’ll love that if and when it happens.

  25. ging says:
  26. Dan says:

    Regarding the little utilities that make Unix so great, I’ve been using Unxutils for a couple of years now. It’s so nice to have ls, grep, and those other utilities under Win32. Some of them are a little quirky but overall it’s much better than vanilla cmd.exe. I also enabled tab-completion in cmd.exe (I don’t remember exactly how, but a google search should reveal it) which is nice. It automatically fully expands the first match so it’s a little different than bash, but overall this system is a lot more lightweight than trying to run something like cygwin all the time.

  27. Roi says:

    to BRPXQZME,
    i use the same way you did: SSH server on cygwin, and putty as a console.
    but how do you make graphical applications run? for example, if i type notepad on the windows cmd, a notepad window pops up. over ssh it won’t work.

    thanks

  28. A better command line for Windows? at Blue Sky On Mars says:

    [...] http://www.blueskyonmars.com/2006/03/07/a-better-command-line-for-windows/ Tags: windows, cli, shell, scripting(del.icio.us history) [...]

  29. jc says:

    Anyone find anything similar the Terminal on Mac OS X? With nice font smoothing, and transparency. And decent copy paste support..

    Windows CMD.exe is a friggin abomination. WTF is up with Microsoft… why can’t anyone make a decent one?

  30. Andrew says:

    Cygwin users don’t forget Puttycyg–you won’t have to monkey around with setting up ssh servers and logging in locally, much easier.

  31. Andrew says:

    And Puttcyg has ClearType support, no transparency though. Supports many character sets, UTF-8 included. Try Console2 for transparency.

  32. Jeff says:

    http://sourceforge.net/projects/console/

    Wow ging… this is the BEST command prompt for Windows period. You really have to get in there and configure it but I was seriously impressed. I was also able to download the Gnu tools for Windows and a port of Bash. I can choose a normal DOS window or I can launch Bash in another tab. At work, I can make a Cygwin tab and have them all going at the same time with color ls listings and everything.

    I love the transparent background and tabs. Nice. Reminds me of Konsole.

Leave a Reply