1
0
mirror of https://github.com/sharkdp/bat synced 2026-06-09 10:03:18 +00:00
Commit Graph

3809 Commits

Author SHA1 Message Date
Keith Hall 410e284322 Ignore --wrap=character when output is not interactive
unless it was explicitly provided on the command line as opposed to in a config file / BAT_OPTS env var
2026-03-31 22:51:47 +03:00
Keith Hall 7d9884d6d2 Merge pull request #3655 from claw-explorer/docs/fish-abbr-removal
docs: add instructions for removing fish help abbreviations
2026-03-28 22:44:07 +02:00
Claw Explorer 652489251b docs: move removal instructions into a TIP callout
Address review feedback from @keith-hall: wrap the abbreviation
removal instructions in a GitHub callout (> [!TIP]) to visually
separate them from the main setup flow. Also reorder so the
'This way, you can keep on using...' sentence follows directly
after the abbreviation creation, improving readability.
2026-03-28 16:34:28 -04:00
Claw Explorer 89f3d2d31a docs: add instructions for removing fish help abbreviations
Add documentation showing how to erase the fish abbreviations for
--help and -h, since the dash-prefixed names make removal non-obvious.
The key is using -- before the abbreviation name to prevent fish from
interpreting it as a flag.

Closes #3536
2026-03-26 12:21:56 -04:00
Keith Hall 3ee9ea9a8d Merge pull request #3652 from cyqsimon/syntax-mapping-glob-parse-cleanup
Builtin syntax mapping: cleanup matcher glob parsing logic
2026-03-25 22:01:52 +02:00
cyqsimon b511b928f4 Write changelog 2026-03-25 15:58:58 +08:00
cyqsimon 3e789f5241 Imprv: cleanup matcher glob parsing logic
- Data flow is now strictly linear from `RawMatcher` to `Matcher`
  - I've also hoisted `RawMatcher` in front of `Matcher` to signal this
- Re-type `RawMatcher.case_sensitive` from `bool` to `Option<bool>`
  - This moves all parser logic away from `RawMatcher`, making it a more faithful representation of the data
- Favour default consts in `Matcher::try_from<RawMatcher>` to `Default` impl on `Case`
  - Because the default choice of casing is a design decision of the logic, not an intrinsic property of the type
2026-03-25 15:58:45 +08:00
Keith Hall a500fb236a Merge pull request #3650 from Sim-hu/fix/i686-deb-architecture
fix: use correct Debian architecture name for i686 .deb
2026-03-24 22:37:48 +02:00
Keith Hall 515b9d62db Merge branch 'master' into fix/i686-deb-architecture 2026-03-24 22:23:29 +02:00
Keith Hall 62907b1da5 Merge pull request #3651 from sharkdp/minus_home_end_keys
Add Home/End key bindings to builtin minus pager
2026-03-24 22:22:53 +02:00
Keith Hall eef7107407 update changelog 2026-03-24 21:38:07 +02:00
copilot-swe-agent[bot] 87e043b91c Add Home/End key bindings to builtin minus pager
Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
2026-03-24 21:33:43 +02:00
Sim-hu b8d462ba87 fix: add PR number and author to changelog entry 2026-03-24 19:24:36 +09:00
Sim-hu ca3ef28d56 fix: use correct Debian architecture name for i686 .deb package
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
2026-03-24 19:20:18 +09:00
Sungjoon Moon 0b4c886efc ci: Use git version of cross for better target support 2026-03-24 06:09:32 +01:00
Keith Hall 780fdeb888 Merge pull request #3576 from vorburger/patch-2
feat: Map BUILD to Python (Starlark) for Bazel (fixes #3575)
2026-03-22 20:14:05 +02:00
Keith Hall 7a9c6e0de5 Merge branch 'master' into patch-2 2026-03-22 17:47:24 +02:00
Keith Hall a1e7c0ab4a Merge pull request #3643 from mvanhorn/feat/diff-plain-compatibility
feat: preserve change markers when combining --diff with --plain
2026-03-21 16:30:43 +02:00
Keith Hall 1e36873704 Merge branch 'master' into feat/diff-plain-compatibility 2026-03-21 16:21:56 +02:00
Matt Van Horn e86797fbf4 style: auto-format integration tests
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-20 15:46:54 -07:00
Matt Van Horn e60875ac12 fix: gate Changes component on git feature flag
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>
2026-03-20 15:27:10 -07:00
Keith Hall 66eece4e2c Merge branch 'master' into patch-2 2026-03-20 23:57:19 +02:00
Keith Hall a19593b383 improvements from PR review
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.
2026-03-20 23:53:30 +02:00
Keith Hall 7a6f442c86 improvements from PR review
- prefer to use `Default::default` because it's semantically clearer why we've chosen to use a particular value
2026-03-20 23:35:27 +02:00
Keith Hall 3767f15c2a improvements from PR review
fix documentation about syntax mappings
2026-03-20 23:34:38 +02:00
Keith Hall 1932d1da39 Merge pull request #3642 from mvanhorn/fix/deb-musl-package-names
fix: consistent .deb MUSL package names
2026-03-20 22:57:41 +02:00
Keith Hall b0e5590864 Merge branch 'master' into fix/deb-musl-package-names 2026-03-20 22:42:24 +02:00
Keith Hall f2daa1eb6e Merge pull request #3640 from eyupcanakman/fix/binary-as-text-width-3631
Fix line wrapping for files with control characters
2026-03-20 22:40:28 +02:00
Eyüp Can Akman 1f540752ef fix: reference PR number in CHANGELOG entry 2026-03-20 22:28:39 +02:00
Eyüp Can Akman fc94a0ec49 fix: account for caret notation width in text wrapping
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
2026-03-20 22:28:39 +02:00
Matt Van Horn 169dc7c45b test: add integration tests for --diff combined with --plain 2026-03-20 10:33:33 -07:00
Matt Van Horn 5e140558b1 fix: update changelog entry with PR number for CI check 2026-03-19 21:38:03 -07:00
Matt Van Horn 99c8e15c27 fix: update changelog entry with PR number for CI check 2026-03-19 21:37:45 -07:00
Matt Van Horn 2a3ed948ec feat: preserve change markers when combining --diff with --plain
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
2026-03-19 21:35:48 -07:00
Matt Van Horn 618d7340bb fix: consistent .deb MUSL package names
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
2026-03-19 21:34:12 -07:00
Keith Hall 4a38eab3ea Merge pull request #3628 from XploitMonk0x01/codex/clarify-bat-vs-batcat
docs: clarify Ubuntu and Debian executable name
2026-03-19 23:00:59 +02:00
XploitMonk0x01 9fccdbc484 docs: clarify Ubuntu and Debian executable name 2026-03-19 22:50:23 +02:00
Keith Hall c6e661d80b cargo fmt 2026-03-18 22:25:07 +02:00
Keith Hall 031ba0953a Merge branch 'master' into patch-2 2026-03-18 22:17:18 +02:00
copilot-swe-agent[bot] 2a29802dd5 Refactor: string-or-struct matcher syntax, Case enum, remove case_sensitive_mappings table
Co-authored-by: keith-hall <11882719+keith-hall@users.noreply.github.com>
2026-03-18 22:16:50 +02:00
Keith Hall 31e30a2e97 Merge pull request #3636 from victor-gp/add-mapping-for-ignore-files
Add mapping for ignore files
2026-03-18 22:08:02 +02:00
Víctor González Prieto ffed52f6eb Document how to contribute syntax mappings 2026-03-18 21:58:23 +02:00
Víctor González Prieto a4e853c4fa Map ignore files to Git Ignore syntax
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.
2026-03-18 21:58:23 +02:00
Keith Hall f11374535d Merge pull request #3629 from Rohan5commit/docs/fix-readme-wording
docs: fix README sidebar wording
2026-03-18 20:37:04 +02:00
rohan436 de209f8a23 docs: fix README sidebar wording 2026-03-18 20:15:53 +02:00
Keith Hall 22c38b6fcb Merge remote-tracking branch 'origin/master' into patch-2 2026-03-18 05:19:21 +02:00
Keith Hall 63d5796f8f Merge pull request #3635 from victor-gp/add-mappings-for-gcloud-cli
Add syntax mappings for GCloud CLI config files
2026-03-17 22:45:12 +02:00
Víctor González Prieto a1917275cd Add syntax mappings for GCloud CLI config files
> .boto => INI

I was uninstalling gcloud-cli and the docs said to review the contents
of ~/.boto [^1].

`bat` doesn't recognize it but it's just an INI-like file to configure
gsutil [^2].

I took the chance to add a few more mappings for other GCloud config
files without extension...

> .gcloudignore => Git Ignore

This one's self-explanatory, but it's documented in [^3].

Makes me wonder if we could just do a blanket `Git Ignore = ".?*ignore"`
for every kind of ignore file. For instance, `bat` doesn't catch
.dockerignore either.

> **/gcloud/configurations/config_* => INI

These are configuration files for each different profile you have
configured for the gcloud-cli [^4].

They're named like "config_default" or "config_<name>", without a
file extension, but they are also INI syntax [^5][^6].

[^1]: https://docs.cloud.google.com/sdk/docs/uninstall-cloud-sdk
[^2]: https://docs.cloud.google.com/storage/docs/boto-gsutil
[^3]: https://docs.cloud.google.com/sdk/gcloud/reference/topic/gcloudignore
[^4]: https://docs.cloud.google.com/sdk/docs/configurations
[^5]: https://stackoverflow.com/questions/74290882/return-active-gcp-project-name-programatically-for-both-local-dev-and-deployed-c/7^4292151#74292151
[^6]: https://stackoverflow.com/questions/49212350/where-does-gcloud-store-its-defaults/49256835#49256835
2026-03-17 20:51:23 +01:00
Keith Hall 884765bdeb Merge remote-tracking branch 'origin/master' into patch-2 2026-03-14 09:21:19 +02:00
Keith Hall 56fe0fa226 Add case-sensitive glob support to syntax mapping
to allow us to map `BUILD` case sensitively to Python for Skylark
2026-03-14 09:18:56 +02:00