9

Wish based tools for instance git-gui and gitk are showing a black/broken screen after upgrading to macOS Monterey:

enter image description here

enter image description here

How can I fix this?

Nico
  • 249
  • 2
  • 5

3 Answers3

5

It seems that the Tcl/Tk version (8.5) shipped with macOS Monterey is broken.

A possible fix:

use the version shipped with Homebrew

Assuming Homebrew is already setup, do:

brew upgrade
brew install tcl-tk

Then setup a link to the new version of wish:

cd /usr/local/bin
ln -s ../Cellar/tcl-tk/8.6.12/bin/wish wish

Eventually replace 8.6.12 with the version exposed by:

brew info tcl-tk

Restart your terminal and all wish-based utilities should work well!

Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
Nico
  • 249
  • 2
  • 5
  • 1
    I've seen system Tcl being broken (in a different way) with one of the first macOS Big Sur updates, then fixed with the next update... And then they did it again in Monterey? Didn't they are expected to test what they ship to end-users? Very strange way to "deprecate" a tool - deletion would be better than shipping a broken system tool... –  Dec 17 '21 at 10:40
  • You'll need to add /usr/local/bin to your PATH env variable (superseding wherever old `wish` binary was). Once I did that, I got it working. – Mayank Jain Feb 23 '22 at 08:13
1

There is a link that brew is unable to manage correctly

ls -l /usr/bin/wish

lrwxr-xr-x  1 root  wheel  7 Jan 22 08:42 /usr/bin/wish -> wish8.5

I have found this workaround

brew tap-new --no-git $USER/local-tap-git-2-32
brew extract --version=2.32 git $USER/local-tap-git-2-32
brew install git@2.32
/usr/local/opt/git@2.32/bin/git --version
brew link --overwrite git@2.32

brew tap-new --no-git $USER/local-tap-tcl-tk-8-6-10
brew extract --version=8.6.10 tcl-tk $USER/local-tap-tcl-tk-8-6-10
brew install tcl-tk@8.6.10
brew link --overwrite tcl-tk@8.6.10

And then run gitk with

/usr/local/opt/tcl-tk@8.6.10/bin/wish  $(which gitk)
Giacomo1968
  • 53,069
  • 19
  • 162
  • 212
1

As an supplement for existing Homebrew-based solutions, the below is the MacPorts-based one, just 2 steps needed:

Firstly check system information:

$ uname -v
Darwin Kernel Version 21.3.0
$ port -v
MacPorts 2.7.2

Step 1: Install XQuartz, since XOrg window system is not shipped by default on macOS 12(Monterey),

$ Xorg -version

X.Org X Server 1.20.11
X Protocol Version 11, Revision 0
...

Step 2: Install Tcl and Tk:

# Check if it is newer than 8.5
$ port info tcl
tcl @8.6.12 (lang)
...
$ port info tk@8.6.12
tk @8.6.12 (x11)
...


# Install
$ sudo port install tcl@8.6.12
...
$ sudo port install tk@8.6.12
...


# Check installation folder. (Might need to open a new Terminal)
$ ls -l $(which tclsh)
/opt/local/bin/tclsh -> tclsh8.6
$ ls -l $(which wish)
/opt/local/bin/wish -> wish8.6

Open wish window: (Here should be an non black/broken window)

$ wish

Done.