~russellmcc/libvterm/libvterm

« back to all changes in this revision

Viewing changes to t/harness.c

  • Committer: Russell McClellan
  • Date: 2022-08-21 14:40:02 UTC
  • Revision ID: russell.mcclellan@gmail.com-20220821144002-pxyrqw0gkcuzg1oa
Support for ED 3, clearing scrollback

Show diffs side-by-side

added added

removed removed

Lines of Context:
448
448
  return 1;
449
449
}
450
450
 
 
451
static int want_state_scrollback = 0;
 
452
static int state_sb_clear(void *user) {
 
453
  if(!want_state_scrollback)
 
454
    return 1;
 
455
 
 
456
  printf("sb_clear\n");
 
457
  return 0;
 
458
}
 
459
 
451
460
VTermStateCallbacks state_cbs = {
452
461
  .putglyph    = state_putglyph,
453
462
  .movecursor  = movecursor,
457
466
  .setpenattr  = state_setpenattr,
458
467
  .settermprop = settermprop,
459
468
  .setlineinfo = state_setlineinfo,
 
469
  .sb_clear    = state_sb_clear,
460
470
};
461
471
 
462
472
static int selection_set(VTermSelectionMask mask, VTermStringFragment frag, void *user)
566
576
  return 1;
567
577
}
568
578
 
 
579
static int screen_sb_clear(void *user)
 
580
{
 
581
  if(!want_screen_scrollback)
 
582
    return 1;
 
583
  
 
584
  printf("sb_clear\n");
 
585
  return 0;
 
586
}
 
587
 
569
588
VTermScreenCallbacks screen_cbs = {
570
589
  .damage      = screen_damage,
571
590
  .moverect    = moverect,
573
592
  .settermprop = settermprop,
574
593
  .sb_pushline = screen_sb_pushline,
575
594
  .sb_popline  = screen_sb_popline,
 
595
  .sb_clear    = screen_sb_clear,
576
596
};
577
597
 
578
598
int main(int argc, char **argv)
641
661
        case 'f':
642
662
          vterm_state_set_unrecognised_fallbacks(state, sense ? &fallbacks : NULL, NULL);
643
663
          break;
 
664
        case 'b':
 
665
          want_state_scrollback = sense;
 
666
          break;
644
667
        default:
645
668
          fprintf(stderr, "Unrecognised WANTSTATE flag '%c'\n", line[i]);
646
669
        }