Skip to content

Allow bat to render some binary content #2709

@fnune

Description

@fnune
$ bat /proc/3151/cmdline
───────┬─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ File: /proc/3151/cmdline   <BINARY>
───────┴─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
$ /bin/cat /proc/3151/cmdline;
sleep100%

I was trying to read /proc/[pid]/cmdline using bat and expected it to behave like cat, but it doesn't.

Should any exceptions be made for the /proc filesystem?

See man 5 proc:

PROC(5)                                                   Linux Programmer's Manual                                                   PROC(5)

NAME
       proc - process information pseudo-filesystem

DESCRIPTION
       The  proc  filesystem  is a pseudo-filesystem which provides an interface to kernel data structures.  It is commonly mounted at /proc.
       Typically, it is mounted automatically by the system, but it can also be mounted manually using a command such as:

           mount -t proc proc /proc

       Most of the files in the proc filesystem are read-only, but some files are writable, allowing kernel variables to be changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions