Jul 302023
 

Ah yes! Well the first thing to answer is what a terminal is.

A terminal is a device for communicating with text (graphics was possible but relatively rare especially in the early days) with a computer – you would type in a command in text and the computer would respond in text :-

» ls
1  2  bad-directory

Although the “terminal” is still available today in the form of a gooey program, the early terminals communicated with the computer with some form of serial port (usually RS232). The first terminals were modified teleprinters (often called “Teletypes” due to the domination of that company in the USA). These were large electromechanical devices where the display was paper – they were printing terminals.

The first terminals that displayed on a screen were very much like the printing terminals – they would “print” output from the computer on the last line of the screen and scroll for additional lines. Just like on a printing terminal except that once things scrolled off the top of the screen they were lost.

At this point in computing history, we’re just at the start of the microcomputer age; in fact one of the uses for which Intel’s second processor (the 8008) was developed was to operate as the heart of a computer terminal.

As the microprocessor controlled terminal was essentially run by software, programmers started adding in new features that would do things like clear the screen, move the cursor around the screen so you could display text anywhere you wanted.

At this point one definition of “dumb terminal” can be found – a terminal that just emulated a printing terminal was a dumb terminal; ones with additional features weren’t so dumb.

As the 1970s progressed, terminals gained more and more features and eventually some became capable of downloading software from the computer they were connected to and running that software locally. Such as (optionally) the HP 2647. Or the Bell Labs blit terminal.

Such terminals could be termed “smart” and their predecessors “dumb”. And if you notice a similarity with the somewhat later “thin clients“, you wouldn’t be entirely wrong.

Alternatively, some terminals (such as the IBM “green screen” terminals) operated in block mode where the terminal would allow a certain amount of editing within the terminal and send the result back to the computer a screen at a time. These necessarily had to have a certain amount of “smarts” built in, so they were smarter than character at a time terminals (thus “dumb”).

"Dumb" Terminal
A “dumb” terminal

So to an extent there is no real agreement on what a “dumb terminal” really is. Pick one that you like!

Oct 272016
 

I have recently been ‘entertaining’ myself with watching some videos on the vim editor which to the uninitiated is an extremely powerful if somewhat ‘unusual’ editor that is popular amongst Linux power users. One of the surprising things that came up was that apparently there are experienced vim users who are not aware of why the ex mode exists.

Or probably why the ex command exists.

In the dim and distant past (and in fact even longer than I’ve used Unix!), one of the possible ways of interacting with computers was with a printing terminal :-

On such a terminal, using a visual editor like vim (or it’s predecessor vi) would have been painful. Redrawing the screen would take a couple of minutes or more; imaging moving the cursor across from the beginning of the line to the end!

So it was common to use an alternative kind of editor – the line editor. The process of creating a file is somewhat clumsy :-

$ ex ~/Foo
"~/Foo" 1L, 4C
Entering Ex mode.  Type "visual" to go to Normal mode.
:p
Foo
:a
Bar
.
:p
Bar
:1
Foo
:write
:quit

Now for a quick explanation (although this is no tutorial on line editors!): The ex ~/Foo is the command given to start editing a pre-existing file called Foo in the ex editor. After the editor starts up, I enter the “p” command to print the current line. I then use the “a” command to append text after the first line, and enter a “.” on it’s own to finish adding lines. Again I use “p” to print the current line, and then “1” to print the first line.

Which is more than you’ll ever want to know about how to use ex, so why does it still exist?

The first reason is simply because it’s possible. It’s almost certainly fairly easy to support the ex mode with vim; after all the ex-mode is effectively the commands you get when you enter “:” within vim.

The next reason is that line editors were sometimes used within shell scripts to batch edit files, and somewhere out there is a shell script from hell that relies on ex to keep running.