コード例 #1
0
ファイル: screen.c プロジェクト: rasilon/vim
void vterm_screen_reset(VTermScreen *screen, int hard)
{
  screen->damaged.start_row = -1;
  screen->pending_scrollrect.start_row = -1;
  vterm_state_reset(screen->state, hard);
  vterm_screen_flush_damage(screen);
}
コード例 #2
0
ファイル: main.c プロジェクト: WareX97/aPlus
int init(void) {
    context_t* cx = kcalloc(1, sizeof(context_t), GFP_KERNEL);
    if(unlikely(!cx)) {
        errno = ENOMEM;
        return -1;
    }


    cx->vmode = KD_TEXT;

    if(fb_init(cx) != 0)
        return -1;

    
    cx->vt = vterm_new_with_allocator(cx->console.rows, cx->console.cols, &mm, NULL);
    cx->vs = vterm_obtain_screen(cx->vt);
    cx->vc = vterm_obtain_state(cx->vt);

    //vterm_set_utf8(cx->vt, 1);
    vterm_screen_set_callbacks(cx->vs, &cbs, cx);
    vterm_screen_reset(cx->vs, 0);
    vterm_state_reset(cx->vc, 0);


    VTermRect r = {
        .start_row = 0,
        .start_col = 0,
        .end_row = cx->console.rows,
        .end_col = cx->console.cols
    };

    console_cbs_damage(r, cx);
    vterm_input_write(cx->vt, "\e[20h", 5);


    inode_t* ino = vfs_mkdev("console", -1, S_IFCHR | 0222);
    ino->ioctl = console_ioctl;
    ino->write = console_write;
    ino->userdata = cx;

    return 0;
}

int dnit(void) {
    return 0;
}