[770] in Moira

home help back first fref pref prev next nref lref last post

Re: com_err shouldn't print '\r' after '\n' when printing errors

daemon@ATHENA.MIT.EDU (Jonathan I. Kamens)
Thu Sep 8 12:57:43 1994

Date: Thu, 8 Sep 1994 12:58:48 -0400
From: "Jonathan I. Kamens" <jik@cam.ov.com>
To: tytso@MIT.EDU
Cc: krb5-bugs@MIT.EDU, bug-zephyr@MIT.EDU, bugs@MIT.EDU, bug-moira@MIT.EDU
In-Reply-To: <9409081648.AA02739@pinata.MIT.EDU> (tytso@MIT.EDU)

   Date: Thu, 8 Sep 1994 12:48:53 +0500
   From: "Theodore Ts'o" <tytso@MIT.EDU>

   Is the printing of the \r actually causing a problem, or is this only an
   aesthetics thing?  It is my belief that printing the \r is actually the
   right thing.

I often use com_err programs in "terminals" that display control
characters, e.g., in Emacs shell windows and while running "script".
The extra ^M's printed by com_err programs clutter up the output in
such cases and are ugly to boot.

I understand your argument that com_err should print the ^M's so that
the right thing happens whenever possible, but I disagree with it,
because it's a gross hack which is not, in my opinion, consistent with
the UNIX philosophy.  Tools should do their own jobs, and nothing
else.  There are a slew of other standard UNIX programs which arguably
should print ^M's if com_err does, and they don't.  Can you name *one*
other UNIX program which prints "\r\n" or "\n\r" instead of just "\n"
for the reason you described?

It seems to me that applications which are overly concerned about the
possibility that they might screw up the tty (and applications which
mess with the tty usually know that they do) should put "\r\n" instead
of "\n" in their com_err messages themselves.

Incidentally, \n\r vs. \r\n does make a difference, in my opinion,
because at least when it's \r\n like it's supposed to be, all the ^M's
are at the end of lines and easily ignored.  When it's \n\r, ^M's end
up at beginnings of lines, which looks really gross when they're
visible.

  jik

home help back first fref pref prev next nref lref last post