public String format(List<String> args) {
        // https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h3-Operating-System-Commands
        // XTerm accepts either BEL  or ST  for terminating OSC
        // sequences, and when returning information, uses the same
        // terminator used in a query.
        return Ascii.ESC_CHAR + "]" + String.join(String.valueOf(ARG_SEPARATOR), args) +
                StringsKt.takeLast(text, terminatorLength(text));
    }
@Test
    public void formatUsingSameTerminator() {
        var seq1 = create("2;Test 1" + BEL_CHAR);
        assertEquals(ESC_CHAR + "]foo" + BEL_CHAR, seq1.format(List.of("foo")));
        var seq2 = create("2;Test 1" + TWO_BYTES_TERMINATOR);
        assertEquals(ESC_CHAR + "]bar;baz" + TWO_BYTES_TERMINATOR, seq2.format(List.of("bar", "baz")));
    }