Re: proposing patches (was: Colored kernel messages on serial console)

Mouse <[email protected]> Wed, 29 Jul 2026 09:03:22 -0400 (EDT)
Newsgroups gmane.os.netbsd.devel.kernel
Message-ID <[email protected]>
>> I actually thought the "sysctl for bytes to be prepended; sysctl for
>> bytes to be postpended" proposal was rather clever.

Agreed.

> For such a mechanism to work reliably you'd need to filter the output
> through a little state machine (like our cnmagic state machine) to
> escape the quoted content too.

Depends on the use case.  "Reliably" just has to be "reliably enough
for the use case", after all.  For some use cases, such things are
ignorable (between the chance of anything conflicting with the
delimiter strings and the damage done if anything does; if both are low
enough...).  For example, for Timo's original use case, I would guess
that (a) the chance of output (kernel or non) containing a
colour-setting sequence is low (extremely low for the kernel) and (b)
the damage done if the output isn't perfectly coloured is low-to-zero.

/~\ The ASCII				  Mouse
\ / Ribbon Campaign
 X  Against HTML		[email protected]
/ \ Email!	     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B