A better command line for Windows?

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.

37 thoughts on “A better command line for Windows?”

  1. 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.

  2. 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.

  3. 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.

  4. 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. 🙂



  5. 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.

  6. 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 😉

  7. 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.

  8. 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.

  9. Pingback: Naif Blog
  10. “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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.


  15. 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?

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

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

  18. 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.

  19. As noted twice above, emacs offers a shell mode accessible via C-x shell. If you already use emacs I can’t think why you would use anything else for your Windows command shell. I use xemacs and with it all editing commands are available; command history is available as C-upArrow; full sessions of commands can be saved as files; data or errors or any cmd output can be cut and paste to other apps easily; macros can be written to automate command functions (picture creating a macro in about 30 seconds to execute the same command against a file full of data parameters) and so on.

    The only downside is for people who don’t know it, emacs comes with a definite learning curve.

  20. I found out I had Powershell (AKA Monad) since it’s required for NetBeans. And it doesn’t even have cut and paste to/from other windows. What is the deal with that???? That was the biggest weakness of CMD and it is STILL THERE!!!

  21. Console was a good one. It just wraps the windows cmd.exe into something much better. Thanks.

Comments are closed.