The i686 .deb package declared its architecture as "i686", which
Debian does not recognize. Debian uses "i386" for 32-bit x86,
matching the convention already used by the other targets (arm64,
armhf, amd64).
Closes#3611
When bat is built without the `git` feature, `StyleComponent::Changes`
is not available. Add `#[cfg(feature = "git")]` guard so `--diff --plain`
works in both configurations.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1. Added `Deserialize` derive and `#[serde(try_from = "RawMatcher")]` to the `Matcher` struct. With `try_from`, serde generates a `Deserialize` impl that first deserializes into `RawMatcher`, then calls `TryFrom<RawMatcher> for Matcher`. It never attempts to deserialize `Matcher`'s fields directly, so `Case` and `MatcherSegment` don't need `Deserialize` impls.
2. Replaced the manual `impl<'de> serde::Deserialize<'de> for Matcher` with a standard `impl TryFrom<RawMatcher> for Matcher`. The logic is identical - the conversion is fallible because `Matcher::from_str` returns `Result<_, anyhow::Error>`, so `try_from` (not `from`) is the correct choice, avoiding any panics.
The net effect: same behavior, same error handling, but using the idiomatic serde pattern instead of a manual deserializer impl. The `RawMatcher` intermediate type and its `#[serde(untagged)]` derive remain unchanged.
Control characters displayed in caret notation (e.g. ^@ for NUL)
occupy 2 terminal columns, but the width calculation treated them
as 0-width. Add a char_width() helper that returns 2 for control
characters, fixing incorrect line wrapping with --binary=as-text.
Fixes#3631
When --plain is set (via CLI or config file), --diff output loses all
visual markers, making it indistinguishable from plain text. The diff
line filtering still works, but without Changes markers or Snip
separators the output is not useful.
Automatically include Changes and Snip style components when --diff is
active alongside --plain. This preserves the --plain intent (no grid,
no header, no line numbers) while keeping diff output readable.
Closes#3630
Fix two inconsistencies in MUSL .deb package naming:
1. Change dpkg_arch for aarch64-unknown-linux-musl from `arm64` to
`musl-linux-arm64` to match the convention used by other MUSL targets.
2. Change the DPKG_BASENAME case pattern from `*-musl)` to `*-musl*)`
so it also matches `musleabihf`, giving the arm target the `bat-musl`
prefix like all other MUSL packages.
After this fix, all MUSL .deb packages follow the consistent pattern:
`bat-musl_VERSION_musl-linux-ARCH.deb`
Closes#3482
This would catch any dotfiles that end in "ignore", but not `.ignore`
Set as a lower priority rule (90 vs the usual 50) because it's a blanket
assignation. If there are conflict with other, more specific rules,
those will take precedence.
When a symlink name has no recognizable extension (e.g. Aliases/0install),
syntax detection fails because the symlink path doesn't match any syntax.
The target file may have a recognizable extension (e.g. Formula/zero-install.rb)
but was never consulted.
When path-based syntax detection fails with UndetectedSyntax, canonicalize
the path to resolve symlinks and retry detection with the target path.
This preserves existing behavior where the symlink path itself matches
(e.g. .ssh/config), since the original path is tried first.
Closes#1001
When BAT_CONFIG_DIR is set to the system config directory (e.g. /etc/bat),
both system_config_file() and config_file() resolve to /etc/bat/config.
The config file was read twice, causing clap errors for non-repeatable flags
like --italic-text.
Skip the user config read when it resolves to the same file as the system
config, using canonicalization to also handle symlinks.
Closes#3589
* feat(cli): add fallback syntax option
Expose a new fallback syntax CLI option so users can opt into syntax highlighting only when auto-detection fails.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* feat(syntax): apply fallback only after detection fails
Use the fallback syntax only when path and first-line detection fail, preserving existing behavior for detected files and explicit language selection.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* test(cli): cover fallback syntax behavior
Add integration coverage for fallback syntax usage, precedence with --language, and no-op behavior when syntax is already detected; update help snapshots for the new option.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
* docs(changelog): document fallback syntax option
Record the new fallback syntax feature in the unreleased changelog section.
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode)
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
---------
Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>