Skip to content

Conversation

WhoSowSee
Copy link

@WhoSowSee WhoSowSee commented Aug 24, 2025

Fix: Display theme icons with --color=never option

This commit fixes issues #1590

Problem

When using the --color=never flag, custom icons defined in theme.yml were not being displayed. This happened because the icon rendering logic was incorrectly coupled with color styling, causing icons to be suppressed when colors were disabled.

Root Cause

In src/theme/ui_styles.rs, the icon_style() method was returning early when self.use_colours was false, preventing any icon styling (including non-colored icons) from being applied.

Solution

Separated icon display logic from color styling logic:

  1. Always apply icon glyphs from theme configuration regardless of color settings
  2. Only apply color styles when use_colours is true
  3. Preserve all existing behavior for other use cases

Changes Made

  • Modified icon_style() method in src/theme/ui_styles.rs
  • Icons from theme.yml now display with --color=never
  • Color styling still works correctly with --color=always and --color=auto

Preview

Before

481328147-4bd1c88a-6f5b-4fb0-a2bb-996d9d3fbfca

After

изображение

@WhoSowSee WhoSowSee force-pushed the main branch 3 times, most recently from cc296d6 to 5876450 Compare August 24, 2025 22:34
Previously, when using --color=never, custom icons from theme.yml
were not displayed because the icon rendering was coupled with
color styling logic.

This change separates icon display from color styling by:
- Always applying icon glyphs from theme configuration
- Only applying color styles when colors are enabled
- Preserving existing behavior for all other cases

Fixes the issue where --color=never would suppress themed icons
while still maintaining proper color control functionality.

Tested with custom theme.yml containing file extension and filename
icon mappings - icons now display correctly with --color=never.
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.

bug: --color=never completely ignores theme.yml`, including icon settings
1 participant