Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!julius.cs.uiuc.edu!roundup.crhc.uiuc.edu!ux1.cso.uiuc.edu!milo.mcs.anl.gov!midway!gargoyle!igloo!ddsw1!olsa99!rascal!theo From: theo@rascal.UUCP (T. Kramer) Newsgroups: comp.terminals,sco.opendesktop Subject: Alternate character modes on qvt101 and freedom 100 terminals Keywords: qvt101, freedom100, curses Message-ID: <1500@rascal.UUCP> Date: 11 Feb 91 12:30:59 GMT Reply-To: theo@rascal.UUCP (T. Kramer) Followup-To: comp.terminals Organization: Rascal Systems Lines: 79 I am having the most frustrating time with curses on SCO Open Desktop developers edition. When compiling a program that uses curses and switches terminals such the freedom 100 and qvt101 into alternate character mode (smacs) all goes well. It is however not possible to switch back into normal mode (rmacs). This only happens when the character sequence for switching back to normal mode is '\E%'. The program listed below illustrates the phenomena. When analysing the output of the program below ie. redirecting the output to a file and using hd to see the characters output, the '\E%' (rmacs) sequence is missing. If I adjust the sequence for rmacs in the terminfo source to something else like 'AA' the rmacs sequence is there. This does not happen on my XENIX V.2.2 development system (fortunatly) therefore forcing me to create production copies of my software on the XENIX box. Does anybody out there know why this is happening, and is there some way I can fix this in a portable way, ie. it must be general for a wide range of terminals? Note: To get the terminal back into non alternate mode after running the included program type in the following: tput rmacs +----------------------- Start of code section ----------------------------+ #include #include #define ULCORNER 'f' #define LLCORNER 'e' #define URCORNER 'g' #define LRCORNER 'h' #define HLINE 'k' #define VLINE 'j' void main() { int index; initscr(); cbreak(); noecho(); attron(A_ALTCHARSET); move(0,0); addch(ULCORNER); for (index = 1; index < 20; index++) addch(HLINE); addch(URCORNER); attroff(A_ALTCHARSET); /* puts("\E%"); fflush(stdout); works but is not portable */ refresh(); getch(); endwin(); } /* cc qvt.c -oqvt -lcurses cc qvt.c -oqvt -lcurses # 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, */ +------------------------------+---------------------------------------------+ | theo@rascal | smacs of something rotten to me | +------------------------------+---------------------------------------------+