laman@sdcsvax.UUCP (Mike Laman) (08/11/84)
If OCRNL is set, moving the cursor through absolute cursor motion with a terminal having cursor addressing such that a '\r' is required in part of the outputted cursor motion sequence (to line #13 zero relative), the tty driver changes (as it should) the '\r' to a '\n' and the cursor get moved to line #10 instead of line #13! Solutions: 1. Turn off OCRNL in "newterm()" (screen/newterm.c) and in "m_newterm()" (screen/miniinit.c) for the mini curses users. [ This is the quick and simple fix I used. EASIER to make sure it works! ] 2. Add '\r' recognition and execution of the appropriate actions IF OCRNL is on. This recognition would probably go in switch in "tparm()" (screen/tparm.c) containing the case for a '\n' and a comment about scratching one's head. They may want to do some more scratching. This seems to be the BETTER solution, but it would take some time to do (typical of "head scratching" areas of code). I may get to it some day, but I seem to be busy enough lately. The fixes I implemented follow for the following two files: a) "newterm()" (screen/newterm.c): in the "#ifdef USG" where ECHO is turned off, add: (cur_term->Nttyb).c_oflag &= ~OCRNL; b) "m_newterm()" (screen/miniinit.c): just after the call to "_newtty()" and before the call to "signal(SIGTSTP, m_tstp)" (the latter is appropriately "ifdef"ed to SIGTSTP, of course) add: #ifdef USG (cur_term->Nttyb).c_oflag &= ~OCRNL; reset_prog_mode(); #endif USG Mike Laman, NCR @ Torrey Pines UUCP: {ucbvax,philabs,sdcsla}!sdcsvax!laman