I’m wondering how can I use meld for a file compare of two open document in Kate?
I’m running Kate v25.04.0 (flatpak) on Linux Mint v 21.3.
Meld is installed on the system but it’s not registered as tool in Kate.
When selecting (right-click) a ‘non-active’ tab in the editor it shows two entries a) compare with active document and b) compare with active document Using .
However, both options are greyed out (inactive).
How can I fix the problem?
Thanks for any suggestion.
Yes flatseal is granting Kate already access to the filesystem filesystem=host.
I think that can’t be teh reason.
Why are the actions greyed out (see my 1st post)?
And the version from the Mint repository is missing some (for me) important features and it’s therefore not an options.
I don’t know that it will help much, but if I understand correctly looking at what I think is the relevant code for Kate, it looks like it tries to find the tools in the PATH and if it doesn’t find them, the actions get disabled:
QList<std::pair<QString, QString>> KateFileActions::supportedDiffTools()
{
// query once if the tools are there in the path and store that
// we will disable the actions for the tools not found
static QList<std::pair<QString, QString>> resultList{{QStringLiteral("kdiff3"), safeExecutableName(QStringLiteral("kdiff3"))},
{QStringLiteral("kompare"), safeExecutableName(QStringLiteral("kompare"))},
{QStringLiteral("meld"), safeExecutableName(QStringLiteral("meld"))}};
return resultList;
}
Having said that, I’ve tried the Kate flatpak from Flathub and it doesn’t seem to disable any of the entries normally for me, and simply throws the error “The selected program could not be started. Maybe it is not installed.”. I even tried creating a shell script, naming the file meld, that runs flatpak-spawn --host meld $@, making it executable and overriding the flatpak path to point to the folder the script was in, but it didn’t help.
The only time the options showed as disabled was when I was trying to compare a currently empty/unsaved file against an existing saved file.
oh, this is a good point… both files must be saved for any of the compare features to work because they are comparing FILES, not what is saved in a buffer somewhere.
I’d like to apologize in advance for my ignorance, as I am a very new Linux user (OpenSUSE Leap 16.0). That said, my understand of the “everything is a file” philosophy in Linux leads me to believe that even that buffer you describe as housing the unsaved contents of the document could be compared, but perhaps they just didn’t implement that.
I’m also totally ready to be wrong about that. Are buffers like those we’re discussing actually not files, and instead just volatile data in RAM memory registers, lacking any file structure?
i’m sure there is a file (or part of one) somewhere in /proc or /run but finding it is another matter and expecting it to be stable across reboots might be even more of a stretch.
I would think that Kate would inherently already know where they are, though, since it put them there and has an active connection to them by virtue of displaying their contents in its editor frames.
I’m still poking around with editors and modules trying to find a low-fuss visual string compare with dark theme myself, and a lot of the discussions like these I have come across in my travels are fascinating. A big thanks to all of you who frequent these forums and help each other and everyone else that wanders along in the process!
This means that git was not found. Kate uses that to compare documents.
The other case was fixed (for flatpak) a few months ago so it should work better now.
Yes, (they might be getting persisted) but for this case, yes they are in memory only.
This feature can be trivially implemented for unsaved files (by writing the files to a temporary location and then comparing them). It just hasn’t been done yet.
I had a similar issue and thought it would be helpful to note for others who come across this thread:
The option will also be greyed out if you are trying to compare files in split views.
the OP’s question was a bit different as they were trying to do a compare with a file that had not yet been saved, so meld had nothing to work it (it requires two files to compare).