Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Single instance mode does not work when launched from Visual Studio 2019 #622

Closed
CrendKing opened this issue Feb 11, 2021 · 1 comment
Closed

Comments

@CrendKing
Copy link

CrendKing commented Feb 11, 2021

I have a git repo. The relevant git config line is

[difftool "winmerge"]
	cmd = WinMergeU.exe -s $LOCAL $REMOTE

WinMerge registry is completely empty and all settings default.

I open this repo in Visual Studio 2019. The "Git Changes" tab shows all the changed files. When I diff the first pair of files, everything works fine. When I diff the next pair, WinMerge shows error saying "Cannot open file C:\Users\CrendKing\AppData\Local\Temp\TFSTemp\vctemp12345_67890.test.xxxxx.cpp". The exact same setup works with Beyond Compare. Also works if I don't use -s or single instance mode in options, but then it will open two windows instead of adding a new tab, which I prefer.

When I go to the temp directory, I can only see the first temp file. It seems like VS2019 creates that temp file, send to WinMerge, but WinMerge terminates that new process immediately without any wait, VS2019 thought the diff is done thus clean up the temp file, but then the old WinMerge process pick up the diff request, unable to find the temp file.

In contrast, Beyond Compare has two executables: BCompare.exe is the GUI and actual diff tool and BComp.exe is a loader. Git by default prefers BComp and it has ability to send request to existing BCompare process. Thus we could have several BComp process, each waiting for diff to finish, but only one BCompare process.

So can WinMerge somehow make single instance mode work with tools like Visual Studio 2019?

@CrendKing CrendKing changed the title Add a launcher executable to make single instance mode work, like how Beyond Compare does Single instance mode does not work when launched from Visual Studio 2019 Feb 11, 2021
sdottaka added a commit that referenced this issue Feb 12, 2021
…ed from Visual Studio 2019

- Add /s:2 command line option
sdottaka added a commit that referenced this issue Feb 13, 2021
…ed from Visual Studio 2019 (2)

- Add /sw command line option
@sdottaka
Copy link
Member

I have added a new command line option /sw. This option limits the WinMerge window that runs like /s to one, but waits for WinMerge that is already running to terminate.

sdottaka pushed a commit that referenced this issue Feb 18, 2021
Translate sentence added with "Fix GitHub issue #622": Single instance mode does not work when launch…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants