Using Mercurial with Windows Powershell

Last month I wrote about using git with Windows Powershell by making use of a custom prompt function as well as tab expansion. My sample code for the git tab expansion and Mark’s custom prompt are now available on GitHub in the posh-git project.

I’ve also ported both the prompt and the tab expansion to work with Mercurial.


Much like the git prompt, the Mercurial prompt shows the name of the branch as well as other information. The prompt shows the following information:

I’ve also written some basic tab expansion functionality that provides completion for hg commands as well as hgtk commands (the TortoiseHg command line tool).

Code can be found in the posh-hg repository (somewhat ironically hosted on GitHub).