cdepillabout / pretty-simple

pretty-printer for Haskell data types that have a Show instance
https://hackage.haskell.org/package/pretty-simple
BSD 3-Clause "New" or "Revised" License
243 stars 29 forks source link

Escape unprintable characters #44

Closed dminuoso closed 5 years ago

dminuoso commented 5 years ago

The library does not handle unprintable characters specially. If one uses uses pretty-simple to print such characters to stdout this can corrupt a connected terminal or have some amusing effects, such as opening the system print dialog.

This patch escapes any unprintable characters except newlines while giving an option to turn the old behaviour back on.

cdepillabout commented 5 years ago

Thanks! I think this is a helpful change!