Skip to content

PrefixPrinter does not use changed defaultWriter #751

Closed

Description

@christeredvartsen

The prefix printers included in pterm are initialized to use pterm.defaultWriter as their writer.

When calling pterm.SetDefaultOutput(writer) the prefix printers will still use the original default, so we need to call p.WithWriter(writer) to use a different writer.

Reading the comment of the pterm.SetDefaultOutput function I would assume the prefix printers would also use the updated default.

I have a fix for this in a local branch along with a test case, and can send a pull request if you are interested.

Activity

  1. added
    bug
    on Nov 4, 2025
  2. christeredvartsen commented on Nov 11, 2025

    @christeredvartsen
    ContributorAuthor

    Similar issue: #701

  3. added a commit that references this issue on Feb 25, 2026
    bcb9c07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions