This is the mail archive of the cygwin-patches@cygwin.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch]: Ncurses frame drawing


On Mon, Oct 13, 2003 at 06:38:42PM +0200, Micha Nelissen wrote:
> Hi,
> 
> Attached is a patch to enable correct ncurses frame drawing. It does so 
> by implementing the escape sequence for 'start/end alternate charset'. 
> This is code \E[11m and \E[10m respectively in the linux termcap.

This patch is a nice idea but it's not quite correct.  You can't
rely on "current_codepage" being ansi_cp.  Since the user can set
it to oem_cp in the CYGWIN environment variable, you have to memorize
the old value on \E[11m and to restore to the old value on \E[10m.

Corinna

> Regards,
> 
> Micha.

> Index: fhandler_console.cc
> ===================================================================
> RCS file: /cvs/src/src/winsup/cygwin/fhandler_console.cc,v
> retrieving revision 1.115
> diff -u -w -r1.115 fhandler_console.cc
> --- fhandler_console.cc	27 Sep 2003 02:36:50 -0000	1.115
> +++ fhandler_console.cc	13 Oct 2003 16:31:13 -0000
> @@ -1111,6 +1111,12 @@
>  	     case 9:    /* dim */
>  	       dev_state->intensity = INTENSITY_DIM;
>  	       break;
> +             case 10:   /* end alternate charset */
> +               current_codepage = ansi_cp;
> +	       break;
> +             case 11:   /* start alternate charset */
> +               current_codepage = oem_cp;
> +	       break;
>  	     case 24:
>  	       dev_state->underline = FALSE;
>  	       break;

> 2003-10-13  Micha Nelissen  <M.Nelissen@student.tue.nl>
> 
> * fhandler_console.cc (char_command): added escape sequence for codepage
> ansi <-> oem switching for ncurses frame drawing capabilities.
> 


-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Developer                                mailto:cygwin@cygwin.com
Red Hat, Inc.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]