Feed the Birds

Mac OS X Lion and Xterm

If you’re running Lion as your desktop OS, you may well have bumped into this little one already. If you try to use commands such as nano or top or many other normal things, you may well be getting this error.

Error opening terminal: xterm-256color.

Brilliant.

It happens because there is no file defining a 256 colour session in Snow Leopard, or Leopard, or Tiger for that matter. You’re even likely come across the error when SSH-ing in non-Mac systems. So how to solve it?

Stick this in a shell script in /usr/local/bin/ or similar.

#!/bin/bash

if [ -z $1 ]; then
	echo "Usage: $0 <hostname>"
	exit 1
fi
echo "Copying xterm-256color to $1..."
echo "You may well be asked for the password to $1 now."
scp /usr/share/terminfo/78/xterm-256color root@$1:/usr/share/terminfo/78

xtermffs.sh on GitHub

You’ll need the root user enabled for this to work. Cheeky.

← Recent Articles