Improving /etc/motd and ANSI
Warner Losh
imp at bsdimp.com
Sat Sep 6 23:21:36 UTC 2014
On Sep 6, 2014, at 5:01 PM, Warren Block <wblock at wonkity.com> wrote:
> /etc/motd has been in need of improvement for some time. Recently, I did a rewrite:
>
> http://www.wonkity.com/~wblock/motd/motd
> http://www.wonkity.com/~wblock/motd/motd.diff
>
> This new version still has the problem of using "in-band" quote marks to mark up the commands. We tell the reader to run `man man', for example, but it's not particularly obvious that the quotes should not be entered.
>
> As an experiment, this version uses ANSI underline escape sequences:
> http://www.wonkity.com/~wblock/motd/motd.ansi
>
> That reads better, is less likely to be misunderstood, and will work on normal consoles and most terminal emulations in use today.
>
> It will not display correctly on things that do not understand VT100/VT220 or ANSI codes, but I suspect that is a vanishingly small portion of the user base. Those users are also likely to be familiar with the problem.
>
> Is there some showstopper reason not to commit this ANSI version?
It embeds the notion that all the world is a VT100 and interprets the ANSI escape code identically.
In years past, this definitely wasn’t the case. But in those years we had many different breeds
of terminal roaming the earth, and these terminals were all somewhat different (even at the same
installation you’d have a heterogeneous setup because different departments got different
vendors to supply their gear). These changes would break that. One of the nice things about
Unix has always been it played very nicely in a heterogeneous environment and all fancy
smancy curses action was done through a layer of indirection so it would work everywhere,
unlike VMS where things were more hard-coded and it was always hard to use non-DEC
gear.
It also assumes that all users want to see the fancy ANSI version with underlines and such. While
rather innocuous, one needn’t look any farther than gnu’s color ls to see what madness lies not
too far down this path.
Finally, console scraping code may be affected in some minor way and you’ll wind up with
text that looks weird.
None of these are huge show-stoppers. But it is a very nice camel’s nose at the moment, and
I’d hate to see the rest of the camel…[*]
Warner
[*] http://en.wikipedia.org/wiki/Camel's_nose
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 842 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-arch/attachments/20140906/fc2c9b1b/attachment.sig>
More information about the freebsd-arch
mailing list