tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Colored kernel messages on serial console



On Mon, Jul 27, 2026 at 06:55:41PM +0200, Timo Buhrmester wrote:
> Without *really* knowing what I'm doing, I've just changed the kprintf
> to produce ANSI color sequences so that I'll get my familiar green
> kernel messages (after migrating from wscons to a serial console setup
> recently).
> 
> How insane is this?  It seems to work fine, but like I said, I'm not
> really familiar with the code.  And would NetBSD be interested in this,
> if it was implemented cleanly (i.e. color being configurable, etc.)?
> 
> (I realize it still needs something to stop it if the console is, say,
> wscons.  I figured a sysctl might be an okay choice, but if there is
> maybe a more automatic way to tell what console actually is...?)
> 
> I'd appreciate any input.

This is a bad idea; not every terminal is ANSI-compatible.  Furthermore,
it likely will foul up any curses programs on the console even more than
kernel printout already does.


Home | Main Index | Thread Index | Old Index