Raspberries with pi symbol overlay

Loving the command line with the Raspberry Pi

0

I’m going to show my age when I share that my first Unix system was a Sun 3/50 workstation in our campus computer lab, when I was an undergraduate student in the early 1990s. Originally released in the late 1980s, our campus lab still relied on a small network of these machines for the computer science program. The Sun 3/50 had a 15.7 MHz M68020 CPU and 4 MB memory, which is underpowered by today’s standards, but powerful for the time. While you could run the X Window System on the Sun 3/50 in “mono” mode, I usually ran my Unix session at the console especially because of the black-on-white monospace-serif displays, which I found easy to read.

Recently, I started a throwback experiment where I run my Raspberry Pi 3 in “console” mode, without a graphical user interface. Naturally, my first thought was to run this like a Sun 3/50 workstation. Here’s how I did it:

Set the console font

When you boot Linux without a graphical interface, you’re using it at the “console.” That’s not technically a terminal which is a separate kind of device that connects to a server over a network, and it’s not a terminal emulator which is software that pretends to be (“emulates”) a terminal. Instead, console mode means you have access to all of the underlying display hardware on the device.

Linux loads a default font when in console mode. However, this font is quite small and plain. Fortunately, you can load other fonts using the setfont command and the fonts available in /usr/lib/kbd/consolefonts. If these fonts aren’t to your liking, you can install other console fonts, such as the Terminus font.

The Terminus font is a good font for running commands at the command line, such as when I only need to do system administration tasks. But I don’t like it when I’m writing text. Instead, I wanted to use a monospace-serif font like the old Sun systems. I think others liked that font too, because there’s a very similar console font that’s available as sun12x22.psfu.gz. You can load it with this command:

$ setfont /usr/lib/kbd/consolefonts/sun12x22.psfu.gz

Set the terminal to black on white

By default, Linux boots up using white text on a black background, but old Sun computers used a black-on-white display. So my next task was to put the system into this “flipped” color mode.

You can use the setterm command to set default attributes for the terminal or console. One neat feature is --inversescreen on to invert the screen colors: if you’re running with white text on a black background, this changes the screen to use black text on a white background.

$ setterm --inversescreen on

Linux like the Sun 3/50

With these settings, using my Raspberry Pi at the console really feels like I’m using the Sun 3/50 from my university days. If you want the full experience, I recommend either using plain vi as your editor, or use the quiet color theme in vim. Either will give you a black-and-white editor experience similar to the old Sun systems:

screenshot of a vim edit session
Editing a document in vim with “quiet” color theme

However, the modern implementation of ls can add color to its output. This can be helpful to easily spot directories and other entries, but I find it distracting when I want to emulate the monospace display from the old Sun systems. You can fix this with an alias:

$ alias ls='/bin/ls --color=never'

With this, the ls command will never add color to its output:

screenshot of ls on Linux
Viewing ls output without colors

Other things still show up in color, which the original Sun systems didn’t support (they were entirely monochrome) but I don’t mind the occasional use of color. For example, when processing a document through nroff, bold text shows up a black text highlighted in cyan, which works well:

viewing an nroff document at the command line
Viewing the first page of an nroff document

These colors also appear when you read online “man” pages, like this page for the setterm command:

The setterm man page
The setterm man page

..or this page for the setfont command:

The setfont man page
The setfont man page

Loving the command line

Using the Raspberry Pi in text mode, using the command line, is a great throwback experiment to remind us how people used Unix from terminals in an era before computers had enough power to run a graphical desktop. And for this demonstration, using the Raspberry Pi like a classic Sun workstation is a fantastic trip filled with nostalgia. The black-on-white text, and the monospace-serif font, remind me of the first time I used Unix. It’s a fun way to get back to the roots of Unix while using Linux.

Leave a Reply