Skip to content

Empty string in stdout instead of using handle #114

@Lev135

Description

@Lev135

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions