Synopsis #
The plan9port package brings Plan 9 applications to OpenBSD. It includes the Acme and Sam editors, the 9term terminal, and an X window manager named rio. These applications run on OpenBSD; installing them does not install the Plan 9 operating system.
Start by running the tools inside an existing graphical session. Replacing the window manager is optional. A three-button mouse, or a working middle-button emulation, makes the editors easier to use.
Install and Launch the Tools #
Install the package:
doas pkg_add plan9port
Use the 9 wrapper to select the Plan 9 version of a command:
9 acme
9 sam notes.txt
9 9term
Each command opens a graphical application. Run them separately or add & when launching several from one terminal. The wrapper selects the tools for that command without changing the login shell’s PATH or replacing similarly named OpenBSD utilities.
Read the package instructions and introductory manual:
less /usr/local/share/doc/pkg-readmes/plan9port
9 man 1 intro
Edit a File with Acme #
Create a small working directory and open it:
mkdir -p ~/Documents/plan9
printf '%s\n' 'Notes for the week' 'Read the afterboot manual.' > ~/Documents/plan9/notes.txt
cd ~/Documents/plan9
9 acme notes.txt
Acme divides its interface into columns containing text windows. Each window has a tag line with its file name and commands such as Del, Get, and Put.
| Action | Mouse operation |
|---|---|
| Select and edit text | Left button |
Execute a command, including Put to save | Middle button |
| Open a file name or search for text | Right button |
Edit the note, then middle-click Put in that window’s tag to save it. Middle-click New in a column tag to create another text window. Type pwd into its body and middle-click the word to run the command; Acme opens an output window. Check that the saved file contains the edit from another terminal.

Middle-click Del to close a window. A modified window requires a second Del before discarding unsaved changes. Use Put first when the changes should be kept.
Use Sam for File Editing #
Sam provides a command window and a separate view of the file:
9 sam ~/Documents/plan9/notes.txt
Select and edit text in the file window. In the command window, w writes the current file and q quits. Sam’s command language also supports addressed edits across files. Start with the sam(1) manual
before using commands that change several files.
Try the rio Window Manager #
The plan9port version of rio is an X window manager modeled on Plan 9’s window system. It takes the place of the existing window manager for that session. Do not start it alongside another window manager on the same display.
After confirming that the X session works, save the current ~/.xsession if it exists. For xenodm(1)
, use:
#!/bin/sh
export PATH="$PATH:/usr/local/plan9/bin"
exec /usr/local/bin/9 rio
Save that script as ~/.xsession, then make it executable:
chmod u+x ~/.xsession
Log out and log in again. For startx(1), use the same script as ~/.xinitrc; see X session configuration
.
Right-click the background to open rio’s window menu. Choose New, then hold the right button and drag a rectangle for a terminal. Move, Reshape, Hide, and Delete operate on selected windows. Choose a hidden window’s name from the same menu to restore it.

Use 9 rio exit from a terminal to end rio. When it is the final exec in .xsession, exiting it ends the graphical session. Restore the previous session file before the next login to return to the previous window manager.
Troubleshooting #
- An OpenBSD command behaves differently: keep Plan 9 commands out of the front of
PATH; launch them through9. - The editor does not respond as expected: confirm which mouse button the application receives, especially through a remote viewer or a touchpad.
- rio reports another window manager: log out of the current session before selecting rio in the session file.
- The graphical login returns immediately: inspect
~/.xsession-errorsand verify the command paths in the session file.
See the plan9port documentation for the application manuals and differences from native Plan 9.