version 1.21, 2009/10/26 21:42:04 |
version 1.22, 2009/11/04 22:43:11 |
|
|
struct input_ctx *ictx = &wp->ictx; |
struct input_ctx *ictx = &wp->ictx; |
u_char ch; |
u_char ch; |
|
|
if (BUFFER_USED(wp->in) == ictx->was) |
if (EVBUFFER_LENGTH(wp->event->input) == ictx->was) |
return; |
return; |
wp->window->flags |= WINDOW_ACTIVITY; |
wp->window->flags |= WINDOW_ACTIVITY; |
|
|
ictx->buf = BUFFER_OUT(wp->in); |
ictx->buf = EVBUFFER_DATA(wp->event->input); |
ictx->len = BUFFER_USED(wp->in); |
ictx->len = EVBUFFER_LENGTH(wp->event->input); |
ictx->off = 0; |
ictx->off = 0; |
|
|
ictx->wp = wp; |
ictx->wp = wp; |
|
|
|
|
screen_write_stop(&ictx->ctx); |
screen_write_stop(&ictx->ctx); |
|
|
buffer_remove(wp->in, ictx->len); |
evbuffer_drain(wp->event->input, ictx->len); |
ictx->was = BUFFER_USED(wp->in); |
ictx->was = EVBUFFER_LENGTH(wp->event->input); |
} |
} |
|
|
void |
void |
|
|
void |
void |
input_handle_sequence_da(struct input_ctx *ictx) |
input_handle_sequence_da(struct input_ctx *ictx) |
{ |
{ |
uint16_t n; |
struct window_pane *wp = ictx->wp; |
|
uint16_t n; |
|
|
if (ictx->private != '\0') |
if (ictx->private != '\0') |
return; |
return; |
|
|
if (n != 0) |
if (n != 0) |
return; |
return; |
|
|
buffer_write(ictx->wp->out, "\033[?1;2c", (sizeof "\033[?1;2c") - 1); |
bufferevent_write(wp->event, "\033[?1;2c", (sizeof "\033[?1;2c") - 1); |
} |
} |
|
|
void |
void |
|
|
void |
void |
input_handle_sequence_dsr(struct input_ctx *ictx) |
input_handle_sequence_dsr(struct input_ctx *ictx) |
{ |
{ |
struct screen *s = ictx->ctx.s; |
struct window_pane *wp = ictx->wp; |
uint16_t n; |
struct screen *s = ictx->ctx.s; |
char reply[32]; |
uint16_t n; |
|
char reply[32]; |
|
|
if (ARRAY_LENGTH(&ictx->args) > 1) |
if (ARRAY_LENGTH(&ictx->args) > 1) |
return; |
return; |
|
|
xsnprintf(reply, sizeof reply, |
xsnprintf(reply, sizeof reply, |
"\033[%u;%uR", s->cy + 1, s->cx + 1); |
"\033[%u;%uR", s->cy + 1, s->cx + 1); |
log_debug("cursor request, reply: %s", reply); |
log_debug("cursor request, reply: %s", reply); |
buffer_write(ictx->wp->out, reply, strlen(reply)); |
bufferevent_write(wp->event, reply, strlen(reply)); |
break; |
break; |
} |
} |
} |
} |