2010年12月18日星期六

[Console2 + Cygwin + bash + Mercurial + style template] to support ANSI escape code

As I find some nice looking hg log style template, I want to use them in my environment.
After spending sometime in trial and error, I figure out a way to support it.
Here are the necessary settings:

Console2 setting:

Title: cygwin
Icon: C:\cygwin\Cygwin.ico
Shell: C:\WINDOWS\system32\ansicon.exe C:\WINDOWS\system32\startbash.bat
Startup dir: C:\cygwin\home\kip

For ansicon.exe, please refer to other post: ANSICON provides ANSI escape sequences for Windows console programs 

startbash.bat is just two lines:

@echo off
C:\cygwin\bin\bash.exe --login -i


Cygwin setting:

.bash_profile:
export TERM=ansi



Mercurial setting:


.hgrc:
[extensions ]
color =


[color]
mode = ansi




The right click context menu "Open cygwin here" cannot be use after these changes, but you can still add "Open cygwin" in context menu by adding following in registry:


open_cygwin.reg

Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\Directory\shell\Open cygwin\command]
@="C:\\Program Files\\Console2\\Console.exe -t cygwin"

After completed all these steps, you can try hg slog, nlog, sglog.
Please refer to previous post: [Mercurial] Enhance hg log with nice coloring 

沒有留言:

發佈留言