Fix: Corrected color formatting in interface status output#479
Open
c0dew3ll wants to merge 1 commit intokimocoder:masterfrom
Open
Fix: Corrected color formatting in interface status output#479c0dew3ll wants to merge 1 commit intokimocoder:masterfrom
c0dew3ll wants to merge 1 commit intokimocoder:masterfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
The interface status line was displaying literal curly braces around the "Up" status (e.g., Up: {}no{}) instead of applying the intended colors.
Cause:
The issue was caused by an f-string escaping conflict. Inside the f-string's expression block (the inline if/else), double curly braces {{O}} were being treated as literal characters rather than being unescaped. This resulted in the Color.pl method receiving {{O}}no{{W}} and failing to parse the color codes correctly, leaving the outer braces visible in the terminal.
Changes:
Removed unnecessary double braces inside the f-string's conditional logic for the iface.is_up check.
Verified that the status now correctly displays as colored text (Green "yes" / Orange "no") without visible brackets.
Before:

After:
