gunk-dev/the-valley
the-valley:bd-022ef75bugopen

review: a diff the configured pager crashes on is not shown

State
free to start
Created
2026-11-14 by contributor

Body

`valley review <change>` on a change whose diff holds files that are not text (encrypted secrets: one binary, one armored) ran the configured diff pager as its renderer (`status/reviewpage.go`, `page`), and the renderer, delta, panicked:

    thread 'main' panicked at src/ansi/mod.rs:255:35:
    end byte index 465 is not a char boundary; it is inside '�' (bytes 464..467 of string)

The prompt line (`[a]pprove [v]iew diff [r]eject [s]kip`) still appeared, so the operator can approve, but the page was not shown.

Two things to settle:
- What in the raw page was not valid UTF-8 or was cut inside a character. The page should be valid UTF-8 whatever the diff holds; a binary file should appear as git's one-line "Binary files differ".
- When the renderer exits non-zero or writes nothing, review should show the raw page through less and say the renderer failed, so a crash in someone's pager never hides the diff being approved.

Seen with a client build older than main; reproduce on main first.

Comments

No comments.