running diffmerge.sh on OS X runs app behing all others
Moderator: SourceGear
running diffmerge.sh on OS X runs app behing all others
Hi
First of all - thank you for wonderful tool.
I really got used to it on linux, but when I tried to use it on mac, I found a problem which makes in very inconvenient to use DiffMerge.
If I run diffmerge by activating its app icon, or using quicksilver, it start correctly, and I immediately see its menu and window.
But when I run diffmerge from command line using supplied script diffmerge.sh, program starts behind all currently running programs, and its menu and window are not visible until I command-tab there.
How can we fix this?
First of all - thank you for wonderful tool.
I really got used to it on linux, but when I tried to use it on mac, I found a problem which makes in very inconvenient to use DiffMerge.
If I run diffmerge by activating its app icon, or using quicksilver, it start correctly, and I immediately see its menu and window.
But when I run diffmerge from command line using supplied script diffmerge.sh, program starts behind all currently running programs, and its menu and window are not visible until I command-tab there.
How can we fix this?
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Update your copy of DiffMerge.sh with the following.
I'm not much of an Apple Script user, but I've managed to get
the following to do what you want. Edit the DiffMerge.sh script
that I shipped with 3.1 and change the "exec ${DIFFMERGE..."
line to the following:
It does have a quirk or two -- if you give an invalid file or command
line arg, DiffMerge will give an error dialog and the OSASCRIPT
command will hang for a few seconds before returning an obscure
error message. But if everything is OK with the command line args,
you should be fine.
I plan on putting this change in the next release of DiffMerge.
Let me know if this helps,
jeff hostetler
the following to do what you want. Edit the DiffMerge.sh script
that I shipped with 3.1 and change the "exec ${DIFFMERGE..."
line to the following:
this will launch DiffMerge and then bring it to foreground.${DIFFMERGE_EXE} --nosplash "$@" &
/usr/bin/osascript - <<EOF
tell application "DiffMerge"
activate
end tell
EOF
It does have a quirk or two -- if you give an invalid file or command
line arg, DiffMerge will give an error dialog and the OSASCRIPT
command will hang for a few seconds before returning an obscure
error message. But if everything is OK with the command line args,
you should be fine.
I plan on putting this change in the next release of DiffMerge.
Let me know if this helps,
jeff hostetler
Thank you.
While this fix seems to be a bit like band-aid it works indeed.
Since majority of my use for diffmerge is driven by svn, chances of invalid command line args are very slim.
BTW - I have created nice shell script that wraps diffmerge in such a way that it is nice and convenient to use it with svn, I just change svn config file to use that wrapper script for diffing and for conflict resolution, and that is it.
I created it while using linux, but it works fine now with OS X.
If you want it, you can have it
While this fix seems to be a bit like band-aid it works indeed.
Since majority of my use for diffmerge is driven by svn, chances of invalid command line args are very slim.
BTW - I have created nice shell script that wraps diffmerge in such a way that it is nice and convenient to use it with svn, I just change svn config file to use that wrapper script for diffing and for conflict resolution, and that is it.
I created it while using linux, but it works fine now with OS X.
If you want it, you can have it
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Sure, post it as a new topic.
Sure, post it as a new topic. It may be helpful for others.
Thanks,
jeff
Thanks,
jeff
Well, I found a problem with that script that makes it not usable for me.
That solution runs diffmerge in a spawned process, and that means that 'diffmerge' script has become non-blocking. While this would not be a problem for casual user, this makes it impossible to integrate it with subversion because its expectation (valid) is for diff program to be blocking.
BTW - I noticed that there is a number of other programs that have same problem as diffmerge with hiding behind all other windows. 'gitk' is one of them, 'git gui' is another, and there were some others... This is a common problem, something is not right in Leopard...
Anyway, here is a modification of your script that worked for me, making diffmerge again blocking:
Happy diffing!
That solution runs diffmerge in a spawned process, and that means that 'diffmerge' script has become non-blocking. While this would not be a problem for casual user, this makes it impossible to integrate it with subversion because its expectation (valid) is for diff program to be blocking.
BTW - I noticed that there is a number of other programs that have same problem as diffmerge with hiding behind all other windows. 'gitk' is one of them, 'git gui' is another, and there were some others... This is a common problem, something is not right in Leopard...
Anyway, here is a modification of your script that worked for me, making diffmerge again blocking:
Code: Select all
sleep 0.1; osascript -e 'tell application "DiffMerge" to activate' &
exec ${DIFFMERGE_EXE} --nosplash "$@"
-
- Posts: 534
- Joined: Tue Jun 05, 2007 11:37 am
- Location: SourceGear
- Contact:
Re: running diffmerge.sh on OS X runs app behing all others
SourceGear DiffMerge 3.3.0 is now available and addresses this problem. (Actually,
this was present in 3.2.0, but I missed this thread when in my post-release follow-up.)
There is now code inside DiffMerge to try to force itself to the foreground
when launched from the command line/shell script.
Full details can be found at http://www.sourcegear.com/diffmerge/index.html.
jeff hostetler
this was present in 3.2.0, but I missed this thread when in my post-release follow-up.)
There is now code inside DiffMerge to try to force itself to the foreground
when launched from the command line/shell script.
Full details can be found at http://www.sourcegear.com/diffmerge/index.html.
jeff hostetler
Re: running diffmerge.sh on OS X runs app behing all others
Thank you for the follow-up.
Yes, the problem is definitely fixed now
Yes, the problem is definitely fixed now