Inspired by the Posh-Git project (http://github.com/dahlbyk/posh-git)

Posh-hg provides a custom prompt and tab expansion when using Mercurial from within a Windows Powershell command line.

For more details, see this post on Jeremy's blog

The source code is available on github

posh-hg.png

To install posh-hg, download the latest source either from github or on CodePlex
and add the following code to your Powershell profile (usually C:\Users\Username\Documents\WindowsPowershell\Profile.ps1)

. path\to\posh-hg\profile.example.ps1

Alternatively, you can copy the contents of the profile.example.ps1 file in to your profile.ps1

The prompt is customisable. For example, you could have a multi-line prompt:

posh-hg2.png

...by adding the following lines to your Profile.ps1:

$global:HgPromptSettings.BeforeText = ' on '
$global:HgPromptSettings.BeforeForegroundColor = [ConsoleColor]::White
$global:HgPromptSettings.AfterText = " `nhg"
$global:HgPromptSettings.BeforeTagText = ' at '

Last edited Feb 7, 2012 at 4:19 PM by JeremyS, version 6