-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Incorrect syntax highlighting of Bash here-strings #3648
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingsyntect-features-requiredBlocked by lack of support in syntectBlocked by lack of support in syntectupstream-errorA bug in an upstream componentA bug in an upstream component
Description
What steps will reproduce the bug?
The following Bash program:
cat <<A; cat <<B; cat <<C
String A
A
String B
B
String C
CWhat happens?
is incorrectly highlighted as
What did you expect to happen instead?
because Bat thinks the here-strings are ordered C, B, A, but they are in fact ordered A, B, C
How did you install bat?
nixpkgs cda48547b432e8d3b18b4180ba07473762ec8558
bat version and environment
Software version
bat 0.26.1
Operating system
- OS: Linux (NixOS 26.05)
- Kernel: 6.19.8
Command-line
/home/anselmschueler/.nix-profile/bin/bat --language bash --diagnostic Environment variables
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
COLORTERM=truecolor
LANG=en_GB.UTF-8
LC_ALL=<not set>
LESS=<not set>
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=less
SHELL=/run/current-system/sw/bin/fish
TERM=xterm-256color
XDG_CACHE_HOME=<not set>
XDG_CONFIG_HOME=<not set>System Config file
Could not read contents of '/etc/bat/config': No such file or directory (os error 2).
Config file
--style=numbers,changes,rule,snip
Custom assets metadata
bat_version: 0.26.1
creation_time:
secs_since_epoch: 1774054094
nanos_since_epoch: 983655630
Custom assets
- metadata.yaml, 97 bytes
- syntaxes.bin, 1012454 bytes
- themes.bin, 58318 bytes
Compile time information
- Profile: release
- Target triple: x86_64-unknown-linux-gnu
- Family: unix
- OS: linux
- Architecture: x86_64
- Pointer width: 64
- Endian: little
- CPU features: fxsr,sse,sse2
- Host: x86_64-unknown-linux-gnu
Less version
> less --version
less 691 (PCRE2 regular expressions)
Copyright (C) 1984-2025 Mark Nudelman
less comes with NO WARRANTY, to the extent permitted by law.
For information about the terms of redistribution,
see the file named README in the less distribution.
Home page: https://greenwoodsoftware.com/less
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingsyntect-features-requiredBlocked by lack of support in syntectBlocked by lack of support in syntectupstream-errorA bug in an upstream componentA bug in an upstream component