feat: Add directory and file comparison (diff) command/functionality
ya env output
Yazi
Version: 26.9.1 (Arch Linux 2026-09-04)
Debug : false
Triple : x86_64-unknown-linux-gnu (linux-x86_64)
Rustc : 1.98.1 (48a229ce 2026-09-01)
Backtrace: None
Ya
Version: 26.9.1 (Arch Linux 2026-09-04)
Debug : false
Triple : x86_64-unknown-linux-gnu (linux-x86_64)
Rustc : 1.98.1 (48a229ce 2026-09-01)
Config
Init : /home/igor/.config/yazi/init.lua (No such file or directory (os error 2))
Yazi : /home/igor/.config/yazi/yazi.toml (770 chars)
Keymap : /home/igor/.config/yazi/keymap.toml (No such file or directory (os error 2))
Theme : /home/igor/.config/yazi/theme.toml (No such file or directory (os error 2))
VFS : /home/igor/.config/yazi/vfs.toml (No such file or directory (os error 2))
Package : /home/igor/.config/yazi/package.toml (123 chars)
Dark/light flavor: ArcSwapAny("") / ArcSwapAny("")
Emulator
TERM : Some("xterm-ghostty")
TERM_PROGRAM : Some("ghostty")
TERM_PROGRAM_VERSION: Some("1.3.1-arch2.2")
Brand.from_env : Some(Ghostty)
Emulator.probe : Emulator { brand: Ghostty, version: ArcSwapAny("ghostty 1.3.1-arch2.2"), csi_u: Some(0), kgp: true, kgp_shm: true, sixel: false, background: Some([10280, 11308, 13364]), color_scheme: Some(true), csi_16t: (10, 21), force_16t: false, osc_5522: false, cursor_blink: true, cursor_shape: Some(1), mux: None, probe: Probe { id: Id(0), completed: false }, started: false }
Adapter
Drivers.matches: Kgp
TERM.dimension : Dimension { cols: 188, rows: 48, width: 1884, height: 1010 }
Desktop
XDG_SESSION_TYPE : Some("wayland")
WAYLAND_DISPLAY : Some("wayland-1")
DISPLAY : Some(":0")
NIRI_SOCKET : Some("/run/user/1000/niri.wayland-1.1284.sock")
SWAYSOCK : None
HYPRLAND_INSTANCE_SIGNATURE: None
WAYFIRE_SOCKET : None
SSH
shared.in_ssh_connection: false
WSL
WSL: false
Variables
SHELL : Some("/bin/fish")
EDITOR : None
VISUAL : None
YAZI_FILE_ONE : None
YAZI_CONFIG_HOME : None
YAZI_ZOXIDE_OPTS : None
SSH_AUTH_SOCK : None
FZF_DEFAULT_OPTS : None
FZF_DEFAULT_COMMAND: None
Text Opener
default : Some(OpenerRuleArc(OpenerRule { id: Id(24), run: "micro %s1", block: true, orphan: false, desc: "", for: Unix, spread: false }))
block-create: Some(OpenerRuleArc(OpenerRule { id: Id(24), run: "micro %s1", block: true, orphan: false, desc: "", for: Unix, spread: false }))
block-rename: Some(OpenerRuleArc(OpenerRule { id: Id(24), run: "micro %s1", block: true, orphan: false, desc: "", for: Unix, spread: false }))
Multiplexers
tmux version : No such file or directory (os error 2)
tmux build flags : enable-sixel=Unknown
ZELLIJ_SESSION_NAME: None
Zellij version : No such file or directory (os error 2)
Dependencies
file : 5.48
ueberzugpp : No such file or directory (os error 2)
ffmpeg/ffprobe: 9.0.2 / 9.0.2
pdftoppm : 26.08.0
magick : 7.1.2-31
fzf : 0.74.4
fd/fdfind : 10.5.0 / No such file or directory (os error 2)
rg : 15.2.0
chafa : No such file or directory (os error 2)
zoxide : No such file or directory (os error 2)
7zz/7z : No such file or directory (os error 2) / 26.03
resvg : No such file or directory (os error 2)
jq : 1.8.2
Clipboard
wl-copy/paste: 2.3.0 / 2.3.0
xclip : No such file or directory (os error 2)
xsel : No such file or directory (os error 2)
Routine
`file -bL --mime-type`: text/plainPlease describe the problem you're trying to solve
Currently, Yazi lacks a built-in command or a native action to easily compare two selected files or directories (diff functionality). For developers and power users, comparing files or entire directory trees directly within the terminal file manager is a vital part of the workflow. Right now, there is no straightforward way to trigger a comparison view without manually opening a shell and typing external commands.
Would you be willing to contribute this feature?
- Yes, I'll give it a shot
Describe the solution you'd like
It would be amazing to have a native command or an internal action (e.g., compare or diff) that allows users to:Select two items (either files or directories) using visual selection or a toggle mechanism.Invoke a command that opens a comparison view. For files, this could seamlessly hand off the paths to an external diff tool (like vimdiff, delta, diff, or meld). For directories, it could highlight structure and content mismatches.Alternatively, if this is out of scope for Yazi's core binary, it would be highly appreciated to have dedicated internal APIs or event triggers that make implementing this via a custom Lua plugin more seamless and robust (e.g., improved handling for multi-selection across splits or tabs).
Additional context
File and directory comparison is a staple feature in classic file managers (like Ranger or Midnight Commander). Providing a standard way to call a diff action would make Yazi an even more powerful, complete, and seamless tool for daily CLI operations.
Checklist
- I have searched the existing issues/discussions
- The latest nightly build doesn't already have this feature
Source: sxyazi/yazi