Skip to content

Conversation

@ChrisRackauckas
Copy link
Member

Summary

  • Fixed issue where error messages would display with ANSI color codes even when Julia was run with --color=no
  • Now checks the IOContext's :color property before using printstyled with colors
  • Falls back to plain print() when colors are disabled

Test plan

  • Run Julia with --color=no and verify error messages display without color codes
  • Run Julia normally and verify colored error messages still work
  • All existing tests pass

This change ensures that DiffEqBase respects Julia's color settings, making it compatible with environments that don't support ANSI colors (like Weave.jl).

Fixes #194

🤖 Generated with Claude Code

This PR fixes issue #194 by checking the IOContext's :color property before using printstyled with colors. When Julia is run with --color=no, error messages will now display without ANSI color codes.

Changes:
- Check `get(io, :color, false)` before using printstyled with colors
- Fall back to plain print() when colors are disabled
- Applied to both CommonKwargError and checkkwargs warning messages

Fixes #194

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@ChrisRackauckas ChrisRackauckas deleted the fix-ansi-color-respect branch July 24, 2025 10:52
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.

Disable ANSI colors

2 participants