Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git --help breaks with bat manpager #2753

Open
hamza1311 opened this issue Oct 30, 2023 · 5 comments
Open

git --help breaks with bat manpager #2753

hamza1311 opened this issue Oct 30, 2023 · 5 comments
Labels
bug Something isn't working

Comments

@hamza1311
Copy link

What steps will reproduce the bug?

  1. MANPAGER="sh -c 'col -bx | bat -l man -p'" git commit --help
  2. observe

What happens?

The bolded text is misformatted:
image

What did you expect to happen instead?

The text to appear fine

How did you install bat?

pacman


bat version and environment

Software version

bat 0.24.0 (fc95468)

Operating system

Linux 6.5.7-arch1-1

Command-line

bat --diagnostic 

Environment variables

SHELL=/usr/bin/fish
PAGER=<not set>
LESS=<not set>
LANG=en_US.UTF-8
LC_ALL=<not set>
BAT_PAGER=<not set>
BAT_PAGING=<not set>
BAT_CACHE_PATH=<not set>
BAT_CONFIG_PATH=<not set>
BAT_OPTS=<not set>
BAT_STYLE=<not set>
BAT_TABS=<not set>
BAT_THEME=<not set>
XDG_CONFIG_HOME=<not set>
XDG_CACHE_HOME=<not set>
COLORTERM=truecolor
NO_COLOR=<not set>
MANPAGER='sh -c '\''col -bx | bat -l man -p'\'''

System Config file

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

Config file

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

Custom assets metadata

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

Custom assets

'/home/user/.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 643 (PCRE2 regular expressions)
Copyright (C) 1984-2023  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
@hamza1311 hamza1311 added the bug Something isn't working label Oct 30, 2023
@keith-hall
Copy link
Collaborator

Interesting, that exact same invocation works fine for me with no spurious 4m etc stuff in the output. Just as a quick sanity check, does it make a difference with --pager=never in the mix? i.e. MANPAGER="sh -c 'col -bx | bat -l man -p --pager=never'" git commit --help

@hamza1311
Copy link
Author

I just tried it and no, it's the highlighting that's messing up, not the pager

@starfall-system
Copy link

starfall-system commented Nov 3, 2023

groff version? If 1.23.0, adding MANROFFOPT='-c' will probably fix the output.

cf. #2593 (comment)

@hamza1311
Copy link
Author

groff version? If 1.23.0, adding MANROFFOPT='-c' will probably fix the output.

cf. #2593 (comment)

Running MANPAGER="sh -c 'col -bx | bat -l man -p'" MANROFFOPT='-c' git commit --help fixes it, thanks for help. Perhaps this should be added in the README?

$ groff -v
GNU groff version 1.23.0
Copyright (C) 2022 Free Software Foundation, Inc.
GNU groff comes with ABSOLUTELY NO WARRANTY.
You may redistribute copies of groff and its subprograms
under the terms of the GNU General Public License.
For more information about these matters, see the file
named COPYING.

called subprograms:

GNU grops (groff) version 1.23.0
GNU troff (groff) version 1.23.0

@Diti
Copy link

Diti commented Nov 23, 2023

Running MANPAGER="sh -c 'col -bx | bat -l man -p'" MANROFFOPT='-c' git commit --help fixes it, thanks for help. Perhaps this should be added in the README?

It has already been added in README.md, about 4 years ago (#45f3c733)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants