2004-06-16 · in Ideas · 192 words

On 80s-era Unix systems, terminals were attached to the host using serial connections. As different terminals supported different serial line speeds, the Unix tty settings include the line speed. Some terminal-oriented programs (such as vi) use this to control how they perform screen updates: if the terminal is on a slow link, then it's probably worth deferring updates and doing a bigger batch at once.

These days, the majority of terminal devices are ptys, and the line speed is no longer set to a useful value. However, there are still situations in which it'd be useful to have some idea of the connection speed: for instance, ssh over a slow network link. It'd be useful if sshd could measure or estimate the connection speed and set that as the line speed for the pty it creates.

The existing mechanism probably wouldn't be good enough to handle this. You'd need better resolution and higher line speeds, along with the ability to change the speed on the fly. It'd probably also be useful to have some sort of latency measurement that'd allow programs to decide how long they can reasonably defer user input for.