MCPcopy Create free account
hub / github.com/LemonOSProject/LemonOS / DoAnsiCSI

Function DoAnsiCSI

Applications/Terminal/main.cpp:209–389  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

207}
208
209void DoAnsiCSI(char ch){
210 switch(ch){
211 case ANSI_CSI_SGR:
212 DoAnsiSGR(); // Set Graphics Rendition
213 break;
214 case ANSI_CSI_CUU:
215 {
216 int amount = 1;
217 if(strlen(escBuf)){
218 amount = atoi(escBuf);
219 }
220
221 paintAll = true;
222
223 curPos.y -= amount;
224 if(curPos.y < 0) curPos.y = 0;
225 break;
226 }
227 case ANSI_CSI_CUD:
228 {
229 int amount = 1;
230 if(strlen(escBuf)){
231 amount = atoi(escBuf);
232 }
233
234 curPos.y += amount;
235 Scroll();
236 break;
237 }
238 case ANSI_CSI_CUF:
239 {
240 int amount = 1;
241 if(strlen(escBuf)){
242 amount = atoi(escBuf);
243 }
244 curPos.x += amount;
245 if(curPos.x > columnCount) {
246 curPos.x = 0;
247 curPos.y++;
248 Scroll();
249 }
250 break;
251 }
252 case ANSI_CSI_CUB:
253 {
254 int amount = 1;
255 if(strlen(escBuf)){
256 amount = atoi(escBuf);
257 }
258 curPos.x -= amount;
259 if(curPos.x < 0) {
260 curPos.x = columnCount - 1;
261 curPos.y--;
262
263 paintAll = true;
264 }
265 if(curPos.y < 0) curPos.y = 0;
266 break;

Callers 1

PrintCharFunction · 0.70

Calls 9

strlenFunction · 0.85
strchrFunction · 0.85
sizeMethod · 0.80
DoAnsiSGRFunction · 0.70
ScrollFunction · 0.70
clearMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected