Anybody want to fix ash's backspace line wrap?

Rob Landley rob at landley.net
Wed May 13 23:55:19 UTC 2009


On Wednesday 13 May 2009 17:36:34 Cathey, Jim wrote:
> >The reason it needs to keep track of this is that unix terminals suck.
>
> That suckage predates Unix by a fair amount.

Unix started out on teletypes, and still thinks it's talking to a keyboard 
connected to a daisy-wheel printer via a serial port with a defined baud 
rate.  (I'm aware the PDP-7 had a bitmapped display, but they programmed it 
and the PDP-11 through a teletype.  Hence "ed" as the text editor; it 
actually made sense at the time.)

Also, the first version of Unix was written in 1969.  DEC's VT100 started 
shipping in 1970 and IBM's TN3270 in 1972.  Presumably by "predates by a fair 
amount" you're referring to the IBM 2260 from 1964, or perhaps the display 
built into the PDP-1 that ran "spacewar"?

> But Unix was certainly caught up in it.

The Commodore 64 made this easy, as did DOS.  Linux did not; it coped Unix's 
terminal semantics and other fun things like the need to unmount floppies 
before ejecting them.

> >However, if your shell prompt didn't start at the left edge of the
> >screen (which happens surprisingly often), the resulting line editing
> >is completely horked once you go past the right edge of the screen.
>
> Which is why many (most?) shells accept a ^L to repaint the
> entire prompt line, if they've got that special width logic.

Both ash and bash clear the screen when you hit ctrl-L.  That's not _quite_ 
the same thing as getting the line editing metrics right.

Rob
-- 
Latency is more important than throughput. It's that simple. - Linus Torvalds


More information about the busybox mailing list