Re: [PATCH] vt: Do not clear UTF when resetting console

From: Antonino A. Daplas
Date: Mon Apr 02 2007 - 20:17:29 EST


On Mon, 2007-04-02 at 10:35 -0700, H. Peter Anvin wrote:
> Antonino A. Daplas wrote:
> > Resetting the console, either by ANSI escape sequences or by the reset utility,
> > will drop the console back to legacy (non-UTF-8) mode. Fix this by leaving the
> > field vc_data.vc_utf untouched in reset_terminal(). In addition, a global
> > variable (default_utf8) which defines system-wide UTF-8 setting is created.
> > This variable can be adjusted via sysfs.
>
> If you're going to introduce a system-wide default, instead of issuing
> the appropriate escape code, then I would argue it should still be
> forced (to the default) when issuing a console reset.
>

That would be the cleanest and purest behavior. But it's possible to set
one console to UTF-8 and another to legacy mode. So one can corrupt the
user's console just by issuing a reset or echo -e '\033c'. (Although one
can argue that users who know what UTF-8 is also knows how to set the
encoding back)

Until userspace is more capable of setting back the terminal to its
previous configuration, I would tend to agree with Jan, that we should
leave the current utf setting of that particular vc alone.

Tony


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/