zsh running on cmder

Nuno Caneco
3 min readJul 16, 2017

--

When I started working with MacOS about an year ago, I got into using the shell much more than I used to in my past Windows-focused life (although I was already using cmder for some time, especially for git related stuff).

My awesome colleagues back than suggested that I should use zsh with oh-my-zsh plugin instead of bash (checkout this slideshare about zsh vs bash). I installed it and it made my life better: the <TAB> completion was nicer, it supports completion of git commands, arguments and alias(!)… Life was good.

Now that I’m back to Windows (which I must say I prefer to MacOS), I’m back to using cmder. Which is fine, but it got me wondering if I could use zsh on my Windows box.

Turns out I can use zsh on Windows! Even better: I can use zsh on cmder!

Installing zsh on Windows

To install zsh on Windows, just follow Sebastian Ginter’s instructions and you’ll be ready to go.

zsh running on Bash on Ubuntu on Windows — how cool is that?

But once you start really using it, you’ll notice some issues: some themes won’t work correctly as some unicode characters are replaced with a useless ?

Also, the bash console on Windows does not support tabs. Which makes it pretty useless for someone who makes heavy use of the console.

Running zsh on cmder

To setup zsh running on cmder, you need to have zsh running on Bash on Ubuntu on Windows, first. (if you don’t have it yet, just follow these instructions)

After that, you need to configure a new task in cmder to run Bash on Ubuntu on Windows:

  1. Open cmder
  2. On the menu, open Settings option and then select Startup > Tasks from the menu tree (or just hit Win + Alt + T)
  3. Click the “+” button to add a new task and fill in the fields as follow:
    Name: zsh
    Task Parameters: /icon %USERPROFILE%\AppData\Local\lxss\bash.ico
    Commands: cmd /c C:\Windows\System32\bash.exe ~ -new_console:p:%USERPROFILE%
  4. Click Save Settings

Et voila! Enjoy the full power of oh-my-zsh with multiple tabs on your Windows box.

Some tips and pitfalls up to now

  • Because git is a bit slow on Windows, it slows down a bit when the shell is on a git repo. Probably there’s something to improve, but I haven’t found it yet
  • The Windows drives are available at /mnt. This means that your C: drive is available on /mnt/c. Probably there’s something to fine tune also (like creating symlinks from /c to /mnt/c)

--

--