pretty-simple icon indicating copy to clipboard operation
pretty-simple copied to clipboard

Empty string in `stdout` instead of using handle

Open Lev135 opened this issue 1 year ago • 1 comments

As far as I understood pHPrint prints eoln at the end using putStrLn, not in handle. It was very suprising for me. Why it's do so? Is it a bug or a feature?

pHPrintStringOpt checkColorTty outputOptions Handle
handle str = do
  realOutputOpts <-
    case checkColorTty of
      CheckColorTty -> hCheckTTY handle outputOptions
      NoCheckColorTty -> pure outputOptions
  liftIO $ do
    renderIO handle $ layoutStringAnsi realOutputOpts str
    putStrLn ""

I've found it while rendering in file using pHPrint and these empty lines surprised me

Lev135 avatar Jul 27 '22 17:07 Lev135

@Lev135 Thanks for submitting this issue!

This is very likely a bug. Would you be able to send a PR fixing this?

cdepillabout avatar Jul 27 '22 18:07 cdepillabout