less icon indicating copy to clipboard operation
less copied to clipboard

less sometimes runs commands only after pressing Enter

Open injust opened this issue 1 year ago • 0 comments

I came across a really strange bug today. I reproduced it in a new Git repo with a minimal config, but it still seems very specific to my environment.

I am running git diff on a Bun lockfile, with git's pager set to delta. delta pipes its output to less. I followed the instructions at https://bun.sh/guides/install/git-diff-bun-lockfile to configure Git to work with Bun lockfiles.

This asciinema recording can best explain what is happening: https://asciinema.org/a/Iy7ds9zCaqPTn5YAAabYe3F4b or asciicast.txt

Usually I press f and b to navigate, and q to quit. However, ~1/3 of the time, less doesn't seem to do anything until Enter is pressed. When this issue occurs, it persists until less exits.

The issue doesn't seem to occur if I unset core.fsmonitor or remove LESS= from core.pager.


Git: 2.47.0 delta: 0.18.2 less: 661 macOS: Sequoia 15.1 Terminals: Ghostty and Terminal.app


.gitattributes:

*.lockb binary diff=lockb

.gitconfig:

[core]
	fsmonitor = true
	pager = LESS= delta

[diff "lockb"]
	binary = true
	textconv = bun

bun.lockb files:

old.bun.lockb.zip

new.bun.lockb.zip

injust avatar Oct 17 '24 04:10 injust