Skip to content

Crash for (really) small terminal sizes #117

@sharkdp

Description

@sharkdp

If the terminal width is smaller than the size of the side-panel, bat crashes with

fatal runtime error: allocator memory exhausted
[1]    14199 illegal hardware instruction (core dumped)  bat README.md

Running in debug mode reveals the problematic code line:

thread 'main' panicked at 'attempt to subtract with overflow', src/printer.rs:153:32

let hline = "─".repeat(self.config.term_width - (PANEL_WIDTH + 1));

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions