mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-02-10 04:27:45 -05:00
terminal: add OSC-8 state tracking to the VT sub-struct
This commit is contained in:
parent
fd87bca102
commit
841e5f0e50
2 changed files with 18 additions and 2 deletions
|
|
@ -1102,6 +1102,9 @@ term_init(const struct config *conf, struct fdm *fdm, struct reaper *reaper,
|
|||
.blink = {.fd = -1},
|
||||
.vt = {
|
||||
.state = 0, /* STATE_GROUND */
|
||||
.osc8 = {
|
||||
.begin = {-1, -1},
|
||||
},
|
||||
},
|
||||
.colors = {
|
||||
.fg = conf->colors.fg,
|
||||
|
|
@ -1645,6 +1648,9 @@ term_reset(struct terminal *term, bool hard)
|
|||
free(term->vt.osc.data);
|
||||
memset(&term->vt, 0, sizeof(term->vt));
|
||||
term->vt.state = 0; /* GROUND */
|
||||
term->vt.osc8.begin = (struct coord){-1, -1};
|
||||
free(term->vt.osc8.uri);
|
||||
term->vt.osc8.uri = NULL;
|
||||
|
||||
if (term->grid == &term->alt) {
|
||||
term->grid = &term->normal;
|
||||
|
|
|
|||
14
terminal.h
14
terminal.h
|
|
@ -155,12 +155,24 @@ struct vt {
|
|||
struct vt_param v[16];
|
||||
uint8_t idx;
|
||||
} params;
|
||||
|
||||
uint32_t private; /* LSB=priv0, MSB=priv3 */
|
||||
|
||||
struct attributes attrs;
|
||||
struct attributes saved_attrs;
|
||||
|
||||
struct {
|
||||
uint8_t *data;
|
||||
size_t size;
|
||||
size_t idx;
|
||||
} osc;
|
||||
|
||||
/* Start coordinate for current OSC-8 URI */
|
||||
struct {
|
||||
struct coord begin;
|
||||
char *uri;
|
||||
} osc8;
|
||||
|
||||
struct {
|
||||
uint8_t *data;
|
||||
size_t size;
|
||||
|
|
@ -168,8 +180,6 @@ struct vt {
|
|||
void (*put_handler)(struct terminal *term, uint8_t c);
|
||||
void (*unhook_handler)(struct terminal *term);
|
||||
} dcs;
|
||||
struct attributes attrs;
|
||||
struct attributes saved_attrs;
|
||||
};
|
||||
|
||||
enum cursor_origin { ORIGIN_ABSOLUTE, ORIGIN_RELATIVE };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue