git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Gitk doesn't work on macOS Mojave

From
ECEvgeny Cherpak <cherpake@me.com>
Date
Jul 19, 2018, 21:11 UTC
Message-ID
<1569C0A9-7C44-4F28-9C9B-AF2489E021AB@me.com>
In-Reply-To
<CAPig+cT+Z-hN6WidMOUW2jRVNFovvv03LEFESXpr05NKmpnWAA@mail.gmail.com>
It seems this code placed at the end of the file, after getcommits() does the trick:
if {[tk windowingsystem] eq "aqua"} { 
	set openscript [format { 
		open -a \"$(ps -p %d -o comm=)\"
	} [pid] ]
    exec osascript -e [format {
		do shell script "%s"
    } "$openscript” ]
}
Show 27 quoted lines
> On 19 Jul 2018, at 22:12, Eric Sunshine <sunshine@sunshineco.com> wrote:
> 
> On Thu, Jul 19, 2018 at 2:48 PM Evgeny Cherpak <cherpake@me.com> wrote:
>> You have probably heard this by now already, but gitk doesn’t work on macOS 10.14 - because it uses Apple Events,
>> And apps on 10.14 require user to give them permissions to control other apps with Apple Events.
> 
> This hasn't been reported, so thanks for bringing it up.
> 
>> Here is what I get when I try running it on my machine with beta 4 installed:
>> 
>> Error in startup script: 58:102: execution error: Not authorized to send Apple events to System Events. (-1743)
>>    while executing
>> "exec osascript -e [format {
>>        tell application "System Events"
>>            set frontmost of processes whose unix id is %d to true
>>        end te..."
> 
> Fortunately, this feature is merely a convenience, not otherwise
> critical to gitk functioning. It would be ideal if someone running
> Mojave could devise up a patch to work around the problem (either by
> skipping this code on Mojave or discovering a different way to bring
> the application to the foreground). An alternative would be to revert
> 76bf6ff93e (gitk: On OSX, bring the gitk window to front, 2013-04-24),
> which introduced this code.
> 
> (Note, however, that the gitk project is dormant, so it's not clear if
> such a patch will be picked up.)
Previous: Eric SunshineNext: Eric Sunshine
Message 3 of 7 in “Gitk doesn't work on macOS Mojave”
  1. Evgeny CherpakJul 19, 2018
  2. Eric SunshineJul 19, 2018
  3. Evgeny CherpakJul 19, 2018
  4. Eric SunshineJul 19, 2018
  5. Eric SunshineJul 20, 2018
  6. Evgeny CherpakJul 20, 2018
  7. gitk: fix MacOS 10.14 "Mojave" crash on launchEric Sunshine, Jul 24, 2018

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.