lazyjj icon indicating copy to clipboard operation
lazyjj copied to clipboard

Reporting width of windows to diff tool

Open zDonik1 opened this issue 3 months ago • 3 comments

I use delta as the diffing tool and when the side-by-side option is set, the width of the window seems to be not reported back to delta, so it defaults to a set size.

Image

The correct behaviour is for delta to take up the entire width of the window. In this case I am running it in a zellij window:

Image

zDonik1 avatar Oct 11 '25 09:10 zDonik1

Can you provide the relevant lines of your jj config file?

I'm not familiar with the delta diff tool. Can you provide an url to source code? Maybe you can test if it is possible to set the width via the COLUMNS environment variable.

peso avatar Oct 16 '25 06:10 peso

jj ~/.config/jj/config.toml:

[lazyjj]
diff-tool = "delta"

delta in ~/.config/git/config:

[core]
	pager = "delta"

[delta]
	side-by-side = true

I tried using COLUMNS env var, but that didn't affect anything.

zDonik1 avatar Oct 21 '25 13:10 zDonik1

I assume the delta you are using is the one found at https://github.com/dandavison/delta

This tool seems to not respect COLUMNS, but it does have a --width command line argument. Since jj as of version 0.34.0 can forward COLUMNS to a diff tool, you could change your jj configuration to use that. At the end of this discussion on jj you can find an example.

The only missing part is that lazyjj should set COLUMNS to the width of the details panel on the right, before running jj show.

peso avatar Oct 30 '25 04:10 peso