Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!wuarchive!rex!uflorida!gatech!emory!att!pacbell.com!pacbell!rtech!sco!staceyc From: staceyc@sco.COM (Stacey Campbell) Newsgroups: comp.terminals,sco.opendesktop Subject: Re: Alternate character modes on qvt101 and freedom 100 terminals Keywords: qvt101, freedom100, curses Message-ID: <10248@scolex.sco.COM> Date: 15 Feb 91 18:36:39 GMT References: <1500@rascal.UUCP> <10156@scolex.sco.COM> <1502@rascal.UUCP> Sender: news@sco.COM Organization: The Santa Cruz Operation, Inc. Lines: 94 In article <1502@rascal.UUCP> theo@rascal.UUCP (T. Kramer) writes: >I have checked the manual and you are quit correct in stating that >the '%' (percentage) character is special. However, even if the rmacs >sequence is '\E%%' or for that matter '\E%%%%%..%%' the rmacs sequence >is not output to the screen. The output for my program is as follows:- > >^[(^[(+^[= 5^[%%^M^[$fkkkkkkkkkkkkkkkkkkkg^[=7 Which encouraged me to go back and check both the program and the terminfo file again. Message-ID: <1500@rascal.UUCP> #include #include <-- term.h is not needed #define ULCORNER 'f' <-- these defines should not be used #define LLCORNER 'e' they are terminal specific #define URCORNER 'g' #define LRCORNER 'h' #define HLINE 'k' #define VLINE 'j' void main() { int index; initscr(); cbreak(); noecho(); attron(A_ALTCHARSET); <-- unnecessary move(0,0); <-- unnecessary addch(ULCORNER); for (index = 1; index < 20; index++) addch(HLINE); <-- use the defined ACS_HLINE, curses understands that it needs to use acsc, sgr or smacs addch(URCORNER); <-- use ACS_URCORNER attroff(A_ALTCHARSET); /* puts("\E%"); fflush(stdout); works but is not portable */ ^ | +-- unnecessary refresh(); getch(); endwin(); } # Terminfo source code for my qvt101 terminal qp|qvt101+so|Qume qvt101 + terminal, cr=^M, cud1=^J, ind=^J, bel=^G, is2=\E0P\Ew\E.4\E(\EC\E%\EX\E\047\E+\Ef^M\Eg, clear=\E+, tbc=\E3, hts=\E1, sam, cols#80, lines#24, cr=^M, nel=^J, xmc#0,khome=^^, kcuf1=^L, kcub1=^H, kcud1=^J, kcuu1=^K, cup=\E=%p1%' '%+%c%p2%' '%+%c, cvvis=\E.1, cnorm=\E.4\E*, cbt=\EI, cud1=^J, cuf1=^L, cuu1=^K, home=^^, cub1=^H, ul, smso=\E), rmso=\E(, el=\Et, ed=\Ey, il1=\EE, dl1=\ER, dch1=\EW, ich1=\EQ, smul=\EG8, rmul=\EG0,rmacs=\E%,smacs=\E$, kf1=^A@^M, kf2=^AA^M, kf3=^AB^M, kf4=^AC^M, kf5=^AD^M, kf6=^AE^M, kf7=^AF^M, kf8=^AG^M, kf9=^AH^M, kf0=^AI^M, You must define an acsc string for your terminal. Curses needs this to correctly deal with alternate characters. If you do not define alternate characters curses will supply its default set ('+', '-', etc). It is not necessary to turn on A_ALTCHARSET attributes when using the ACS_ defines. Note that the Xenix tic command ignores the acsc string (because of some version confusion between curses, terminfo and Xenix), so use the Unix tic command to create your Xenix compiled terminfo file. Most importantly note that the manual strongly recommends creating sgr and sgr0 strings. The exact wording in one 3b2 AT&T terminfo manual entry is; "REMEMBER THAT sgr AND sgr0 MUST ALWAYS BE SPECIFIED". I have terminfo files that work fine without sgr, but curses relies on sgr0 to turn off all attributes that can be turned on with sgr, smso, et. al.. sgr0 is output at endwin() time. It is important not to associate curses calls such as attroff(A_ALTCHARSET) with actual output. In the above code the call to attroff() will probably generate no output, because the endwin() (amongst other things) should, if the terminfo entry is correct, perform the same function. Hope this has been of some help. [hope you don't mind keeping this in sco.opendesktop 'cos I rarely read comp.terminals] -- Stacey Campbell Internet: staceyc@sco.com UUCP: {uunet,ucscc,att,sq,altos,lotus,sun,microsoft}!sco!staceyc