How can I set my GHCi prompt to a lambda character on Windows?

Using > chcp.com 65001 worked with GHCi but opening other text files with Vim after setting that encoding returned garbled text.

Add the following to your %USERPROFILE%\.ghci. Instead of changing the encoding, you can use the Unicode escaped lambda \x03BB:

:set prompt  "\x03BB: "

If %USERPROFILE%\.ghci does not exist, create it first before making the change.


This is actually quite a simple fix, just run the following command before starting GHCi:

> chcp.com 65001

This sets Window's encoding to the 65001 code page, which lets the λ get displayed properly:

enter image description here

This will also let a lot of other Unicode characters be displayed properly in cmd.exe and other Windows shells (such as Cygwin bash), but Windows' Unicode support is still not perfect, and some fonts don't support many of the characters. Luckily, λ happens to be a supported character so we can all have the classic GHCi prompt.