gitk assumes availability of `osascript` on macos
Hi,
Tiny one here. On macos, gitk (tested 2.50.1) attempts to call osascript so it can focus/raise the UI. But it fails hard if osascript isn't present in the $PATH.
There are a number of reasons osascript might not be available in a particular environment, e.g. if launched from inside a "pure" nix shell, but seeing as it's just a quality-of-life feature it would be nice if failures to call osascript could just be ignored.
Thanks,
robert.
Quoted 8 lines · Robert Scott
Tiny one here. On macos, gitk (tested 2.50.1) attempts to call
osascriptso it can focus/raise the UI. But it fails hard ifosascriptisn't present in the $PATH.There are a number of reasons
osascriptmight not be available in a particular environment, e.g. if launched from inside a "pure" nix shell, but seeing as it's just a quality-of-life feature it would be nice if failures to callosascriptcould just be ignored.
A patch[*] was posted to the mailing list years ago which, I believe, should fix this problem for you. Unfortunately, the patch was never picked up due to the then-maintainer of Gitk being missing-in-action. Perhaps the current Gitk maintainer (Cc:'d) will pick up the patch.
Am 20.09.25 um 21:52 schrieb Eric Sunshine:
Quoted 10 lines · Robert Scott
Quoted 8 lines
Tiny one here. On macos, gitk (tested 2.50.1) attempts to call
osascriptso it can focus/raise the UI. But it fails hard ifosascriptisn't present in the $PATH.There are a number of reasons
osascriptmight not be available in a particular environment, e.g. if launched from inside a "pure" nix shell, but seeing as it's just a quality-of-life feature it would be nice if failures to callosascriptcould just be ignored.
Quoted 6 lines
A patch[*] was posted to the mailing list years ago which, I believe, should fix this problem for you. Unfortunately, the patch was never picked up due to the then-maintainer of Gitk being missing-in-action. Perhaps the current Gitk maintainer (Cc:'d) will pick up the patch.
I've picked up the patch:
https://github.com/j6t/gitk/compare/master...es/ignore-osascript-failure
Please test and suggest improvements. Should the links in the commit message be redirected to lore.kernel.org?
-- Hannes
Quoted 16 lines · Johannes Sixt
Am 20.09.25 um 21:52 schrieb Eric Sunshine:
Quoted 15 lines · Robert Scott
Quoted 8 lines
Tiny one here. On macos, gitk (tested 2.50.1) attempts to call
osascriptso it can focus/raise the UI. But it fails hard ifosascriptisn't present in the $PATH.There are a number of reasons
osascriptmight not be available in a particular environment, e.g. if launched from inside a "pure" nix shell, but seeing as it's just a quality-of-life feature it would be nice if failures to callosascriptcould just be ignored.A patch[*] was posted to the mailing list years ago which, I believe, should fix this problem for you. Unfortunately, the patch was never picked up due to the then-maintainer of Gitk being missing-in-action. Perhaps the current Gitk maintainer (Cc:'d) will pick up the patch.
Quoted 4 lines
Quoted 1 line
I've picked up the patch:
https://github.com/j6t/gitk/compare/master...es/ignore-osascript-failure
Thank you. Looks good to me.
Quoted 2 lines
Please test and suggest improvements. Should the links in the commit message be redirected to lore.kernel.org?
Updating the links would not be a bad idea. Here are the updated links if you want to amend locally:
[1]: https://lore.kernel.org/git/[email protected]/
[2]: https://lore.kernel.org/git/CABNJ2G+h3zh+=wLA0KHjUn8TsfhqUK1Kn-1_=6hnXVRJUPhuuA@mail.gmail.com/
Otherwise, I can resend.