From: "Antonino A. Daplas" <adaplas@gmail.com>
To: Paul LeoNerd Evans <leonerd@leonerd.org.uk>
Cc: Jan Engelhardt <jengelh@linux01.gwdg.de>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Andrew Morton <akpm@osdl.org>, Daniel Jacobowitz <dan@debian.org>
Subject: Re: [PATCH 17/16] Do not reset UTF8 on terminal reset
Date: Mon, 02 Apr 2007 20:47:59 +0800 [thread overview]
Message-ID: <1175518079.4545.3.camel@daplas> (raw)
In-Reply-To: <20070402115411.GL26707@cel.leo>
[-- Attachment #1: Type: text/plain, Size: 2160 bytes --]
On Mon, 2007-04-02 at 12:54 +0100, Paul LeoNerd Evans wrote:
> On Mon, Apr 02, 2007 at 07:44:13PM +0800, Antonino A. Daplas wrote:
> > > Is it OK to do that? I recall when I was originally looking at the code
> > > I didn't want to just remove that line, because it looked like that was
> > > being used to first initialise the vc* structure when it is created, as
> > > well as reset it every time. Doesn't this leave vc->vc_utf uninitialised
> > > when a new VC is allocated?
> >
> > That's true. We can move the line vc->vc_utf = 0; in vc_init()
> > instead.
>
> ...
>
> > @@ -2590,6 +2589,7 @@ static void vc_init(struct vc_data *vc,
> > vc->vc_rows = rows;
> > vc->vc_size_row = cols << 1;
> > vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
> > + vc->vc_utf = 0;
> >
> > set_origin(vc);
> > vc->vc_pos = vc->vc_origin;
>
> While we're on that subject, did you take a look at my original mail?
I did not actually.
> The intent with that patch was to allow system policy to state all new
> VCs are UTF-8-enabled by default. I feel that in 2007 this should be the
> default setting.
>
> Would it therefore be possible to have
>
> vc->vc_utf = some_default;
>
> where some_default comes maybe from a sysctl or some other configurable
> source? Or maybe even have a compiletime option?
>
> This would get around many bugs. For example, on boot, "unicode_start"
> can only set utf8 mode on the existing VCs 1 to 6. If X11 fails to
> start, debian nicely runs me the XKeepsCrashing program, which offers to
> show me logs and the like. It reads the locale, en_GB.UTF-8 and
> determines we're in UTF-8 mode, so outputs Unicode linedrawing
> characters for dialogs. Unfortunately, we're on VC7 which doesn't have
> UTF-8 mode turned on, so much mess results.
>
> It would be nice if the kernel's default UTF-8 mode for new VCs could be
> synched to whatever local policy was regarding locale.
How about this? This should allow us to reset the terminal without
affecting utf, and also allows setting of a global utf default that can
be set via boot option or sysfs:
echo 1 > /sys/module/vt/parameters/default_utf
Tony
>
[-- Attachment #2: utf.diff --]
[-- Type: text/x-patch, Size: 913 bytes --]
diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 1bbb45b..b9b3247 100644
--- a/drivers/char/vt.c
+++ b/drivers/char/vt.c
@@ -157,6 +157,8 @@ static void blank_screen_t(unsigned long
static void set_palette(struct vc_data *vc);
static int printable; /* Is console ready for printing? */
+static int default_utf;
+module_param(default_utf, int, S_IRUGO | S_IWUSR);
/*
* ignore_poke: don't unblank the screen when things are typed. This is
@@ -1497,7 +1499,6 @@ static void reset_terminal(struct vc_dat
vc->vc_charset = 0;
vc->vc_need_wrap = 0;
vc->vc_report_mouse = 0;
- vc->vc_utf = 0;
vc->vc_utf_count = 0;
vc->vc_disp_ctrl = 0;
@@ -2590,6 +2591,7 @@ static void vc_init(struct vc_data *vc,
vc->vc_rows = rows;
vc->vc_size_row = cols << 1;
vc->vc_screenbuf_size = vc->vc_rows * vc->vc_size_row;
+ vc->vc_utf = default_utf;
set_origin(vc);
vc->vc_pos = vc->vc_origin;
next prev parent reply other threads:[~2007-04-02 12:48 UTC|newest]
Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-01 18:13 [PATCH 0/16] Assorted patches Jan Engelhardt
2007-04-01 18:13 ` [PATCH 1/16] vt-sysfs-for-colors.diff Jan Engelhardt
2007-04-02 6:49 ` Antonino A. Daplas
2007-04-02 7:31 ` [PATCH 17/16] Do not reset UTF8 on terminal reset Jan Engelhardt
2007-04-02 9:30 ` Antonino A. Daplas
2007-04-02 11:26 ` Paul LeoNerd Evans
2007-04-02 11:44 ` Antonino A. Daplas
2007-04-02 11:54 ` Paul LeoNerd Evans
2007-04-02 12:47 ` Antonino A. Daplas [this message]
2007-04-02 13:20 ` Paul LeoNerd Evans
2007-04-02 13:34 ` Jan Engelhardt
2007-04-02 18:50 ` Pavel Machek
2007-04-01 18:14 ` [PATCH 2/16] vt-pure-colors.diff Jan Engelhardt
2007-04-01 18:39 ` James Bruce
2007-04-02 6:49 ` Antonino A. Daplas
2007-04-02 7:04 ` Jan Engelhardt
2007-04-02 7:50 ` Antonino A. Daplas
2007-04-02 8:01 ` Jan Engelhardt
2007-04-01 18:14 ` [PATCH 3/16] vt-underline-color.diff Jan Engelhardt
2007-04-02 5:37 ` Andrew Morton
2007-04-02 6:57 ` Antonino A. Daplas
2007-04-01 18:14 ` [PATCH 4/16] vt-printk-color.diff Jan Engelhardt
2007-04-01 18:14 ` [PATCH 5/16] fix-kthread-niceness.diff Jan Engelhardt
2007-04-02 5:39 ` Andrew Morton
2007-04-01 18:15 ` [PATCH 06/16] isofs-add-write-bit.diff Jan Engelhardt
2007-04-01 18:15 ` [PATCH 07/16] kconfig-dynamic-frequency.diff Jan Engelhardt
2007-04-01 18:39 ` Kyle Moffett
2007-04-01 18:42 ` Jan Engelhardt
2007-04-01 18:52 ` Kyle Moffett
2007-04-01 19:01 ` Jan Engelhardt
2007-04-01 19:42 ` [PATCH] Kyle Moffett
2007-04-01 19:47 ` [PATCH] Jan Engelhardt
2007-04-01 20:07 ` [PATCH] Kyle Moffett
2007-04-01 19:50 ` [PATCH] Add a CONFIG_I_KNOW_WHAT_THE_HELL_I_AM_DOING variable Kyle Moffett
2007-04-01 23:03 ` [PATCH] Andi Kleen
2007-04-01 20:22 ` [PATCH 07/16] kconfig-dynamic-frequency.diff Robert P. J. Day
2007-04-01 18:15 ` [PATCH 08/16] console-printk-level.diff Jan Engelhardt
2007-04-01 19:07 ` Randy Dunlap
2007-04-01 18:15 ` [PATCH 09/16] zlib-decompression-status.diff Jan Engelhardt
2007-04-02 17:48 ` Jörn Engel
2007-04-02 18:50 ` Jan Engelhardt
2007-04-01 18:15 ` [PATCH 10/16] show-partitions-on-mount-error.diff Jan Engelhardt
2007-04-02 5:47 ` Andrew Morton
2007-04-02 5:48 ` Andrew Morton
2007-04-02 7:01 ` [PATCH 10/16] show partitions on mount error Jan Engelhardt
2007-04-02 18:59 ` [PATCH 10/16] show-partitions-on-mount-error.diff Pavel Machek
2007-04-04 0:42 ` Jan Engelhardt
2007-04-01 18:16 ` [PATCH 11/16] samba-eintr-fix.diff Jan Engelhardt
2007-04-01 19:09 ` Dave Jones
2007-04-01 19:28 ` Jan Engelhardt
2007-04-01 19:42 ` Dave Jones
2007-04-02 5:53 ` Andrew Morton
2007-04-01 18:16 ` [PATCH 12/16] cifs-use-mutex.diff Jan Engelhardt
2007-04-02 5:36 ` Roland Dreier
2007-04-01 18:17 ` [PATCH 13/16] show-pipesize-in-stat.diff Jan Engelhardt
2007-04-02 5:58 ` Andrew Morton
2007-04-02 6:48 ` Jan Engelhardt
2007-04-02 10:41 ` Eric Dumazet
2007-04-04 0:48 ` Jan Engelhardt
2007-04-04 5:03 ` Eric Dumazet
2007-04-17 8:05 ` Jan Engelhardt
2007-04-01 18:17 ` [PATCH 14/16] kconfig-allow-override.diff Jan Engelhardt
2007-04-01 18:44 ` Sam Ravnborg
2007-04-01 19:09 ` Randy Dunlap
2007-04-01 18:18 ` [PATCH 15/16] use-regular-eth-suffix.diff Jan Engelhardt
2007-04-01 18:42 ` Kyle Moffett
2007-04-02 1:40 ` Jouni Malinen
2007-04-01 18:18 ` [PATCH 16/16] warn-on-kthread-name-truncation.diff Jan Engelhardt
2007-04-02 6:00 ` Andrew Morton
2007-04-02 6:51 ` Jan Engelhardt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1175518079.4545.3.camel@daplas \
--to=adaplas@gmail.com \
--cc=akpm@osdl.org \
--cc=dan@debian.org \
--cc=jengelh@linux01.gwdg.de \
--cc=leonerd@leonerd.org.uk \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox