Disable animation for NO_COLOR + TERM=dumb - #584
Open
hagenw wants to merge 2 commits into
Open
Conversation
Contributor
Reviewer's GuideImplements environment-controlled disabling of shimmer animations via NO_COLOR and TERM=dumb, centralizes the logic in a new helper, and adds tests/fixtures to ensure shimmer becomes a no-op while still printing static text once when animations are disabled. Sequence diagram for shimmer.start behavior with NO_COLOR and TERM=dumbsequenceDiagram
actor User
participant Shimmer
participant sys_stdout
participant animations_enabled
User->>Shimmer: start()
Shimmer->>sys_stdout: hasattr(sys_stdout, isatty)
Shimmer->>sys_stdout: isatty()
Shimmer->>animations_enabled: animations_enabled()
alt interactive_tty and animations_enabled
Shimmer->>Shimmer: _start_animation_thread()
else non_interactive or animations_disabled
Shimmer->>sys_stdout: write(prefix + text + suffix + "\n")
Shimmer->>sys_stdout: flush()
Shimmer->>Shimmer: _noop = True
end
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Member
Author
|
@frankenjoe this branch should disable the animation if you run |
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.
Closes #582
Skips the shimmer animation if the environment variable
NO_COLORis set or the environment variableTERMis set todumb.