All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] vt: Do not clear UTF when resetting console
@ 2007-04-02 14:13 Antonino A. Daplas
  2007-04-02 17:35 ` H. Peter Anvin
                   ` (2 more replies)
  0 siblings, 3 replies; 16+ messages in thread
From: Antonino A. Daplas @ 2007-04-02 14:13 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Linux Kernel Development, Jan Engelhardt, Paul LeoNerd Evans

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.

This is based from patches by Jan Engelhardt and Paul LeoNerd Evans.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
---

 drivers/char/vt.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/drivers/char/vt.c b/drivers/char/vt.c
index 1bbb45b..fdd548f 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_utf8;
+module_param(default_utf8, 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_utf8;
 
 	set_origin(vc);
 	vc->vc_pos = vc->vc_origin;

^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2007-04-04 16:53 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-02 14:13 [PATCH] vt: Do not clear UTF when resetting console Antonino A. Daplas
2007-04-02 17:35 ` H. Peter Anvin
2007-04-03  0:16   ` Antonino A. Daplas
2007-04-03  0:23     ` Jan Engelhardt
2007-04-03  0:53       ` Antonino A. Daplas
2007-04-03  0:55       ` H. Peter Anvin
2007-04-03 21:14         ` Paul LeoNerd Evans
2007-04-02 19:10 ` Jan Engelhardt
2007-04-03  0:16   ` Antonino A. Daplas
2007-04-03 11:41 ` Martin Mares
2007-04-03 14:51   ` Paul LeoNerd Evans
2007-04-03 15:37     ` Martin Mares
2007-04-04  5:42       ` Antonino A. Daplas
2007-04-04  8:12         ` Jan Engelhardt
2007-04-04  8:26           ` Paul LeoNerd Evans
2007-04-04 16:53         ` Martin Mares

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.