Skip to content

Proposal: Promote std.debug.TTY to non-debug functionality #15804

Description

@linusg

I found this struct the other day and think it doesn't need to be hidden away in the debug namespace, potentially preventing people from using it for non-debugging purposes.

Notably, it contains cross-platform text coloring (at least supports ANSI escape sequences and the Windows API), including feature detection (is color output supported, respect NO_COLOR, etc) via detectTTYConfig().

This proposal covers two things:

  • Moving TTY and detectTTYConfig() from std.debug to std.io
  • Adding missing colors (blue, magenta, bright variants, possibly more)

I'm happy to implement this once accepted.

Activity

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

    acceptedThis proposal is planned.contributor friendlyThis issue is limited in scope and/or knowledge of Zig internals.enhancementSolving this issue will likely involve adding new logic or components to the codebase.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.standard libraryThis issue involves writing Zig code for the standard library.

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions