Date: Wed, 24 Jul 1996 05:51:40 -0400 (EDT) From: Tim.Vanderhoek@X3000 (root@freebsd.org) To: FreeBSD-gnats-submit@freebsd.org Subject: misc/1428: ncurses doesn't always display ALTCHARSET correctly. Message-ID: <199607240951.FAA00927@X3000> Resent-Message-ID: <199607250610.XAA19836@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 1428 >Category: misc >Synopsis: ncurses doesn't always display ALTCHARSET correctly >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Wed Jul 24 23:10:04 PDT 1996 >Last-Modified: >Originator: Tim Vanderhoek >Organization: Cluttered >Release: FreeBSD 2.2-960501-SNAP i386 >Environment: An aging -SNAP of 2.2 (960501). Standard, otherwise. Mach64ct, in case that matters. I am not running this from an Xterm, however X is running on a different virtual terminal. Problem tested and verified under both standard `sh' and `bash'. >Description: ncurses supports the display of IBM high-half and ROM characters on PC-clones (ie. my computer). This support is enabled via the A_ALTCHARSET highlight. The problem is that these characters are not correctly displayed until refresh(curscr) (or some-such) is called, even though ncurses believes they are being correctly displayed (which is proven by the fact that it allocates only one character's space for the character). See the comments within the how-to-repeat C example for the same, but worded differently. >How-To-Repeat: /* The following features are present in this demo; * * Press any key and it will be echo'ed to the screen at the * beginning of a line. An arrow will point to it. The * ascii base-10 value of the key will also be printed. * * Press the END key to terminate the program. * * Press Ctrl-Z to suspend. * * Press F10 to send the program a SIGSTOP (non-cathable suspend). * * Press F1 to force a screen redraw using refresh(curscr). * *You should observe the following behaviour; * * When you enter what should be printed as an IBM half-high or ROM * character, it is not displayed as such. Rather, you see only the * `^' character. If you whatch closely, you will see that two * characters are printed, but space is only allocated to one. This * is probably because ncurses (correctly) assumes that A_ALTCHARSET * is on and thus allocates only one space. However, since * A_ALTCHARSET isn't working, two characters are printed. * If you do not turn on A_ALTCHARSET you will see that two character * spaces are allocated and printed in. * * When you suspend the program and type `fg', all characters are * redisplayed correctly. (Proceeding IBM characters are not). * * When you press F1 to force a screen refresh with refresh(curscr) * all characters are displayed correctly. (Proceeding IBM characters * are not). */ #include <ncurses.h> #include <signal.h> main () { int c; initscr (); atexit (endwin); raw (); echo (); keypad (stdscr, 1); /* Lets us catch stuff like KEY_UP * doesn't seem to affect problem */ nodelay (stdscr, 1); attron (A_ALTCHARSET); while (1) { c = getch (); if (c == KEY_F(1)) { wrefresh (curscr); /* force full refresh */ printw("<--echo'ed character. %#0x (Did a refresh)\n", c); } else if (c != ERR) printw ("<--echo'ed character. %x\n", c); refresh (); /* Press the END key to exit. */ if (c == KEY_END) exit (0); /* Press Ctrl-Z to suspend. */ if (c == 26) kill (getpid(), SIGTSTP); /* Press F10 to do a non-catchable suspend. */ if (c == KEY_F(10)) kill (getpid(), SIGSTOP); } } >Fix: I suspect this is a problem with the port of ncurses to FreeBSD. The work-a-round demonstrated in the How-To-Repeat is to call refresh(curscr). >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199607240951.FAA00927>