Skip to content

fix: correct $LESSCLOSE exit-status warning#3654

Open
cuiweixie wants to merge 2 commits intosharkdp:masterfrom
cuiweixie:fix/lessclose-nonzero-warning
Open

fix: correct $LESSCLOSE exit-status warning#3654
cuiweixie wants to merge 2 commits intosharkdp:masterfrom
cuiweixie:fix/lessclose-nonzero-warning

Conversation

@cuiweixie
Copy link
Copy Markdown

Summary

Fix inverted logic when reporting $LESSCLOSE cleanup failures: bat warned on successful exit and stayed silent when the command failed.

Test plan

  • cargo test (lessopen module tests cover env handling)

The Drop cleanup for Preprocessed inverted the exit-status check, so bat
emitted a warning when LESSCLOSE exited successfully and stayed silent on
failure. Align the condition with the intended behavior.
Copy link
Copy Markdown
Collaborator

@keith-hall keith-hall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Do you think it is possible to add an assertion for this in the integration tests, to prove the warning appears only when it should?

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.

2 participants