version 1.126, 2017/06/09 09:21:24 |
version 1.127, 2017/08/29 09:28:45 |
|
|
struct utf8_data utf8data; |
struct utf8_data utf8data; |
|
|
int ch; |
int ch; |
|
int last; |
|
|
int flags; |
int flags; |
#define INPUT_DISCARD 0x1 |
#define INPUT_DISCARD 0x1 |
|
|
INPUT_CSI_ICH, |
INPUT_CSI_ICH, |
INPUT_CSI_IL, |
INPUT_CSI_IL, |
INPUT_CSI_RCP, |
INPUT_CSI_RCP, |
|
INPUT_CSI_REP, |
INPUT_CSI_RM, |
INPUT_CSI_RM, |
INPUT_CSI_RM_PRIVATE, |
INPUT_CSI_RM_PRIVATE, |
INPUT_CSI_SCP, |
INPUT_CSI_SCP, |
|
|
{ 'S', "", INPUT_CSI_SU }, |
{ 'S', "", INPUT_CSI_SU }, |
{ 'X', "", INPUT_CSI_ECH }, |
{ 'X', "", INPUT_CSI_ECH }, |
{ 'Z', "", INPUT_CSI_CBT }, |
{ 'Z', "", INPUT_CSI_CBT }, |
|
{ 'b', "", INPUT_CSI_REP }, |
{ 'c', "", INPUT_CSI_DA }, |
{ 'c', "", INPUT_CSI_DA }, |
{ 'c', ">", INPUT_CSI_DA_TWO }, |
{ 'c', ">", INPUT_CSI_DA_TWO }, |
{ 'd', "", INPUT_CSI_VPA }, |
{ 'd', "", INPUT_CSI_VPA }, |
|
|
|
|
input_clear(ictx); |
input_clear(ictx); |
|
|
|
ictx->last = -1; |
|
|
ictx->state = &input_state_ground; |
ictx->state = &input_state_ground; |
ictx->flags = 0; |
ictx->flags = 0; |
} |
} |
|
|
|
|
utf8_set(&ictx->cell.cell.data, ictx->ch); |
utf8_set(&ictx->cell.cell.data, ictx->ch); |
screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); |
screen_write_collect_add(&ictx->ctx, &ictx->cell.cell); |
|
ictx->last = ictx->ch; |
|
|
ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; |
ictx->cell.cell.attr &= ~GRID_ATTR_CHARSET; |
|
|
|
|
break; |
break; |
} |
} |
|
|
|
ictx->last = -1; |
return (0); |
return (0); |
} |
} |
|
|
|
|
break; |
break; |
} |
} |
|
|
|
ictx->last = -1; |
return (0); |
return (0); |
} |
} |
|
|
|
|
struct screen_write_ctx *sctx = &ictx->ctx; |
struct screen_write_ctx *sctx = &ictx->ctx; |
struct screen *s = sctx->s; |
struct screen *s = sctx->s; |
struct input_table_entry *entry; |
struct input_table_entry *entry; |
int n, m; |
int i, n, m; |
u_int cx; |
u_int cx; |
|
|
if (ictx->flags & INPUT_DISCARD) |
if (ictx->flags & INPUT_DISCARD) |
|
|
screen_write_insertline(sctx, input_get(ictx, 0, 1, 1), |
screen_write_insertline(sctx, input_get(ictx, 0, 1, 1), |
ictx->cell.cell.bg); |
ictx->cell.cell.bg); |
break; |
break; |
|
case INPUT_CSI_REP: |
|
if (ictx->last == -1) |
|
break; |
|
ictx->ch = ictx->last; |
|
|
|
n = input_get(ictx, 0, 1, 1); |
|
for (i = 0; i < n; i++) |
|
input_print(ictx); |
|
break; |
case INPUT_CSI_RCP: |
case INPUT_CSI_RCP: |
memcpy(&ictx->cell, &ictx->old_cell, sizeof ictx->cell); |
memcpy(&ictx->cell, &ictx->old_cell, sizeof ictx->cell); |
screen_write_cursormove(sctx, ictx->old_cx, ictx->old_cy); |
screen_write_cursormove(sctx, ictx->old_cx, ictx->old_cy); |
|
|
break; |
break; |
} |
} |
|
|
|
ictx->last = -1; |
return (0); |
return (0); |
} |
} |
|
|
|
|
|
|
input_clear(ictx); |
input_clear(ictx); |
input_start_timer(ictx); |
input_start_timer(ictx); |
|
ictx->last = -1; |
} |
} |
|
|
/* DCS terminator (ST) received. */ |
/* DCS terminator (ST) received. */ |
|
|
|
|
input_clear(ictx); |
input_clear(ictx); |
input_start_timer(ictx); |
input_start_timer(ictx); |
|
ictx->last = -1; |
} |
} |
|
|
/* OSC terminator (ST) received. */ |
/* OSC terminator (ST) received. */ |
|
|
|
|
input_clear(ictx); |
input_clear(ictx); |
input_start_timer(ictx); |
input_start_timer(ictx); |
|
ictx->last = -1; |
} |
} |
|
|
/* APC terminator (ST) received. */ |
/* APC terminator (ST) received. */ |
|
|
|
|
input_clear(ictx); |
input_clear(ictx); |
input_start_timer(ictx); |
input_start_timer(ictx); |
|
ictx->last = -1; |
} |
} |
|
|
/* Rename terminator (ST) received. */ |
/* Rename terminator (ST) received. */ |
|
|
fatalx("UTF-8 open invalid %#x", ictx->ch); |
fatalx("UTF-8 open invalid %#x", ictx->ch); |
|
|
log_debug("%s %hhu", __func__, ud->size); |
log_debug("%s %hhu", __func__, ud->size); |
|
ictx->last = -1; |
|
|
return (0); |
return (0); |
} |
} |