Running git difftool -d <commit> <commit>
on Windows opens the WebStorm diff tool but the contents disappear as soon as it starts.
Tried trustExitCode, prompt and the bat file.
[diff]
tool = webstorm
[difftool "webstorm"]
cmd = \"C:/Users/<me>/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\"
This happens because JetBrains WebStorm is already open so the diff is passed off to the existing instance and the diff command returns. As soon as it returns, git does a cleanup and poof the contents are gone.
Solutions:
Hold the shell with sleep or cmd //c "pause"
. After closing the diff window, return to shell and press Ctrl+c. Or start the difftool as git difftool -d <commit> <commit> &
.
cmd = \"C:/Users/<me>/AppData/Roaming/JetBrains/WebStorm 2018.1.2/bin/webstorm64.exe\" diff \"$LOCAL\" \"$REMOTE\" && sleep 3600
Similar issue on Mac: Using IntelliJ as git mergetool always exits as soon as soon as it starts