comparison src/cm.c @ 10437:3021721d1d69

(cmcheckmagic): New function.
author Karl Heuer <kwzh@gnu.org>
date Tue, 17 Jan 1995 00:18:20 +0000
parents 2825665b8352
children e6bdaaa6ce1b
comparison
equal deleted inserted replaced
10436:c9ba2babe54e 10437:3021721d1d69
96 else 96 else
97 curX--; 97 curX--;
98 } 98 }
99 } 99 }
100 #endif 100 #endif
101
102 /*
103 * Terminals with magicwrap (xn) don't all behave identically.
104 * The VT100 leaves the cursor in the last column but will wrap before
105 * printing the next character. I hear that the Concept terminal does
106 * the wrap immediately but ignores the next newline it sees. And some
107 * terminals just have buggy firmware, and think that the cursor is still
108 * in limbo if we use direct cursor addressing from the phantom column.
109 * The only guaranteed safe thing to do is to emit a CRLF immediately
110 * after we reach the last column; this takes us to a known state.
111 */
112 void
113 cmcheckmagic ()
114 {
115 if (curX == FrameCols)
116 {
117 if (!MagicWrap || curY >= FrameRows - 1)
118 abort ();
119 if (termscript)
120 putc ('\r', termscript);
121 putchar ('\r');
122 if (termscript)
123 putc ('\n', termscript);
124 putchar ('\n');
125 curX = 0;
126 curY++;
127 }
128 }
129
101 130
102 /* 131 /*
103 * (Re)Initialize the cost factors, given the output speed of the terminal 132 * (Re)Initialize the cost factors, given the output speed of the terminal
104 * in the variable ospeed. (Note: this holds B300, B9600, etc -- ie stuff 133 * in the variable ospeed. (Note: this holds B300, B9600, etc -- ie stuff
105 * out of <sgtty.h>.) 134 * out of <sgtty.h>.)