Skip to content

πŸ› setting a bgcolor for zero style causes crashesΒ #2022

@unphased

Description

@unphased
  • Please include the raw text output from git, so that we can reproduce the problem.
    (You can use git --no-pager to produce the raw text output.)
❯ git --no-pager log -p | delta  141 ↲  master[✦]a3e50656[β†‘βœŽβœ­]6h13m

thread 'main' panicked at /Users/slu/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/slice.rs:523:23:
capacity overflow
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
commit a3e5065692f778e03a36eeabea81ac3acae85e51
Author: Steven Lu (MBP M1 Max) <[email protected]>
Date:   Fri Jul 25 10:05:15 2025 -0400

    fix: Allow color-pane.sh output to be visible

    Co-authored-by: aider (vertex_ai/gemini-2.5-pro) <[email protected]>


zshrc
────────────────────────────────────────────────────────────────────

─────────────────────────┐
312: color_tmux_pane() { β”‚
β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
312Β¦312β”‚

I figured out after much testing that the WIDTH OF THE TMUX PANE is what controls whether it crashes out or not. Due to this insight I was able to obtain

thread 'main' panicked at /Users/slu/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/slice.rs:523:23:
capacity overflow
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: alloc::raw_vec::capacity_overflow
   3: alloc::raw_vec::handle_error
   4: alloc::slice::<impl [T]>::repeat
   5: delta::paint::Painter::paint_lines
   6: delta::paint::Painter::paint_zero_line
   7: delta::handlers::hunk::<impl delta::delta::StateMachine>::handle_hunk_line
   8: delta::delta::delta
   9: delta::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.

and with full:

thread 'main' panicked at /Users/slu/.rustup/toolchains/stable-aarch64-apple-darwin/lib/rustlib/src/rust/library/alloc/src/slice.rs:523:23:
capacity overflow
stack backtrace:
   0:        0x10468ed68 - <std::sys::backtrace::BacktraceLock::print::DisplayBacktrace as core::fmt::Display>::fmt::h92dda645f072dcaf
   1:        0x1046ac05c - core::fmt::write::hbc92919d8e8f9a96
   2:        0x10468bf50 - std::io::Write::write_fmt::hcee3b5dc9ab531be
   3:        0x10468ec1c - std::sys::backtrace::BacktraceLock::print::h0f497abce563e5d2
   4:        0x10468fc64 - std::panicking::default_hook::{{closure}}::h62595143a6c21f05
   5:        0x10468fab4 - std::panicking::default_hook::hd800536ed1df5085
   6:        0x104690744 - std::panicking::rust_panic_with_hook::h1882a30575fbb763
   7:        0x104690348 - std::panicking::begin_panic_handler::{{closure}}::h39275ef3005e6337
   8:        0x10468f218 - std::sys::backtrace::__rust_end_short_backtrace::h6ede323c05a76849
   9:        0x104690018 - __rustc[95feac21a9532783]::rust_begin_unwind
  10:        0x1046c402c - core::panicking::panic_fmt::h529fda7ea817ba4f
  11:        0x1046c3cdc - alloc::raw_vec::capacity_overflow::h3941a18258a4ea7c
  12:        0x1046c3e28 - alloc::raw_vec::handle_error::h08b36af4b863e188
  13:        0x104456388 - alloc::slice::<impl [T]>::repeat::h84fabe12163dad36
  14:        0x104459418 - delta::paint::Painter::paint_lines::h92688d127d43de4a
  15:        0x104458dec - delta::paint::Painter::paint_zero_line::he12f3cfff347613b
  16:        0x10446a8fc - delta::handlers::hunk::<impl delta::delta::StateMachine>::handle_hunk_line::h04e30aad84e4243e
  17:        0x1044648e4 - delta::delta::delta::hd81c0d8ee124e809
  18:        0x104402004 - delta::main::hb69eb6562efe1f7c
  19:        0x10440c0cc - std::sys::backtrace::__rust_begin_short_backtrace::h0e45d3419885ad41
  20:        0x104495c88 - std::rt::lang_start::{{closure}}::hb314bdb3ed4071fb
  21:        0x104684d48 - std::rt::lang_start_internal::hdff9e551ec0db2ea
  22:        0x104402fa0 - _main

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions