After switching to 'Meld for Mac' from download instead of from homebrew, I saw problem again.
The problem is related how the app is closed. If you use the Menu option, the saved state is removed cleaning. If you close using the window close (read circle), the saved state remains. Somehow, when this there, the application will not open from command line. Sometimes it will open, but you need to manually switch to the Meld application from the tool bar.
To work around I added /Applications/Meld.app/Contents/MacOS/meld.wrapper.sh:
#!/bin/sh
rm -rf ~/Library/Saved\ Application\ State/org.gnome.meld.savedState
exec '/Applications/Meld.app/Contents/MacOS/Meld' "$@"
And added the following to my .basch_profile:
alias meld='/Applications/Meld.app/Contents/MacOS/meld.wrapper.sh'
## Background
Meld is a Gnome tool that uses python3 as it's core. It is well supported on Linux, but for Mac there seems to be a single port that is commonly used: Meld for Mac.
When I found my issue with closing the app, I tried to use the build instructions, but could never get this version to build. I think they were written before Meld was moved from github to gitlab. It also seems to require multiple versions of Python (2.7 and 3+) for tools to build meld.
From https://gist.github.com/p1nox/6102015
Works as of 5/23/2019
brew tap homebrew/cask
brew cask install meld
- If meld doesn't start while executing from terminal, try this:
Modify the /usr/local/Caskroom/meld/3.19.2-r6,osx-15/meld.wrapper.sh
script installed by brew to the following
#!/bin/sh
rm -rf ~/Library/Saved\ Application\ State/org.gnome.meld.savedState
exec '/Applications/Meld.app/Contents/MacOS/Meld' "$@"
Alternative method (by @yousseb)
If you want to install Meld without brew
go to: https://yousseb.github.io/meld/ , this might have a newer version, but the package installed using brew
actually comes from this project.
-
Install XQuartz
-
Install meld with brew
brew install meld
-
Copy PYTHONPATH
brew info pygtk
-
Paste result of (3) in ~/.bashrc or ~/.zshrc
export PYTHONPATH=/usr/local/lib/python2.7/site-packages:$PYTHONPATH
-
Set meld as your default git mergetool
git config --global merge.tool meld
-
Go find your conflicts!
Source: Homebrew/legacy-homebrew#20644