You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Automatically build the syntax/theme cache on first run when custom themes or syntaxes are present but no cache exists yet, so newly installed dotfiles work without a manual bat cache --build. Use --no-custom-assets to opt out. Closes #4017, see #4038 (@mmustafasenoglu)
Add -b / --number-nonblank flag to only number non-blank lines, for cat -b compatibility. Closes #3856, see #3857 (@MeGaurav4)
Add a --sanitize=<auto|always|never> flag for safe display of untrusted input. It substitutes terminal-active control bytes (escape, cursor moves, charset switches, beep, etc.) and Unicode bidi / zero-width formatting characters with the Unicode replacement character (U+FFFD). Mitigates Trojan-Source-style spoofing (CVE-2021-42574). See #3729 (@curious-rabbit)
Map justfile, Justfile, .justfile, and *.justfile to Makefile syntax highlighting, see #3623 (@zachvalenta)
Implement --unbuffered mode for streaming input, allowing partial lines to display immediately (e.g. tail -f | bat -u). Closes #3555, see #3583 (@mainnebula)
Added an initial flake.nix for a ready made development environment; see #3578 (@vorburger)
Add --quiet-empty (-E) flag to suppress output when input is empty. Closes #1936, see #3563 (@NORMAL-EX)
Improve native man pages and command help syntax highlighting by stripping overstriking, see #3517 (@akirk)
Add --fallback-syntax/--fallback-language to apply syntax highlighting only when auto-detection fails, see #1341 (@Xavrir)
Map BUILD case sensitively to Python (Starlark) for Bazel, see #3576 (@vorburger)
Syntax highlighting for Python files using uv as script runner in shebang #3689 (@janlarres)
Bugfixes
Track reverse video (SGR 7 / 27) in the ANSI style tracker so it is re-emitted like bold, dim, italic, and underline, and is no longer dropped after the first wrapped line when displaying ANSI input, see #4144 (@BlueX888)
Preserve buffered stdin when $LESSOPEN temporary-file mode falls back to the original input, and handle CRLF line endings on returned temp paths, see #4158 (@xgbtxy)
Skip cache metadata validation when --no-custom-assets is set so outdated or malformed caches do not block fallback to integrated assets, see #4157 (@xgbtxy)
Only show style decorations with --decorations=auto when stdout is interactive, so piped --color=always output no longer includes the header, grid, or line numbers, see #4151 (@draarivpatel-ui)
Break --wrap=word lines at whitespace in earlier highlighted tokens or before ANSI escape sequences instead of in the middle of a word, closes #4139, see #4140 (@mansur-akhmadi)
Fix bat cache --help returning exit code 1 instead of 0. Remove .arg_required_else_help(true) from the cache subcommand and show help when no arguments are provided. See #3798, #3831 and #3837 (@Amilliox)
Fix builtin pager (minus) not responding to search (/, ?, n, N) and navigation (PgUp, PgDown, arrows, g, G) keys. HashedEventRegister was overriding all default minus bindings instead of extending them. Add generate_default_bindings() before custom bindings. See #3831, #3798 and #3837 (@Amilliox)
Build the cache automatically on first run when custom themes or syntaxes are in subdirectories, see #4131 (@NotAFlightRisk)
Do not run filter commands from the configuration of the Git repository that contains the displayed file, see #4127 (@curious-rabbit)
Ignore empty --ignored-suffix values to avoid a stack overflow, see #4122 (@spicysharkco)
Don't emit --highlight-line escape sequences (background color or ansi theme underline) when colors are disabled with --color=never. Closes #4099, see #4100 (@DeviousCardi)
Fix missing colors, pager, and decorations in mintty/MSYS2 and Cygwin terminals on Windows, see #4115 (@rezamuliawijaya)
Make full-path --map-syntax patterns and the built-in $HOME and $XDG_CONFIG_HOME mappings work on Windows, see #4113 (@b84330808)
Keep configuration and BAT_OPTS active for option-like filenames after --, and report invalid configuration for help-like filenames, see #4112 (@Marve10s)
Keep emoji sequences together within text chunks when wrapping content, and measure their combined display width, see #4108 (@Marve10s)
Preserve full-path syntax mappings when removing ignored filename suffixes, see #4111 (@Marve10s)
Fix UTF-16 line splitting at unaligned newline bytes corrupting text and shifting line ranges, see #4110 (@Marve10s)
Respect NO_COLOR for the [bat error] and [bat warning] prefixes, see #4048 (@qodelicious)
Offer the valid --wrap value auto instead of the rejected always in the PowerShell completion, see #4070 (@ump45nose)
Report BAT_CONFIG_DIR in bat --diagnostic, so bug reports show a config directory that overrides $XDG_CONFIG_HOME. See #4068 (@ump45nose)
Ignore a UTF-8 byte order mark at the start of the config file instead of treating it as part of the first argument, see #4103 (@jaeminbird)
Keep backslashes in the pager command on Windows, so BAT_PAGER=C:\tools\less.exe is found instead of becoming C:toolsless.exe, see #4104 (@jaeminbird)
Fix bat hanging forever on JavaScript (and Svelte) code where an expression is followed by a block comment, e.g. a /* x */. Closes #4080, see #4091 (@NavpreetSSidhu)
Fix the first line of UTF-16BE input swallowing the second line, which broke line numbers, --line-range and highlighting, see #4102 (@cindykrafft)
Exit quietly with status 0 instead of panicking when stdout is closed early (broken pipe) on auxiliary output paths such as --completion, --config-file, --diagnostic, --generate-config-file, --set-terminal-title and cache --build/--clear, matching the main output path since #232, closes #4034, see #4035 (@Mathjk)
Fix escape sequence handling in --strip-ansi and --sanitize. --sanitize no longer removes escape sequences, which could hide text, see #4024 (@curious-rabbit)
Report unknown languages in plain piped output, see #4001 (@ryanchou1994)
Track strikethrough (SGR 9 / 29) in the ANSI style tracker so it is re-emitted like bold, dim, italic, and underline, and is no longer dropped after the first highlighted token when displaying ANSI input with syntax highlighting, see #4015 (@mikehasa)
Allow boolean flags to be given more than once, so that a flag set in the config file can also be passed on the command line without erroring, see #3912 (@logarithmone1128)
Allow options that take a value (--binary, --italic-text, --nonprintable-notation, --fallback-syntax, --squeeze-limit) to be given more than once, so that a value from the config file can be overridden on the command line, see #4102 (@Huang-404-Q)
Use parsed CLI arguments to detect number flags, see #3908 (@cuishuang)
Detect binary content beyond the first line, preventing encrypted files with early line breaks from being treated as text. Closes #3554, see #3877 (@Matei02355)
Use the last occurrence of numbering and plain flags in combined short arguments, see #3897 (@cuishuang)
Avoid a spurious Cargo manifest error during installation from Git, see #3899 (@rootsec1)
Avoid repeated scans of long lines in Log syntax highlighting, see #3876 (@Matei02355)
Fix --list-languages respecting --paging=never, see #3828 (@cyphercodes)
Fix --sanitize passing through the bidi control characters U+200E, U+200F and U+061C, see #3862 (@lenamonj)
--strip-ansi: also strip 8-bit C1 introducers (U+0090, U+0098, U+009B, U+009D, U+009E, U+009F) and DCS/SOS/PM/APC sequence bodies, which previously passed through. See #3729 (@curious-rabbit)
Fix --ignored-suffix not falling back to first-line/shebang detection when the ignored suffix is also a registered extension (e.g. --ignored-suffix .txt on a shebang script), see #2745 and #3816 (@adnrivera)
Fix capacity overflow panic when printing a snip separator at --terminal-width=1 with multiple line ranges. Closes #3803, see #3804 (@leeewee)
Pass --no-paging to bat invocations inside the bash / zsh / fish / PowerShell shell completion scripts so that shell-level pager wiring (e.g. LESSOPEN='|-bat -f -pp %s') cannot inject ANSI escape sequences into the completion candidates. Closes #3760 (@mvanhorn)
Quote filenames before substituting them into $LESSOPEN / $LESSCLOSE templates, preventing shell injection when a filename contains shell metacharacters, see #3726 (@curious-rabbit)
Fix --list-themes unconditionally probing the terminal via OSC 10/11 even when --theme was set to an explicit value, see #3700 (regression introduced in bc42149). (@optimistiCli)
Fix inverted $LESSCLOSE warning so bat warns on nonzero exit, not on success. See #3654 (@cuiweixie)
Sanitize control characters in filenames before displaying them in the file header, error messages, and the terminal title, preventing ANSI escape injection via crafted filenames. Closes #3054, see #3691 (@curious-rabbit)
Report initial input read errors instead of treating them as empty input. Closes #3002, see #3706 (@lawrence3699)
Treat ZIP archives as binary content based on their magic header, see #3686 (@officialasishkumar)
Fix i686 .deb package using incorrect architecture name (i686 instead of i386), preventing installation on Debian. Closes #3611, see #3650 (@Sim-hu)
Fix inconsistent .deb MUSL package names (aarch64-musl used arm64 instead of musl-linux-arm64, and musleabihf target missed bat-musl prefix). Closes #3482, see #3642 (@mvanhorn)
Fix incorrect text width computation when using --binary=as-text with non-printable characters in caret notation, see #3640 and #3631 (@eyupcanakman)
Fix BAT_CONFIG_DIR pointing at system config directory causing duplicate flag errors. Closes #3589, see #3620 (@Xavrir)
Fix syntax highlighting for symlinked files when the symlink name has no extension but the target does. Closes #1001, see #3621 (@Xavrir)
Report error when pager is missing instead of silently falling back, see #3588 (@IMaloney)
Fix --wrap=never and -S flags being ignored when piping to pager, see #3592 (@IMaloney)
Fix crash with BusyBox less on Windows, see #3527 (@Anchal-T)
Fix bat cache --help failing with 'unexpected argument' error, see #3580 and #3560 (@NORMAL-EX)
--help now correctly honors --pager=builtin. See #3516 (@keith-hall)
--help now correctly honors custom themes. See #3524 (@keith-hall)
Fixed test compatibility with future Cargo build directory changes, see #3550 (@nmacl)
Fixed bug caused by using --plain and --terminal-width=N flags simultaneously, see #3529 (@H4k1l)
Fix zsh tab completion word-splitting language names containing spaces (e.g. HTML (Jinja2), Apache Conf), see #3693 (@YoshKoz)
Fix zsh tab completion offering invalid -l arguments (file globs, paths, hidden filenames) sourced from the second column of --list-languages. Closes #3735, see #3737 (@truffle-dev)
Fix usize underflow in --list-languages when --terminal-width is smaller than the longest language name, see #3812 (@greymoth-jp)
--sanitize=always now also sanitizes piped output. --sanitize=auto now sanitizes every file type, but only when the output is a terminal, see #4141 (@curious-rabbit)
Show changes in --diff mode and the change-marker column in Git repositories that use the SHA-256 object format (git init --object-format=sha256), see #4143 (@BlueX888)
Skip untracked files and files outside a Git repository in --diff mode instead of printing an empty frame, see #4148 (@thejesh23)
Recognize the end of an OSC 8 hyperlink in ANSI input, so later text is no longer wrapped in redundant hyperlink-close sequences, see #4136 (@divya0795)