summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2013-09-14 18:52:48 +0200
committerBoris Faure <billiob@gmail.com>2013-09-15 15:32:11 +0200
commit97c2275e8c4d4e1e13ce3a6df329faa633de0c5a (patch)
treeef52534939fdaf98c748ef9359fe35d9e09879b1
parent2beb10beda2c06afd9c0c4cf9b7fe05c63eb8c32 (diff)
improve debug logs
-rw-r--r--src/bin/termptyesc.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/bin/termptyesc.c b/src/bin/termptyesc.c
index 20cbf62..5356ffa 100644
--- a/src/bin/termptyesc.c
+++ b/src/bin/termptyesc.c
@@ -350,9 +350,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
350 } 350 }
351 break; 351 break;
352 case '@': // insert N blank chars 352 case '@': // insert N blank chars
353 DBG("insert N blank chars");
354 arg = _csi_arg_get(&b); 353 arg = _csi_arg_get(&b);
355 if (arg < 1) arg = 1; 354 if (arg < 1) arg = 1;
355 DBG("insert %d blank chars", arg);
356 { 356 {
357 int pi = ty->state.insert; 357 int pi = ty->state.insert;
358 int blank[1] = { ' ' }; 358 int blank[1] = { ' ' };
@@ -368,9 +368,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
368 break; 368 break;
369 case 'A': // cursor up N 369 case 'A': // cursor up N
370 case 'e': // cursor up N 370 case 'e': // cursor up N
371 DBG("cursor up N");
372 arg = _csi_arg_get(&b); 371 arg = _csi_arg_get(&b);
373 if (arg < 1) arg = 1; 372 if (arg < 1) arg = 1;
373 DBG("cursor up %d", arg);
374 ty->state.wrapnext = 0; 374 ty->state.wrapnext = 0;
375 for (i = 0; i < arg; i++) 375 for (i = 0; i < arg; i++)
376 { 376 {
@@ -379,9 +379,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
379 } 379 }
380 break; 380 break;
381 case 'B': // cursor down N 381 case 'B': // cursor down N
382 DBG("cursor down N");
383 arg = _csi_arg_get(&b); 382 arg = _csi_arg_get(&b);
384 if (arg < 1) arg = 1; 383 if (arg < 1) arg = 1;
384 DBG("cursor down %d", arg);
385 ty->state.wrapnext = 0; 385 ty->state.wrapnext = 0;
386 for (i = 0; i < arg; i++) 386 for (i = 0; i < arg; i++)
387 { 387 {
@@ -390,9 +390,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
390 } 390 }
391 break; 391 break;
392 case 'D': // cursor left N 392 case 'D': // cursor left N
393 DBG("cursor left N");
394 arg = _csi_arg_get(&b); 393 arg = _csi_arg_get(&b);
395 if (arg < 1) arg = 1; 394 if (arg < 1) arg = 1;
395 DBG("cursor left %d", arg);
396 ty->state.wrapnext = 0; 396 ty->state.wrapnext = 0;
397 for (i = 0; i < arg; i++) 397 for (i = 0; i < arg; i++)
398 { 398 {
@@ -402,9 +402,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
402 break; 402 break;
403 case 'C': // cursor right N 403 case 'C': // cursor right N
404 case 'a': // cursor right N 404 case 'a': // cursor right N
405 DBG("cursor right N");
406 arg = _csi_arg_get(&b); 405 arg = _csi_arg_get(&b);
407 if (arg < 1) arg = 1; 406 if (arg < 1) arg = 1;
407 DBG("cursor right %d", arg);
408 ty->state.wrapnext = 0; 408 ty->state.wrapnext = 0;
409 for (i = 0; i < arg; i++) 409 for (i = 0; i < arg; i++)
410 { 410 {
@@ -443,27 +443,27 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
443 ty->state.cy += ty->state.margin_top; 443 ty->state.cy += ty->state.margin_top;
444 break; 444 break;
445 case 'G': // to column N 445 case 'G': // to column N
446 DBG("to column N");
447 arg = _csi_arg_get(&b); 446 arg = _csi_arg_get(&b);
448 if (arg < 1) arg = 1; 447 if (arg < 1) arg = 1;
448 DBG("to column %d", arg);
449 ty->state.wrapnext = 0; 449 ty->state.wrapnext = 0;
450 ty->state.cx = arg - 1; 450 ty->state.cx = arg - 1;
451 if (ty->state.cx < 0) ty->state.cx = 0; 451 if (ty->state.cx < 0) ty->state.cx = 0;
452 else if (ty->state.cx >= ty->w) ty->state.cx = ty->w - 1; 452 else if (ty->state.cx >= ty->w) ty->state.cx = ty->w - 1;
453 break; 453 break;
454 case 'd': // to row N 454 case 'd': // to row N
455 DBG("to row N");
456 arg = _csi_arg_get(&b); 455 arg = _csi_arg_get(&b);
457 if (arg < 1) arg = 1; 456 if (arg < 1) arg = 1;
457 DBG("to row %d", arg);
458 ty->state.wrapnext = 0; 458 ty->state.wrapnext = 0;
459 ty->state.cy = arg - 1; 459 ty->state.cy = arg - 1;
460 if (ty->state.cy < 0) ty->state.cy = 0; 460 if (ty->state.cy < 0) ty->state.cy = 0;
461 else if (ty->state.cy >= ty->h) ty->state.cy = ty->h - 1; 461 else if (ty->state.cy >= ty->h) ty->state.cy = ty->h - 1;
462 break; 462 break;
463 case 'E': // down relative N rows, and to col 0 463 case 'E': // down relative N rows, and to col 0
464 DBG("down relative N rows, and to col 0");
465 arg = _csi_arg_get(&b); 464 arg = _csi_arg_get(&b);
466 if (arg < 1) arg = 1; 465 if (arg < 1) arg = 1;
466 DBG("down relative %d rows, and to col 0", arg);
467 ty->state.wrapnext = 0; 467 ty->state.wrapnext = 0;
468 ty->state.cy += arg; 468 ty->state.cy += arg;
469 if (ty->state.cy < 0) ty->state.cy = 0; 469 if (ty->state.cy < 0) ty->state.cy = 0;
@@ -471,9 +471,9 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
471 ty->state.cx = 0; 471 ty->state.cx = 0;
472 break; 472 break;
473 case 'F': // up relative N rows, and to col 0 473 case 'F': // up relative N rows, and to col 0
474 DBG("up relative N rows, and to col 0");
475 arg = _csi_arg_get(&b); 474 arg = _csi_arg_get(&b);
476 if (arg < 1) arg = 1; 475 if (arg < 1) arg = 1;
476 DBG("up relative %d rows, and to col 0", arg);
477 ty->state.wrapnext = 0; 477 ty->state.wrapnext = 0;
478 ty->state.cy -= arg; 478 ty->state.cy -= arg;
479 if (ty->state.cy < 0) ty->state.cy = 0; 479 if (ty->state.cy < 0) ty->state.cy = 0;
@@ -481,27 +481,28 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
481 ty->state.cx = 0; 481 ty->state.cx = 0;
482 break; 482 break;
483 case 'X': // erase N chars 483 case 'X': // erase N chars
484 DBG("erase N chars");
485 arg = _csi_arg_get(&b); 484 arg = _csi_arg_get(&b);
486 if (arg < 1) arg = 1; 485 if (arg < 1) arg = 1;
486 DBG("erase %d chars", arg);
487 _termpty_clear_line(ty, TERMPTY_CLR_END, arg); 487 _termpty_clear_line(ty, TERMPTY_CLR_END, arg);
488 break; 488 break;
489 case 'S': // scroll up N lines 489 case 'S': // scroll up N lines
490 DBG("scroll up N lines");
491 arg = _csi_arg_get(&b); 490 arg = _csi_arg_get(&b);
492 if (arg < 1) arg = 1; 491 if (arg < 1) arg = 1;
492 DBG("scroll up %d lines", arg);
493 for (i = 0; i < arg; i++) _termpty_text_scroll(ty, EINA_TRUE); 493 for (i = 0; i < arg; i++) _termpty_text_scroll(ty, EINA_TRUE);
494 break; 494 break;
495 case 'T': // scroll down N lines 495 case 'T': // scroll down N lines
496 DBG("scroll down N lines");
497 arg = _csi_arg_get(&b); 496 arg = _csi_arg_get(&b);
498 if (arg < 1) arg = 1; 497 if (arg < 1) arg = 1;
498 DBG("scroll down %d lines", arg);
499 for (i = 0; i < arg; i++) _termpty_text_scroll_rev(ty, EINA_TRUE); 499 for (i = 0; i < arg; i++) _termpty_text_scroll_rev(ty, EINA_TRUE);
500 break; 500 break;
501 case 'M': // delete N lines - cy 501 case 'M': // delete N lines - cy
502 case 'L': // insert N lines - cy 502 case 'L': // insert N lines - cy
503 DBG("delete/insert N lines");
504 arg = _csi_arg_get(&b); 503 arg = _csi_arg_get(&b);
504 if (arg < 1) arg = 1;
505 DBG("delete/insert %d lines", arg);
505 { 506 {
506 int sy1, sy2; 507 int sy1, sy2;
507 508
@@ -518,7 +519,6 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
518 if (ty->state.scroll_y2 <= ty->state.scroll_y1) 519 if (ty->state.scroll_y2 <= ty->state.scroll_y1)
519 ty->state.scroll_y2 = ty->state.scroll_y1 + 1; 520 ty->state.scroll_y2 = ty->state.scroll_y1 + 1;
520 } 521 }
521 if (arg < 1) arg = 1;
522 for (i = 0; i < arg; i++) 522 for (i = 0; i < arg; i++)
523 { 523 {
524 if (*cc == 'M') _termpty_text_scroll(ty, EINA_TRUE); 524 if (*cc == 'M') _termpty_text_scroll(ty, EINA_TRUE);
@@ -529,13 +529,13 @@ _handle_esc_csi(Termpty *ty, const Eina_Unicode *c, Eina_Unicode *ce)
529 } 529 }
530 break; 530 break;
531 case 'P': // erase and scrollback N chars 531 case 'P': // erase and scrollback N chars
532 DBG("erase and scrollback N chars");
533 arg = _csi_arg_get(&b); 532 arg = _csi_arg_get(&b);
533 if (arg < 1) arg = 1;
534 DBG("erase and scrollback %d chars", arg);
534 { 535 {
535 Termcell *cells; 536 Termcell *cells;
536 int x, lim; 537 int x, lim;
537 538
538 if (arg < 1) arg = 1;
539 cells = &(TERMPTY_SCREEN(ty, 0, ty->state.cy)); 539 cells = &(TERMPTY_SCREEN(ty, 0, ty->state.cy));
540 lim = ty->w - arg; 540 lim = ty->w - arg;
541 for (x = ty->state.cx; x < (ty->w); x++) 541 for (x = ty->state.cx; x < (ty->w); x++)