Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
385 changes: 385 additions & 0 deletions Cargo.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ clap = { version = "4", features = ["derive"] }
crossterm = { version = "0.28", features = ["event-stream", "libc", "use-dev-tty"] }
dirs = "6"
ratatui = "0.29"
ratatui-image = { version = "=8.0.1", default-features = false }
image = { version = "0.25", default-features = false, features = ["png", "jpeg", "gif", "webp", "bmp", "ico", "tiff"] }
serde = { version = "1", features = ["derive"] }
serde_yaml = "0.9"
serde_json = "1"
Expand Down
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ lazygitrs upgrade 0.0.32 # specific version
- [x] 🎨 Themes + Theme-Picker!
- [x] **Grep diff contents** — `Ctrl-F` in Files / Commit Files / Compare searches hunk lines in-context, `Enter` jumps to the file in the current list.

### Image diffs

Selecting a PNG, JPEG, GIF (first frame), WebP, BMP, ICO, or TIFF file shows
**Before / After** previews in Kitty and Ghostty. Added/deleted files show the
available image full-width, labeled **Added** or **Deleted**. Staged previews use the index;
commit-file and ref comparisons use the corresponding Git blobs.

Other binaries, unsupported/corrupt images, files over 20 MiB, and unsupported
terminal environments keep the striped binary placeholder. Images are decoded
with memory/dimension limits and resized in the background. SVG and video
previews are not included yet.

Folder previews in the file tree mix text diffs with inline image sections.
Each image section is capped at 12 rows; visible sections load in the background
(two at a time) and offscreen pixels are released. This works in split/unified
and wrapped views, including commit/stash folders and ref-comparison folders.
Whole-commit overview buffers still retain binary placeholders. Inline images
require Kitty/Ghostty placeholder graphics; other terminals keep stripes.

Set `LAZYGITRS_IMAGE_PREVIEW=off` to disable image previews. tmux, screen, and
Zellij currently fall back to stripes. iTerm2/WezTerm and Sixel are experimental
(`LAZYGITRS_IMAGE_PREVIEW=experimental`); their overlay cleanup is not yet fully
verified. Nested editor launches avoid terminal capability queries.

### Configuration

Config goes in `~/.config/lazygitrs/config.yml` or `~/.config/lazygit/config.yml` — both work, using either only won't break anything so you can reference the [original lazygit config guide](https://github.com/jesseduffield/lazygit/blob/master/docs/Config.md).
Expand Down
2 changes: 1 addition & 1 deletion src/git/diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -510,7 +510,7 @@ impl GitCommands {
}
}

fn diff_paths_for_label(path: &str) -> Vec<&str> {
pub(crate) fn diff_paths_for_label(path: &str) -> Vec<&str> {
match path.split_once(" -> ") {
Some((old, new)) => vec![old, new],
None => vec![path],
Expand Down
Loading
Loading