[BusyBox] Re: busybox-cvs Digest, Vol 7, Issue 19

Vladimir N. Oleynik dzo at simtreas.ru
Wed Oct 22 12:54:52 UTC 2003


Erik,

>>>extern int reset_main(int argc, char **argv)
>>>{
>>>-	   printf("\033[?25h\033c\033[J");
>>>-       return EXIT_SUCCESS;
>>>+	printf("\033[?25h\033c\033[J");
>>
>>Ohh.
>>Eternal discrimination of international users. :-(
>>The given sequence ("\033c") switches off internationalization to 
>>IBM-Latin-1.
>>The standard utility takes this sequence from a terminfo file
>>which always is corrected by international users to "\033c\033(K"
> 
> 
> If I understand correctly, you would like this applied?
> 
> --- console-tools/reset.c	22 Oct 2003 10:34:15 -0000	1.11
> +++ console-tools/reset.c	22 Oct 2003 12:26:57 -0000
> @@ -29,7 +29,7 @@
>  
>  extern int reset_main(int argc, char **argv)
>  {
> -	printf("\033[?25h\033c\033[J");
> +	printf("\033[?25h\033c\033(K");


Unfortunately, it is correct only for the vt console.
For other terminals it can give wrong effect.
I think, for busybox best is:

#ifdef FEATURE_RESET_SUPPORT_INTERNACIONAL_MAPPING
/* From <linux/kd.h> */
static const int KDGKBTYPE = 0x4B33;  /* get keyboard type */
static const int KB_84 = 0x01;
static const int KB_101 = 0x02;    /* this is what we always answer */

{
  	char arg;
	int fd;

	for(fd = 0; fd < 3; fd++) {
		arg = 0;
		if(ioctl(fd, KDGKBTYPE, &arg) == 0)
			break;
	}
	if(fd < 3)
		printf("033(K");
}
#endif


Also, I don`t know, all or not terminals clearing after "\033c". My consoles and 
xterms clearing all.


--w
vodz




More information about the busybox mailing list