Running tmux on an M1 Mac in arm64 mode

Viewed 5221

So I have tmux installed via arm64 homebrew.

I initially compiled alacritty (my favorite terminal emulator) for arm64 manually, so that's running in arm64 mode. uname -a confirms we're in arm64.

Darwin ndo-mbp.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm64

Then I installed homebrew which slowly but surely getting arm64 bottles for most popular applications, including tmux (https://github.com/Homebrew/brew/issues/7857). So I installed that from the arm64 shell, it compiled successfully.

If I run file $(which tmux) I get:

/opt/homebrew/bin/tmux: Mach-O 64-bit executable arm64

However, if I launch that tmux binary in my arm64 alacritty, I seem to land in x86_64 mode. Running uname -a from inside that tmux window I get:

Darwin ndo-mbp.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 x86_64

Any idea what's going on here? I'm relatively new to Mac OS, so maybe I'm missing something obvious.

2 Answers

I had the same problem.

In the end the solution was in the ~/.tmux.conf, add: set-option -g default-shell /path/to/arm64/zsh

Then kill and restart tmux:

sudo kill -9 [PID of tmux]
tmux

uname -a then returns arm64.

Now that the M1 CPUs have been around for a while and the community has had time to figure things out, I manually cross compiled Alacritty for arm64 as they don't have official binaries yet (Github Actions apparenlty won't build them yet).

But from there, I was in alacritty in arm64 mode (uname -m == arm64 :thumbsup:) and was then able to remove and reinstall brew and tmux the recommended way from their websites.

Followed all instructions and was good to go. I think just having been a bit early and messing around making manual changes here and there threw the whole thing off.

I do have one unrelated problem now however - and that's that tmux won't start as a non-root user. It just immediately crashes haha. When started with sudo, it opens with my expected config and uname -m confirms it is the arm64 version, however I can't get it to start with my normal user. Anyway, problem for another day!

Related