Update: Coping with the OSS command line on Windows

A few weeks ago I wrote about Coping with the OSS command line on Windows. In that post, I argued that the Mac is far better for dealing with the current crop of OSS development technologies that rely on the command line, such as Git, Node.js, Ruby/Padrino, and so forth. My argument is based around the fact that most of these technologies are developed by Mac/Linux users and both of those OSs are derived from Unix.

Thus the Windows versions are ‘ports’ to Windows. Due to the fact that Windows is based on some fundamentally different constructs than Unix (e.g. “\” vs. “/”, the IO model, lack of built-in developer tools, etc…), combined with the fact that people doing the “ports” are generally not the original developers these ‘ports’ are often sub-standard.

I’ve also complained about the lack of a modern UI for the Windows command prompt like iTerm 2 on the Mac.

Thanks to Phil Haack and Scott Hanselman, I am now much happier with my Windows setup. It generally looks like this:

Untitled picture

Here’s the recipe:

Forget CMD.EXE

Make the move to PowerShell and you will not regret it. I had used PowerShell some a ages ago, but never enough to be comfortable. Once I realized that PowerShell, by default, includes command aliases for most of the standard **nix shell commands, and that they pretty much work as you’d expect I made the move. Thanks to Phil Haack for his post which really opened my eyes here.

To see what I mean, open a PowerShell prompt and type ps, ls, or cat.

Tips for noobs:

  • Edit your profile easily with ‘notepad $Profile’
  • Add aliases with ‘sal’ or ‘Set-Alias’. E.g. ‘sal make c:\dev\utils\cygwin\bin\make.exe’
  • List all alias with ‘gal’ (‘Get-Alias’).

Console 2 ain’t iTerm 2, but it’s not bad either

On the Mac I’ve fallen in love with iTerm 2 which replaces the built-in Terminal app. It supports multiple tabs, flexible configuration, and is attractive.

Console 2 is not nearly as pretty (in fact the configuration UI is down-right hideous), but it has all the functionality of iTerm 2 that I use.  A nice feature is the ability to have each tab be running a different command processor (I set mine up so that there’s a PowerShell, CMD.EXE, and Cygwin tab open by default).

Scott Hanselman has a great post on configuring Console 2.

ConEmu is Nice Too

(Update: After this post was written, I found out about this other CMD.EXE alternative. I am now using it)

ConEmu is like Console2 but actively developed and far more flexible. Originally I thought it was much slower than Console2. Posh-git (below) provides a great git prompt that tells you at a glance the status of your repo; ConEmu had a horrific delay (2+ seconds?) each time the prompt was displayed making it unusable.

image

The author of ConEmu let me know that by disabling the “Inject ConEmuHk” setting this would be fixed.  Sure enough it’s now snappy!

ConEmu is insanely flexible. Which is a curse and a blessing. This screen grab showing just one part of its configuration UI (see the “Inject ConEmuHk” setting?) illustrates this.

image

Use Posh-Git, and PsGet

Posh-Git makes git work great in PowerShell. Follow Phil’s post for a great overview and instructions.

One of my favorite features? Tab expansion for git commands!

For example, I can type ‘git add’ and repeatedly press tab and each file that has not yet been added will be shown.

Sublime Text 2 is more than sublime

Over the years I grew addicted to the VisualStudio editor. Once I decided that I was going to move beyond the pure Microsoft stack I knew I needed to pick an editor that was cross-platform, fast, and full featured.

I have always despised both vi and Emacs. I used both extensively in high-school and college and neither was intuitive for me. I always felt like I was fighting with them. The TurboPascal editor was the first editor I used where I felt like I was at home. GUI based editors were a godsend.


Last year I discovered Sublime Text 2 and have fallen in love.

Sublime Text 2 draws me in and makes me want to code! Weird, I know.

Chocolatey is Chocolate!

NuGet is awesome for libraries, but for frameworks and tools, the Chocolately package manager is fantastic. I’ve found it’s the easiest and most reliable way to install things like Node.js, git, and so forth on Windows.

The combination of these tools has given me hope that I can continue to use Windows for development work. I love my Macbook Air and my hatred for Mac OS has diminished (but not gone completely) as I’ve used it, but I do not want to replace my Windows desktop and I have tons of “Windows stuff” I need.

There are still little problems with the OSS workflow on Windows and they can be super annoying (see this Stackoverflow question I posted for an example), but for now I’m happy.

Hope this helps. Let me know if you have more tips!

4 comments


  1. Keith says:

    I gave up. Added 12gb of ram to my box, got a couple of ex lease core2 boxes and setup linux dev environments. I use Win7 for my editor, file manager, productivity apps but all files are served up via Samba, and I use SSH via Xshell to get proper command lines. The biggest advantage to doing it this way is that the tools all work and you never *have* to deal with crappy ports :).

  2. shanselman says:

    Mind linking my name to my blog?

    1. Done. Sorry about that. Not sure how I missed that.

  3. Maximus ConEmu says:

    There is another Hanselman’s post about ConEmu – Windows console emulator
    http://www.hanselman.com/blog/ConEmuTheWindowsTerminalConsolePromptWeveBeenWaitingFor.aspx

Debate this topic with me:

This site uses Akismet to reduce spam. Learn how your comment data is processed.