fix: apply --no-color flag to huh interactive prompts#454
Open
fix: apply --no-color flag to huh interactive prompts#454
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #454 +/- ##
==========================================
- Coverage 70.42% 70.42% -0.01%
==========================================
Files 221 221
Lines 18539 18568 +29
==========================================
+ Hits 13057 13076 +19
- Misses 4307 4314 +7
- Partials 1175 1178 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
2 tasks
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.
Changelog
Summary
The --no-color flag stripped styles from CLI output but not from huh interactive prompts (select, confirm, input, etc.), because huh uses its own theme/rendering pipeline. This PR added ThemePlain() — a colorless huh theme with no ANSI styling so that when --no-color is set, forms now use ThemePlain + huh's accessible mode, rendering as plain numbered lists instead of a styled TUI
Test plan
Run
slack create --no-colorand verify prompts render as plain numbered lists with no colorRun
slack login --no-colorand verify confirmation prompt has no colorRun
slack create(without --no-color) and verify themed prompts still workgo test ./internal/style/ ./internal/iostreams/Requirements