Skip to content

Commit

Permalink
mac: arrange for arm64 run on arm64
Browse files Browse the repository at this point in the history
Makes 9term.app work again (not put you in an x86_64 jail).
  • Loading branch information
rsc committed Oct 22, 2024
1 parent a2567fc commit 61e362a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
8 changes: 6 additions & 2 deletions mac/9term.app/Contents/MacOS/9term
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@ fshell=$(finger $(whoami) | sed -n 's/.*Shell: //p' | sed 1q)
SHELL=${fshell:-$SHELL}
PLAN9=${PLAN9:-/usr/local/plan9}
cd $HOME
arch=x86_64
if arch -arch arm64 date >/dev/null 2>&1; then
arch=arm64
fi
case "$SHELL" in
*/rc)
echo '
if(! ~ $PLAN9/bin $path)
path=($path $PLAN9/bin)
$PLAN9/bin/9term -l -W600x800 &
arch -arch '$arch' $PLAN9/bin/9term -l -W600x800 &
' | $SHELL -l
exit 0
;;
Expand All @@ -24,6 +28,6 @@ if ! [[ :$PATH: =~ :$PLAN9/bin: ]]
then
PATH=$PATH:$PLAN9/bin
fi
$PLAN9/bin/9term -l -W600x800 &
arch -arch $arch $PLAN9/bin/9term -l -W600x800 &
exit 0

6 changes: 5 additions & 1 deletion mac/Plumb.app/Contents/MacOS/plumb
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,16 @@
if [ -e ~/.bashrc ] ; then
. ~/.bashrc
fi
arch=x86_64
if arch -arch arm64 date >/dev/null 2>&1; then
arch=arm64
fi
PLAN9=${PLAN9:-/usr/local/plan9}

bin=$PLAN9/bin
IFS=$'\n'

for file in $($bin/macargv)
do
$bin/macedit "$file"
arch -arch $arch $bin/macedit "$file"
done

0 comments on commit 61e362a

Please sign in to comment.