summaryrefslogtreecommitdiff
path: root/tests/model.c
diff options
context:
space:
mode:
authorBerke Güzel <wenekar1@gmail.com>2026-10-15 12:38:43 +0300
committerBerke Güzel <wenekar1@gmail.com>2026-10-15 12:38:43 +0300
commitcaf7d446446a0af0b30886a6c4ee5851aab553e2 (patch)
tree28cb796f01711d8484bc6cb3daa8e551db18fe68 /tests/model.c
parent6cd9ab6f73994b68e8453c92a014d1a372af2a24 (diff)
parent7ed78a31debb0250bae16d8b4098a4689f29bb60 (diff)
Merge branch 'wt/host-name' into api-hardening
# Conflicts: # src/screen.c
Diffstat (limited to 'tests/model.c')
-rw-r--r--tests/model.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/model.c b/tests/model.c
index 6e368ba..d212acb 100644
--- a/tests/model.c
+++ b/tests/model.c
@@ -72,6 +72,7 @@ enum { GROUND, ESC, CSI, STR, STR_ESC, CHARSET, HASH, DOCS };
enum { OSC, DCS, IGNORE };
struct model {
+ char name[64]; /* XTVERSION reply */
int cols, rows, limit;
struct row **scr;
struct row **hist;
@@ -1625,7 +1626,7 @@ static void csi_dispatch(struct model *m, unsigned char final)
break;
case 'q':
if (m->prefix == '>' && !m->inter && (!m->nparam || !m->param[0])) {
- reply(m, "\033P>|wsap_term\033\\");
+ reply(m, "\033P>|%s\033\\", m->name);
} else if (!m->prefix && m->inter == ' ') {
int ps = m->nparam ? m->param[0] : 0;
if (ps == 0) {
@@ -1971,10 +1972,11 @@ static void feed_byte(struct model *m, unsigned char c)
/* ---- public ---- */
-struct model *model_new(struct term_vector2i size, int history)
+struct model *model_new(struct term_vector2i size, int history, const char *name)
{
struct model *m = calloc(1, sizeof(*m));
if (!m) abort();
+ snprintf(m->name, sizeof(m->name), "%s", name && *name ? name : "term");
m->cols = size.x < 1 ? 80 : size.x;
m->rows = size.y < 1 ? 24 : size.y;
m->limit = history_limit(history);