Skip to content

Configurable colors, table formatting, support NO_COLOR spec#228

Merged
deviaze merged 3 commits into
mainfrom
customize-table-formatting-227
Jun 21, 2026
Merged

Configurable colors, table formatting, support NO_COLOR spec#228
deviaze merged 3 commits into
mainfrom
customize-table-formatting-227

Conversation

@deviaze

@deviaze deviaze commented Jun 20, 2026

Copy link
Copy Markdown
Collaborator

Configurable colors and formatting

seal now respects the NO_COLOR specification.

New features in std/io/format

Added format.FormatOptions which you can pass to format.pretty and format(); pass it to format.defaults to override the behavior of print and pp.

These options now include these new features:

  • print guidelines (automatically enabled when indent < 3)
  • configurable number of spaces to indent over
  • enable/disable printing metatables
  • limit the amount of array elements shown
  • enable/disable array indices (if you only care about seeing the values)
  • max table depth after which the formatter stops recursing.

General formatter improvements:

  • Formatter now prints function names when available and not equivalent to their table key value.
  • Formatter now prints snowflakes around frozen tables.

New features in std/terminal

  • terminal.background which gets the current background color of the terminal if supported. Might not be supported on all platforms/terminals.

Changes to std/io/colors

  • colors.rgb which allows generating arbitrary terminal colors.
  • colors.override enables or disables colors at runtime.
  • colors.enabled checks if colors are enabled or disabled for whatever reason (NO_COLOR/etc.)
image

This was linked to issues Jun 20, 2026
@deviaze deviaze merged commit 94b511f into main Jun 21, 2026
4 checks passed
@deviaze deviaze deleted the customize-table-formatting-227 branch June 21, 2026 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

make pretty formatting customizable Add a way to disable colors

1 participant