luni_send(term->paste_buffer, term->paste_len, 0);
if (term->ldisc) luni_send(term->ldisc, term->paste_buffer, term->paste_len, 0);
void term_do_paste(Terminal *term){    wchar_t *data;    int len;    get_clip(&data, &len);    if (data && len > 0) {        wchar_t *p, *q;	term_seen_key_event(term);     /* pasted data counts */        if (term->paste_buffer)            sfree(term->paste_buffer);        term->paste_pos = term->paste_hold = term->paste_len = 0;        term->paste_buffer = smalloc(len * sizeof(wchar_t));        p = q = data;        while (p < data + len) {            while (p < data + len &&                   !(p <= data + len - sel_nl_sz &&                     !memcmp(p, sel_nl, sizeof(sel_nl))))                p++;            {                int i;                for (i = 0; i < p - q; i++) {                    term->paste_buffer[term->paste_len++] = q[i];                }            }            if (p <= data + len - sel_nl_sz &&                !memcmp(p, sel_nl, sizeof(sel_nl))) {                term->paste_buffer[term->paste_len++] = '\r';                p += sel_nl_sz;            }            q = p;        }        /* Assume a small paste will be OK in one go. */        if (term->paste_len < 256) {            luni_send(term->paste_buffer, term->paste_len, 0);            if (term->paste_buffer)                sfree(term->paste_buffer);            term->paste_buffer = 0;            term->paste_pos = term->paste_hold = term->paste_len = 0;        }    }    get_clip(NULL, NULL);}