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

Re: Gitk doesn't work on macOS Mojave

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Jul 19, 2018, 21:49 UTC
Message-ID
<CAPig+cRYVwsMxUQGWHWyfC1gpVgEtt0VH-CmQoGizEAp-B_7WQ@mail.gmail.com>
In-Reply-To
<1569C0A9-7C44-4F28-9C9B-AF2489E021AB@me.com>
[please reply inline rather than top-posting]
On Thu, Jul 19, 2018 at 5:11 PM Evgeny Cherpak <cherpake@me.com> wrote:
Show 10 quoted lines
> 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” ]
> }

Interesting idea. A shortcoming of this approach is that it's non-deterministic. It will bring _any_ running gitk to the foreground, rather than the one mentioned by PID, which would be a potentially confusing regression. Such confusion _might_ be worse than simply not foregrounding the application at all (though that's a matter of opinion). Unfortunately, the 'open' command doesn't let you do so by PID, and Googling shows only answers which predate Mojave (that is, they all suggest Apple Events).

To avoid such a regression on older MacOS's, it would be nice to retain the Apple Events code, but that would mean gitk would need to do a version check or something to avoid executing the Apple Events code on Mojave.

By the way, the same problem presumably afflicts "git gui", which has identical code in it for foregrounding the application. Does that match with your experience?

Previous: Evgeny CherpakNext: Eric Sunshine
Message 4 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.