mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-06 04:06:06 -05:00
csi: prepare for alternative cursor styles
This commit is contained in:
parent
428b31f071
commit
10be7c37ba
2 changed files with 19 additions and 12 deletions
29
csi.c
29
csi.c
|
|
@ -929,22 +929,27 @@ csi_dispatch(struct terminal *term, uint8_t final)
|
|||
case 'q': {
|
||||
int param = vt_param_get(term, 0, 0);
|
||||
switch (param) {
|
||||
case 2: /* steady block */
|
||||
case 0: case 1: /* blinking block */
|
||||
case 2: /* steady block */
|
||||
term->cursor_style = CURSOR_BLOCK;
|
||||
break;
|
||||
|
||||
case 0:
|
||||
case 1: /* blinking block */
|
||||
case 3: /* blinking underline */
|
||||
case 4: /* steady underline */
|
||||
case 5: /* blinking bar */
|
||||
case 6: /* steady bar */
|
||||
LOG_WARN("unimplemented: cursor style: %s",
|
||||
param == 0 || param == 1 ? "blinking block" :
|
||||
param == 3 ? "blinking underline" :
|
||||
param == 4 ? "steady underline" :
|
||||
param == 5 ? "blinking bar" : "steady bar");
|
||||
case 3: /* blinking underline */
|
||||
case 4: /* steady underline */
|
||||
term->cursor_style = CURSOR_UNDERLINE;
|
||||
LOG_WARN("unimplemented: cursor style: underline");
|
||||
break;
|
||||
|
||||
case 5: /* blinking bar */
|
||||
case 6: /* steady bar */
|
||||
term->cursor_style = CURSOR_BAR;
|
||||
LOG_WARN("unimplemented: cursor style: bar");
|
||||
break;
|
||||
}
|
||||
|
||||
term->cursor_blinking = param == 0 || param & 1;
|
||||
if (term->cursor_blinking)
|
||||
LOG_WARN("unimplemented: blinking cursor");
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -291,6 +291,8 @@ struct terminal {
|
|||
struct coord cursor;
|
||||
struct coord saved_cursor;
|
||||
struct coord alt_saved_cursor;
|
||||
enum { CURSOR_BLOCK, CURSOR_UNDERLINE, CURSOR_BAR } cursor_style;
|
||||
bool cursor_blinking;
|
||||
|
||||
uint32_t input_serial;
|
||||
struct {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue