Skip to content

Piping to bat using the builtin pager outputs nothing #3450

@lespea

Description

@lespea

What steps will reproduce the bug?

  1. cat a file into bat using --pager=builtin
  2. notice no output
  3. also fails when the file is stdin bat --pager=builtin < README.md
  4. notice if you remove --pager=builtin both examples work
  5. notice it works if you use bat on the file directly bat --pager=builtin README.md

What happens?

Nothing is output. The exit code is 0 and there are no errors. Tried with a large file and one with just a few lines.

What did you expect to happen instead?

The file is displayed

How did you install bat?

cargo install bat


bat version and environment

Software version

bat 0.26.0

Operating system

  • OS: macOS 15.6.1 Sequoia
  • Kernel: 24.6.0

Command-line

bat --pager=builtin --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_US.UTF-8
LC_ALL=en_US.UTF-8
LESS=<not set>
MANPAGER='sh -c '\''col -bx | bat -l man -p'\'''
NO_COLOR=<not set>
PAGER=<not set>
SHELL=/bin/zsh
TERM=xterm-256color
XDG_CACHE_HOME=/Users/Z001J31/.cache
XDG_CONFIG_HOME=/Users/Z001J31/.config

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 '/Users/Z001J31/.config/bat/config': No such file or directory (os error 2).

Custom assets metadata

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

Custom assets

'/Users/Z001J31/.cache/bat' not found

Compile time information

  • Profile: release
  • Target triple: aarch64-apple-darwin
  • Family: unix
  • OS: macos
  • Architecture: aarch64
  • Pointer width: 64
  • Endian: little
  • CPU features: aes,bf16,bti,crc,dit,dotprod,dpb,dpb2,fcma,fhm,flagm,fp16,frintts,i8mm,jsconv,lor,lse,neon,paca,p
    acg,pan,pmuv3,ras,rcpc,rcpc2,rdm,sb,sha2,sha3,ssbs,vh
  • Host: aarch64-apple-darwin

Less version

Could not run command 'builtin': No such file or directory (os error 2)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions