Skip to content

Bat tries to read .zip files as text #3663

@kmafeni04

Description

@kmafeni04

What steps will reproduce the bug?

  1. run bat test.zip

What happens?

Bat shows garbage text

Image

What did you expect to happen instead?

to show <binary>

How did you install bat?

yay -S bat


bat version and environment

Software version

bat 0.26.1 (v0.25.0-402-g979ba226)

Operating system

  • OS: Linux (Arch Linux)
  • Kernel: 6.19.10-arch1-1

Command-line

bat test.zip --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=<not set>
LESS=<not set>
MANPAGER=<not set>
NO_COLOR=<not set>
PAGER=<not set>
SHELL=/usr/bin/bash
TERM=xterm-256color
XDG_CACHE_HOME=/home/kome/.cache
XDG_CONFIG_HOME=/home/kome/.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 '/home/kome/.config/bat/config': No such file or directory (os error 2).

Custom assets metadata

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

Custom assets

'/home/kome/.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 692 (PCRE2 regular expressions)
Copyright (C) 1984-2026  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