Building Drawterm on NetBSD (assumes NetBSD 5.x on i386 port)


Drawterm is a Plan 9 Terminal Emulator used to connect to a remote Plan 9 system. You can obtain the source code from Either grab the latest tarball or use mercurial. Extract someplace convenient like $HOME/src/ :

	% mkdir ~/src
	% cd src && snarf
	% tar xzf drawterm.tgz

Configure and Patch

Now that the source files are extracted change to the drawterm/ directory and make the following file tweaks with your favorite editor (+ means add line; - means remove line):

	# Make.config
	+ CONF=unix

	# Make.unix
	- X11=/usr/X11R6                                                   
	+ X11=/usr/X11R7

	- LDADD=-L$(X11)/lib64 -L$(X11)/lib -lX11 -ggdb
	+ LDADD=-L$(X11)/lib64 -L$(X11)/lib -lX11 -ggdb -lossaudio

Build and Install

With the above files tweaked you're ready to build drawterm:

% make
gcc -Wall -Wno-missing-braces -ggdb -I. -I./include -I./kern -c -I/usr/X11R7/include -D_THREAD_SAFE -pthread -O2  -c main.c
gcc -Wall -Wno-missing-braces -ggdb -I. -I./include -I./kern -c -I/usr/X11R7/include -D_THREAD_SAFE -pthread -O2  -c cpu.c

If the build fails, type 'make clean' and double-check your tweaks, then re-run 'make'. If all went well you should see the resulting drawterm executable:

	% ls -l drawterm
	-rwxr-xr-x  1 you  users  1146267 Oct  9 20:23 drawterm
	% ldd drawterm
		-lc.12 => /usr/lib/
		-lXdmcp.6 => /usr/X11R7/lib/
		-lXau.6 => /usr/X11R7/lib/
		-lX11.6 => /usr/X11R7/lib/
		-lossaudio.0 => /usr/lib/
		-lpthread.0 => /usr/lib/

You can run drawterm from where it is but it's better to copy it to $HOME/bin/:

	% cp -p drawterm $HOME/bin/


Assuming the remote Plan 9 system has been configured correctly, the following connects drawterm:


Problems with Colors

If drawterm doesn't look right (default is grey desktop background with rio(1) windows white with black text) it's possible you're X11 display is running at too high resolution; drawterm will work best at 16 or 24 color depth. Try tweaking your /etc/X11/xorg.conf file or toggling the X11 display via the ALT + CTRl + "+/-" keys.