- Correctly render tab stops in --show-all, see #2038 (@Synthetica9)
- Make the default macOS theme depend on Dark Mode. See #2197, #1746 (@Enselic)
## Bugfixes
- Prevent fork nightmare with `PAGER=batcat`. See #2235 (@johnmatthiggins)
- Make `--no-paging`/`-P` override `--paging=...` if passed as a later arg, see #2201 (@themkat)
- `--map-syntax` and `--ignored-suffix` now works together, see #2093 (@czzrr)
## Other
- Include contents of custom assets `metadata.yaml` in `--diagnostics`. See #2107 (@Enselic)
- Relaxed glibc requirements on amd64, see #2106 and #2194 (@sharkdp)
- Improved fish completions. See #2275 (@zgracem)
- Stop pre-processing ANSI escape characters. Syntax highlighting on ANSI escaped input is not supported. See #2185 and #2189 (@Enselic)
## Syntaxes
- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
- NSE (Nmap Scripting Engine) is mapped to Lua, see #2151 (@Cre3per)
- Correctly color `fstab` dump and pass fields, see #2246 (@yuvalmo)
- Update `Command Help` syntax, see #2255
- `Julia`: Fix syntax highlighting for function name starting with `struct`, see #2230
- Minor update to `LiveScript`, see #2291
## Themes
## `bat` as a library
- Make `bat::PrettyPrinter::syntaxes()` iterate over new `bat::Syntax` struct instead of `&syntect::parsing::SyntaxReference`. See #2222 (@Enselic)
# v0.21.0
## Features
- Correctly render tab stops in `--show-all`, see #2038 (@Synthetica9)
- Add a `--style=default` option and make it the default. It is less verbose than `full`, see #2061 (@IsaacHorvath)
- Enable BusyBox `less` as pager, see #2162 (@nfisher1226)
- File extensions are now matched case-insensitively. See #1854, #2181 (@Enselic)
## Bugfixes
- Bump `regex` dependency from 1.5.4 to 1.5.5 to fix [CVE-2022-24713](https://blog.rust-lang.org/2022/03/08/cve-2022-24713.html), see #2145, #2139 (@Enselic)
- `bat` no longer crashes when encountering files that references missing syntaxes. See #915, #2181 (@Enselic)
## Performance
- Skip syntax highlighting on long lines (> 16384 chars) to help improve performance. See #2165 (@keith-hall)
- Vastly improve startup time by lazy-loading syntaxes via syntect 5.0.0. This makes bat display small files ~75% faster than before. See #951, #2181 (@Enselic)
## Other
- Include info about custom assets in `--diagnostics` if used. See #2107, #2144 (@Enselic)
## Syntaxes
- Mapped clang-format config file (.clang-format) to YAML syntax (@TruncatedDinosour)
- log syntax: improved handling of escape characters in double quoted strings. See #2123 (@keith-hall)
- Associate `/var/spool/mail/*` and `/var/mail/*` with the `Email` syntax. See #2156 (@cyqsimon)
- Added cmd-help syntax to scope --help messages. See #2148 (@victor-gp)
- Slightly adjust Zig syntax. See #2136 (@Enselic)
- Associate `.inf` files with the `INI` syntax. See #2190 (@Enselic)
## `bat` as a library
- Allow configuration of `show_nonprintable` with `PrettyPrinter`, see #2142
- The binary format of syntaxes.bin has been changed due to syntaxes now being lazy-loaded via syntect 5.0.0. See #2181 (@Enselic)
- Mark `bat::error::Error` enum as `#[non_exhaustive]` to allow adding new variants without future semver breakage. See #2181 (@Enselic)
- Change `Error::SyntectError(syntect::LoadingError)` to `Error::SyntectError(syntect::Error)`. See #2181 (@Enselic)
- Add `Error::SyntectLoadingError(syntect::LoadingError)` enum variant. See #2181 (@Enselic)
[CompletionResult]::new('-m','m',[CompletionResultType]::ParameterName,'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
[CompletionResult]::new('--map-syntax','map-syntax',[CompletionResultType]::ParameterName,'Use the specified syntax for files matching the glob pattern (''*.cpp:C++'').')
[CompletionResult]::new('--theme','theme',[CompletionResultType]::ParameterName,'Set the color theme for syntax highlighting.')
[CompletionResult]::new('--style','style',[CompletionResultType]::ParameterName,'Comma-separated list of style elements to display (*auto*, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
[CompletionResult]::new('--style','style',[CompletionResultType]::ParameterName,'Comma-separated list of style elements to display (*default*, auto, full, plain, changes, header, header-filename, header-filesize, grid, rule, numbers, snip).')
[CompletionResult]::new('-r','r',[CompletionResultType]::ParameterName,'Only print the lines from N to M.')
[CompletionResult]::new('--line-range','line-range',[CompletionResultType]::ParameterName,'Only print the lines from N to M.')
# Use option argument descriptions to indicate which is the default, saving
# horizontal space and making sure the option description isn't truncated.
set-lcolor_opts '
auto\tdefault
never\t
always\t
'
set-ldecorations_opts$color_opts
set-lpaging_opts$color_opts
# Include some examples so we can indicate the default.
set-lpager_opts '
less\tdefault
less\ -FR\t
more\t
vimpager\t
'
set-litalic_text_opts '
always\t
never\tdefault
'
set-lwrap_opts '
auto\tdefault
never\t
character\t
'
# While --tabs theoretically takes any number, most people should be OK with these.
# Specifying a list lets us explain what 0 does.
set-ltabs_opts '
0\tpass\ tabs\ through\ directly
1\t
2\t
4\t
8\t
'
# Completions:
complete-c{{PROJECT_EXECUTABLE}}-l color -xka"auto never always"-d"Specify when to use colored output (default: auto)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-l color -x-a"$color_opts"-d"When to use colored output"-n __bat_no_excl_args
complete-c$bat-l config-dir -f-d"Display location of configuration directory"-n __fish_is_first_arg
complete-c$bat-l config-file -f-d"Display location of configuration file"-n __fish_is_first_arg
complete-c$bat-l decorations -x-a"$decorations_opts"-d"When to use --style decorations"-n __bat_no_excl_args
complete-c$bat-l diagnostic -d"Print diagnostic info for bug reports"-n __fish_is_first_arg
complete-c$bat-s d -l diff -d"Only show lines with Git changes"-n __bat_no_excl_args
complete-c$bat-l diff-context -x-d"Show N context lines around Git changes"-n"__fish_seen_argument -s d -l diff"
complete-c{{PROJECT_EXECUTABLE}}-l config-dir -d"Display location of '{{PROJECT_EXECUTABLE}}' configuration directory"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-l file-name -x-d"Specify the display name"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l config-file -d"Display location of '{{PROJECT_EXECUTABLE}}' configuration file"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s f -l force-colorization -d"Force color and decorations"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l decorations -xka"auto never always"-d"Specify when to use the decorations specified with '--style' (default: auto)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s h -d"Print a concise overview"-n __fish_is_first_arg
complete-c{{PROJECT_EXECUTABLE}}-s h -lhelp-d"Print help message"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-lhelp-f-d"Print all help information"-n __fish_is_first_arg
complete-c{{PROJECT_EXECUTABLE}}-s H -l highlight-line -x-d"<N> Highlight the N-th line with a different background color"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s H -l highlight-line -x-d"Highlight line(s) N[:M]"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l italic-text -xka"always never"-d"Specify when to use ANSI sequences for italic text (default: never)"-n"not __fish_seen_subcommand_from cache"
complete-c{{PROJECT_EXECUTABLE}}-s l -l language -d"Set the language for syntax highlighting"-n"not __fish_seen_subcommand_from cache"-xa"(__{{PROJECT_EXECUTABLE}}_autocomplete_languages)"
complete-c$bat-l italic-text -x-a"$italic_text_opts"-d"When to use italic text in the output"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-s r -l line-range -x-d"<N:M> Only print the specified range of lines for each file"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s l -l language -x-k-a"(__bat_complete_list_languages)"-d"Set the syntax highlighting language"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l list-languages -d"Display list of supported languages for syntax highlighting"-n"not __fish_seen_subcommand_from cache"
complete-c{{PROJECT_EXECUTABLE}}-s m -l map-syntax -x-d"<from:to> Map a file extension or file name to an existing syntax"-n"not __fish_seen_subcommand_from cache"
complete-c{{PROJECT_EXECUTABLE}}-s n -l number -d"Only show line numbers, no other decorations. Alias for '--style=numbers'"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s m -l map-syntax -x-a"(__bat_complete_map_syntax)"-d"Map <glob pattern>:<language syntax>"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l pager -x-d"<command> Specify which pager program to use (default: less)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s n -l number -d"Only show line numbers, no other decorations"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l paging -xka"auto never always"-d"Specify when to use the pager (default: auto)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-l pager -x-a"$pager_opts"-d"Which pager to use"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-s p -l plain -d"Only show plain style, no decorations. Alias for '--style=plain'"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-l paging -x-a"$paging_opts"-d"When to use the pager"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-s P -d"Disable paging. Alias for '--paging=never'"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s p -l plain -d"Disable decorations"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-s A -l show-all -d"Show non-printable characters like space/tab/newline"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-o pp -d"Disable decorations and paging"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l style -xka"auto full plain changes header header-filename header-filesize grid rule numbers snip"-d"Comma-separated list of style elements or presets to display with file contents"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s P -d"Disable paging"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l tabs -x-d"<T> Set the tab width to T spaces (width of 0 passes tabs through directly)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-s A -l show-all -d"Show non-printable characters"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l terminal-width -x-d"<width> Explicitly set terminal width; Prefix with '+' or '-' to offset (default width is auto determined)"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-l style -x-k-a"(__fish_complete_list , __bat_style_opts)"-d"Specify which non-content elements to display"-n __bat_no_excl_args
complete-c{{PROJECT_EXECUTABLE}}-l theme -xka"({{PROJECT_EXECUTABLE}} --list-themes | cat)"-d"Set the theme for syntax highlighting"-n"not __fish_seen_subcommand_from cache"
complete-c{{PROJECT_EXECUTABLE}}-a"cache"-d"Modify the syntax/language definition cache"-n"not __fish_seen_subcommand_from cache"
complete-c$bat-a cache -d"Modify the syntax/language definition cache"-n __fish_use_subcommand
complete-c$bat-l build -f-d"Parse new definitions into cache"-n __bat_cache_no_excl
complete-c$bat-l clear -f-d"Reset definitions to defaults"-n __bat_cache_no_excl
complete-c$bat-l blank -f-d"Create new data instead of appending"-n"__bat_cache_subcommand; and not __fish_seen_argument -l clear"
complete-c$bat-lsource-x-a"(__fish_complete_directories)"-d"Load syntaxes and themes from DIR"-n"__bat_cache_subcommand; and not __fish_seen_argument -l clear"
complete-c$bat-l target -x-a"(__fish_complete_directories)"-d"Store cache in DIR"-n __bat_cache_subcommand
[38;2;190;132;255m2022-03-16[0m[38;2;249;38;114mT[0m[38;2;190;132;255m17:41:02[0m[38;2;190;132;255m.[0m[38;2;190;132;255m519[0m[38;2;248;248;242m helix_term::application [[0m[38;2;248;248;240mWARN[0m[38;2;248;248;242m] unhandled window/showMessage: ShowMessageParams { typ: [0m[38;2;248;248;240mError[0m[38;2;248;248;242m, message: [0m[38;2;230;219;116m"rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `[0m[38;2;190;132;255m\"[0m[38;2;230;219;116mcargo[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116mmetadata[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--format-version[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m1[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--manifest-path[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m/home/zeta/dev/raytracer/Cargo.toml[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116m--filter-platform[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m [0m[38;2;190;132;255m\"[0m[38;2;230;219;116mwasm32-unknown-unknown[0m[38;2;190;132;255m\"[0m[38;2;230;219;116m`: `cargo metadata` exited with an error: Updating crates.io index[0m[38;2;190;132;255m\n[0m[38;2;230;219;116merror: failed to select a version for `parking_lot`.[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mversions that meet the requirements `^0.12.0` are: 0.12.0[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;190;132;255m\n[0m[38;2;230;219;116mfailed to select a version for `parking_lot` which could resolve this conflict[0m[38;2;190;132;255m\n[0m[38;2;230;219;116m"[0m[38;2;248;248;242m }[0m
[38;2;248;248;242m [0m[38;2;117;113;94m/*[0m[38;2;117;113;94m This block is a regression test for a bat panic when a PostCSS syntax definition is missing [0m[38;2;117;113;94m*/[0m
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:00:01[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mcolord[0m[38;2;248;248;242m[[0m[38;2;190;132;255m920[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;248;248;240mfailed[0m[38;2;248;248;242m to get session [pid [0m[38;2;190;132;255m137485[0m[38;2;248;248;242m]: No data available[0m
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:01:38[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239msystemd-resolved[0m[38;2;248;248;242m[[0m[38;2;190;132;255m721[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m Server returned [0m[38;2;248;248;240merror[0m[38;2;248;248;242m NXDOMAIN, mitigating potential DNS violation DVE-[0m[38;2;190;132;255m2018[0m[38;2;248;248;242m-[0m[38;2;190;132;255m0001[0m[38;2;248;248;242m, retrying transaction with reduced feature level UDP.[0m
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m00:04:46[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mntpd[0m[38;2;248;248;242m[[0m[38;2;190;132;255m952[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m Soliciting pool server [0m[38;2;190;132;255m255[0m[38;2;248;248;242m.[0m[38;2;190;132;255m76[0m[38;2;248;248;242m.[0m[38;2;190;132;255m59[0m[38;2;248;248;242m.[0m[38;2;190;132;255m37[0m
[38;2;190;132;255mApr 4[0m[38;2;190;132;255m [0m[38;2;190;132;255m16:32:07[0m[38;2;248;248;242m [0m[38;2;166;226;46mhostname-here[0m[38;2;248;248;242m [0m[38;2;102;217;239mNetworkManager[0m[38;2;248;248;242m[[0m[38;2;190;132;255m740[0m[38;2;248;248;242m][0m[38;2;248;248;242m:[0m[38;2;248;248;242m [0m[38;2;190;132;255m<info>[0m[38;2;248;248;242m [[0m[38;2;190;132;255m1617629527[0m[38;2;190;132;255m.[0m[38;2;190;132;255m1101[0m[38;2;248;248;242m] manager: NetworkManager state is now CONNECTED_GLOBAL[0m
[38;2;248;248;242m Show non-printable characters (space, tab, newline, ..).[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-p[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--plain[0m[38;2;248;248;242m Show plain style (alias for '--style=plain').[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-l[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--language[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<language>[0m[38;2;248;248;242m Set the language for syntax highlighting.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-H[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--highlight-line[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<N:M>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Highlight lines N through M.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m--file-name[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<name>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Specify the name to display for a file.[0m
[38;2;248;248;242m Show line numbers (alias for '--style=numbers').[0m
[38;2;248;248;242m [0m[38;2;166;226;46m--color[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m[38;2;248;248;242m When to use colors (*auto*, never, always).[0m
[38;2;248;248;242m [0m[38;2;166;226;46m--italic-text[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<when>[0m[38;2;248;248;242m Use italics in output (always, *never*)[0m
[38;2;248;248;242m Use the specified syntax for files matching the glob pattern[0m
[38;2;248;248;242m ('*.cpp:C++').[0m
[38;2;248;248;242m [0m[38;2;166;226;46m--theme[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<theme>[0m[38;2;248;248;242m Set the color theme for syntax highlighting.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m--list-themes[0m[38;2;248;248;242m Display all supported highlighting themes.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-r[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--line-range[0m[38;2;248;248;242m [0m[3;38;2;253;151;31m<N:M>[0m[3;38;2;253;151;31m...[0m[38;2;248;248;242m Only print the lines from N to M.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-L[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--list-languages[0m[38;2;248;248;242m Display all supported languages.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-h[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--help[0m[38;2;248;248;242m Print this help message.[0m
[38;2;248;248;242m [0m[38;2;166;226;46m-V[0m[38;2;248;248;242m, [0m[38;2;166;226;46m--version[0m[38;2;248;248;242m Show version information.[0m
[38;2;253;151;31mARGS:[0m
[38;2;248;248;242m [0m[3;38;2;253;151;31m<FILE>...[0m[38;2;248;248;242m File(s) to print / concatenate. Use '-' for standard input.[0m
[38;2;253;151;31mSUBCOMMANDS:[0m
[38;2;248;248;242m [0m[38;2;249;38;114mcache[0m[38;2;248;248;242m Modify the syntax-definition and theme cache[0m
[38;2;248;248;242mNote: `bat -h` prints a short and concise overview while `bat --help` gives all[0m
2022-03-16T17:41:02.519 helix_term::application [WARN] unhandled window/showMessage: ShowMessageParams { typ: Error, message: "rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /home/zeta/dev/raytracer/Cargo.toml, cargo 1.61.0-nightly (65c8266 2022-03-09): Failed to run `\"cargo\" \"metadata\" \"--format-version\" \"1\" \"--manifest-path\" \"/home/zeta/dev/raytracer/Cargo.toml\" \"--filter-platform\" \"wasm32-unknown-unknown\"`: `cargo metadata` exited with an error: Updating crates.io index\nerror: failed to select a version for `parking_lot`.\n ... required by package `raytracer v0.1.0 (/home/zeta/dev/raytracer)`\nversions that meet the requirements `^0.12.0` are: 0.12.0\n\nthe package `raytracer` depends on `parking_lot`, with features: `wasm-bindgen` but `parking_lot` does not have these features.\n\n\nfailed to select a version for `parking_lot` which could resolve this conflict\n" }