How to compare two files in Dolphin's split view?

I have two directories open in a split view in Dolphin (one is a backup).

I want to compare (the contents of) a file from the left pane with the matching one in the right pane.

The “Compare” service menu only shows up, if I select two files in the same pane.

How can I compare the files across panes in split view?

This looks like a new feature request for Dolphin which can be entered at bugs.kde.org under the category “wish list” as Dolphin doesn’t have this feature like dual-panel file managers (e.g. Double Commander).

But you can use Compare Files context menu for this purpose by clicking “Save Item to Compare” on one file, and then “Compare with the Saved Item” on the other file.

Thanks for the quick reply. However I don’t have a “Save item to compare” entry in the context menu. Do I have to install something to get this?

Sorry, I’ve been using this context menu for such a long time that I forgot I might have customized it, perhaps adding these two menu items to a third-party Dolphin extension.
I could share it with you but perhaps it might be easier for you to download one that suits you via Settings > Configure Dolphin… > Context Menu > Download Services… You can search “compare” and choose one after looking at what they provided.
If I were I would start with “Compare using Meld” which seems to include exactly what you want in a dual-pane window.
My personal preference is Meld because I think it shows the differences between 2 text files better than others, but you can also see if a similar service is available also for Kompare, KDiff3 etc…

Check Dolphin settings (CtrlShift, in the Context Menu you can search ‘Compare Files’.

Now all you have to do is travel a few kilometers to fork off and find it :wink:

It would be nice to see that ‘KDiff3’ entry underlined somewhere to avoid having to mouse down there.

I guess this service becomes available if and when you install KDiff3.
I see that there’s nothing like the one in dual-pane file managers like Double Commander: the command Compare instantly compares the two files selected on both panes.
Dolphin service simply implement it in two steps:

  1. Copy the first filename and path (e.g. echo %U > "/tmp/compare_file.tmp")
  2. Compare the second file with the item just saved (e.g. meld "`cat /tmp/compare_file.tmp`" "%U"; rm "/tmp/compare_file.tmp"

Select the needed files then go to Tools > Compare Files

Thanks for this. Apparently, it is Kompare that makes this possible.

Yes. Also the option way greyed out so I had to install kompare package.

Thanks. It did not occur to me to look into the “Tools” menu :slight_smile: