M1 Macbook Air

377 views
Skip to first unread message

Chris Banda

unread,
Jun 13, 2021, 4:04:55 PM6/13/21
to plan9port-dev
Hi to all, I installed plan9port on M1 Macbook Air,  but it seems that it does not load the .profile, because it says:
zsh: command not found: acme 

what could be the issue? Thank you.

Ethan Gardener

unread,
Jun 16, 2021, 7:37:41 AM6/16/21
to 'Shoce' via plan9port-dev
Quick fix before I start rambling: Have you tried running `9 acme`? (Without the `quotes` of course.) `9` is a script which adds plan9port to the path.

Shell ramble: ".profile" takes me back to my early Linux days when I couldn't understand which of .profile .bashrc *and other files* were loaded at what times. "Command not found" was a common problem. My best solution was to run `. ~/.profile` in every open terminal, and of course make sure .profile doesn't run any one-time-only commands. To keep $PATH clean, my .profile set it before adding to it; overriding the system setting. My second-best solution was to paste the update to $PATH in every open terminal. (I've since moved away from shells...) Of course, all of this is to do with zsh (or in my case, bash,) not plan9port.

Quick check for the worst-case scenario: How old is the M1 Macbook Air? I once had to build plan9port with X11 support on my iBook because by iBook was so old, plan9port no longer supported the graphics system offered by the newest version of OS X my iBook could run. In that case, acme and the other graphical programs were not built. (Try `9 rc`; it's not graphical.) I built plan9port with X11 support; that was good enough.

Chris Banda

unread,
Jun 16, 2021, 8:08:55 AM6/16/21
to plan9port-dev

only "/usr/local/plan9/bin/9 acme" works, I tried .zshenv and .zshrc and .zprofile but no luck, the M1 is 2020 model

Ethan Gardener

unread,
Jun 16, 2021, 8:37:53 AM6/16/21
to 'Shoce' via plan9port-dev
On Wed, Jun 16, 2021, at 1:02 PM, Chris Banda wrote:

only "/usr/local/plan9/bin/9 acme" works, I tried .zshenv and .zshrc and .zprofile but no luck, the M1 is 2020 model

Ah, that's easy: Copy 9 into your path. That's what I used to do.

If I remember right, anything started by 9 will have /usr/local/plan9/bin at the head of the path. Acme won't remove it, so any plan9port scripts you run from acme will get the right path.

Chris Banda

unread,
Jun 16, 2021, 10:12:12 AM6/16/21
to plan9port-dev
echo $PATH gives me this

~ % echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/tx/.cargo/bin

Dan Cross

unread,
Jun 16, 2021, 10:15:23 AM6/16/21
to bandac...@gmail.com, plan9port-dev
On Wed, Jun 16, 2021 at 10:12 AM Chris Banda <bandac...@gmail.com> wrote:
echo $PATH gives me this

~ % echo $PATH

/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/go/bin:/Users/tx/.cargo/bin

Where did you install plan9port? /usr/local/plan9? I would add, `/usr/local/plan9/bin` to the end of your PATH in your shell startup file. For example, in .zshenv, one might add the line:

export PATH=${PATH}:/usr/local/plan9/bin

Then logout and back in and try again.

        - Dan C.

On Wednesday, 16 June 2021 at 14:37:53 UTC+2 eek...@fastmail.fm wrote:
On Wed, Jun 16, 2021, at 1:02 PM, Chris Banda wrote:

only "/usr/local/plan9/bin/9 acme" works, I tried .zshenv and .zshrc and .zprofile but no luck, the M1 is 2020 model

Ah, that's easy: Copy 9 into your path. That's what I used to do.

If I remember right, anything started by 9 will have /usr/local/plan9/bin at the head of the path. Acme won't remove it, so any plan9port scripts you run from acme will get the right path.

--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/plan9port-dev/b2b1e2d7-671d-4276-b562-2b4913bfba8fn%40googlegroups.com.

Chris Banda

unread,
Jun 16, 2021, 10:28:47 AM6/16/21
to plan9port-dev
Thank you, export PATH=${PATH}:/usr/local/plan9/bin works

Chris Banda

unread,
Jun 16, 2021, 10:40:44 AM6/16/21
to plan9port-dev
just one more thing, win in acme attaches this "~ % [?2004h" to end of the terminal, what is that number?

Dan Cross

unread,
Jun 16, 2021, 10:46:17 AM6/16/21
to bandac...@gmail.com, plan9port-dev
On Wed, Jun 16, 2021 at 10:40 AM Chris Banda <bandac...@gmail.com> wrote:
just one more thing, win in acme attaches this "~ % [?2004h" to end of the terminal, what is that number?

That's a terminal control sequence that `zsh` is outputting as part of your prompt. However, since acme and win don't interpret such such things, those bytes just display as data. When run under something like Terminal.app, they're interpreted by the terminal emulator program itself. I don't know what that specific sequence does, but you might be able to look it up here: https://invisible-island.net/xterm/ctlseqs/ctlseqs.html

If you'd like to turn it off, there is probably information in one of the zsh man pages ("man zshall" at the terminal).

        - Dan C.

Petter Rodhelind

unread,
Jun 17, 2021, 7:00:51 AM6/17/21
to cro...@gmail.com, Chris Banda, plan9port-dev
I believe most shells adhere to the environment variable “TERM”, stating what abilities your current terminal have. Setting it to “dumb” inside acme works really well.

I have a wrapper script for starting acme (~/bin/acme, where ~/bin is first in my $PATH), setting a bunch of environment variables to get a better acme experience:

#!/usr/bin/env rc

# Run only one instance of plumber.
p=`{pgrep plumber}
if (~ $#p 0) plumber

TERM=dumb
SHELL=rc
MANPAGER='9 p'
PAGER='col -b'
GIT_EDITOR=editinacme
fn cd { builtin cd $1 && awd $sysname }

font=/usr/local/plan9/font/lucsans/unicode.8.font,/mnt/font/GoMono/18a/font
lfont=/usr/local/plan9/font/lucm/unicode.9.font,/mnt/font/GoMono/16a/font

exec $PLAN9/bin/acme -a -f $font -F $lfont $* &

— Petter

Ethan Gardener

unread,
Jun 17, 2021, 8:11:36 AM6/17/21
to 'Shoce' via plan9port-dev
On Thu, Jun 17, 2021, at 12:00 PM, Petter Rodhelind wrote:
I believe most shells adhere to the environment variable “TERM”, stating what abilities your current terminal have. Setting it to “dumb” inside acme works really well.

Yes. Setting it to "9term" also works for ncurses programs. I think everything uses ncurses these days; Bash certainly did many years ago.

Chris Banda

unread,
Jun 18, 2021, 6:47:34 AM6/18/21
to plan9port-dev
May I please ask, where would one place that wrapper script on the machine? where do any script relating to acme reside?

kind regards

Ethan Gardener

unread,
Jun 18, 2021, 8:23:00 AM6/18/21
to 'Shoce' via plan9port-dev
Now you mention it, Acme should already be setting $TERM to "9term". If that's the case, I guess some ncurses installs don't have a 9term mapping. You can check $TERM in .zshrc (i guess), and if it's "9term", set it to "dumb".

I'll leave the general question of Acme scripts to Acme experts.
--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.

Chris Banda

unread,
Jun 24, 2021, 8:27:39 AM6/24/21
to plan9port-dev
Also I'd like to change acme font from euro.8.font to typeunicode.12.font,

Kind regards

Ethan Gardener

unread,
Jun 24, 2021, 12:18:16 PM6/24/21
to 'Shoce' via plan9port-dev
On Thu, Jun 24, 2021, at 9:39 AM, Chris Banda wrote:
Also I'd like to change acme font from euro.8.font to typeunicode.12.font,

You can launch acme with -f to change the regular font or -F to change the alternate font selected by the Font command.

Chris Banda

unread,
Jun 25, 2021, 7:02:20 AM6/25/21
to plan9port-dev
I understand that this line "acme -f /mnt/font/Monaco/16a/font" change the regular font, but I wish for is to use one of the fonts that come with acme

Ethan Gardener

unread,
Jun 26, 2021, 4:15:44 AM6/26/21
to 'Shoce' via plan9port-dev
Just change the path to the font you wish to use. /mnt/font is a virtual filesystem served by fontsrv. fontsrv translates host system fonts into Plan 9 font file format and serves them as files. Real files in Plan 9 font format work just as well.
--

---
You received this message because you are subscribed to the Google Groups "plan9port-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plan9port-de...@googlegroups.com.

Chris Banda

unread,
Jun 26, 2021, 7:14:18 AM6/26/21
to plan9port-dev
the challenge is that the output of echo $PLAN9 is empty, thus the output of the command you suggest is:

➜  ~ acme -f $PLAN9/font/lucsans/typeunicode.12.font

imageinit: can't open font /font/lucsans/typeunicode.12.font: No such file or directory

acme: can't open display: No such file or directory

Alexander Kapshuk

unread,
Jun 26, 2021, 7:27:54 AM6/26/21
to bandac...@gmail.com, plan9port-dev
Sounds like you don't have these set in ~/yourshell_dot_profile, e.g. ~/.zprofile:
plan9/INSTALL:194,196
echo "* Add these to your profile environment."
echo " PLAN9=$PLAN9 export PLAN9"
echo ' PATH=$PATH:$PLAN9/bin export PATH'


Jaime Silvela

unread,
Dec 12, 2021, 4:58:09 AM12/12/21
to plan9port-dev
Late reply, but: those control characters from zsh are for *bracketed paste mode*, and don't play well with dumb terminals.
You can `unset zle_bracketed_paste`.
BTW I've tried adding the command to my `.zshrc` but it seems I need to enter it in the Acme Win session.

Samy Belteton

unread,
Dec 19, 2021, 2:31:42 PM12/19/21
to plan9port-dev
adding this to to my .zshrc did the trick:

export SHELL=rc; $SHELL


Reply all
Reply to author
Forward
0 new messages