Repository navigation
fix sanitize config options - #4141
Merged
Merged
Conversation
curious-rabbit
force-pushed
the
sanitize-modes
branch
from
November 19, 2026 17:30
1c1d6df to
46db3fd
Compare
curious-rabbit
marked this pull request as draft
November 19, 2026 17:44
curious-rabbit
marked this pull request as ready for review
November 19, 2026 17:47
keith-hall
approved these changes
Nov 20, 2026
keith-hall
enabled auto-merge
November 20, 2026 21:08
cindykrafft
pushed a commit
to cindykrafft/bat
that referenced
this pull request
Nov 23, 2026
Brings in sharkdp#4141, which moves line decoding in print_line into decode_line(). No conflicts; the blank-line check for -b still runs on the input before the line is rendered. Co-Authored-By: Claude Fable 5.2 <[email protected]> Claude-Session: https://claude.ai/code/session_01VVn4SeAXPsUajXT2rtHQfo
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.
The --sanitize option has three possible values:
never,autoandalwaysbut they do not behave as users may expectIt was originally modeled after
--strip-ansiand intended to strip the dangerous sequences. Original discussions here and hereHowever the option was changed to instead replace the sequences and not strip them, so that possible dangerous content of a file is indicated safely with � and not hidden. The options still followed the reasoning of
--strip-ansihowever, which caused auto to not sanitize plain text files (like --strip-ansidoes) and always to ignore pipes.This PR fixes the options to be much more intuitive:
--sanitize=autoalways filters all files without exception when the output is a interactive terminal, and doesn't filter in piped mode, this aligns with how other options like--colorbehave as well.--sanitize=alwaysnow filters always, including in piped mode