From af6a37b1c4509c7766933a7cb45d2ee9a3a23f98 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Thu, 15 Oct 2026 11:37:31 +0300 Subject: Return owned text and share cell attribute flags with snapshots Make text queries return allocated strings released with term_text_free, keeping each capture atomic. Align public attributes with the write core, remove snapshot conversion tables, and migrate tests and the Kitty adapter. --- tests/osc_test.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'tests/osc_test.c') diff --git a/tests/osc_test.c b/tests/osc_test.c index 91b51d6..41a9247 100644 --- a/tests/osc_test.c +++ b/tests/osc_test.c @@ -259,11 +259,13 @@ static void test_osc8(void) term_free(t); } -static bool text_is(size_t (*get)(const struct term *, char *, size_t), +static bool text_is(char *(*get)(const struct term *), const struct term *t, const char *want) { - char buf[256]; - return get(t, buf, sizeof(buf)) == strlen(want) && !strcmp(buf, want); + char *text = get(t); + bool same = text && !strcmp(text, want); + term_text_free(text); + return same; } static void test_osc_misc(void) @@ -304,7 +306,7 @@ static void test_osc_misc(void) write_seq(t, "\033]22;text\007"); assert(text_is(term_pointer_shape, t, "text")); write_seq(t, "\033]22;\033\\"); - assert(!term_pointer_shape(t, NULL, 0)); + assert(!term_pointer_shape(t)); term_free(t); } -- cgit v1.2.3