Skip to content

Man page highlighting causes text artifacts in front of left parens #3549

@BlueElectivire

Description

@BlueElectivire

What steps will reproduce the bug?

  1. Set bat as manpager using the method in the docs (export MANPAGER="bat -plman")
  2. Open a manpage which contains a left paren character (which is virtually all of them)

What happens?
Left parens get highlighted, but in front of them appear the characters "22m" in a different color.

Screenshot:
Image

This also happens if there isn't a space before the parens, where it is more evident the "22m" doesn't belong:
Image

Notice that this doesn't appear on every single open parens, only on the ones highlighted.

What did you expect to happen instead?
The relevant characters should be highlighted without adding the artifacts.

How did you install bat?
pacman


bat version and environment

Software version

bat 0.26.1 (v0.25.0-402-g979ba226)

Operating system

  • OS: Linux (Arch Linux rolling)
  • Kernel: 6.18.3-arch1-1

Command-line

bat -plman --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_IL
LC_ALL=<not set>
LESS=<not set>
MANPAGER='bat -plman'
NO_COLOR=<not set>
PAGER=<not set>
SHELL=/usr/bin/zsh
TERM=xterm-ghostty
XDG_CACHE_HOME=/home/blue/.cache
XDG_CONFIG_HOME=/home/blue/.config

System Config file

Could not read contents of '/etc/bat/config': No such file or directory (os error 2).

Config file

--theme=ansi

Custom assets metadata

Could not read contents of '/home/blue/.cache/bat/metadata.yaml': No such file or directory (os error 2).

Custom assets

'/home/blue/.cache/bat' not found

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 685 (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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions