kowainik / colourista

‎️‍🌈 Convenient interface for printing colourful messages
https://kowainik.github.io/projects/colourista
Mozilla Public License 2.0
66 stars 18 forks source link

Font modifications are not applied in Windows #18

Closed ShrykeWindgrace closed 4 years ago

ShrykeWindgrace commented 4 years ago

Formatting with bold and italic has no effect when running in powershell/cmd on Windows (win10, winver=1809). Most probably, this is a limitation of the underlying ansi-terminal, not colourista, but I wanted to make this known nevertheless.

Example (colourista-0.0.0.0, lts-15.0, ghc-8.8.2):

{-# LANGUAGE OverloadedStrings #-}
module Main where

import Colourista

main :: IO ()
main = do
    putStrLn $ formatWith [bold, red, cyanBg] "Кириллица bold red cyanBg"
    putStrLn $ formatWith [bold, red, cyanBg] "Latin bold red cyanBg"
    putStrLn $ formatWith [bold, italic, red, cyanBg] "Latin bold italic red cyanBg"
    putStrLn $ formatWith [] "Latin"
    successMessage "Done"

yields in my powershell (with required unicode-enabling settings, of course) image Cmd (with chcp 65001) behaves similarly.

chshersh commented 4 years ago

@ShrykeWindgrace thanks for letting us know! It's good to be aware of such behaviour. However, nothing can be done here on the colourista side, since it is just a convenient and lightweight wrapper around the ansi-terminal library. Feel free to open this issue in the ansi-terminal directly, maybe the maintainer can investigate possible fix, and everyone will benefit from it.