> They either use BEL (Control+G) or the ST string terminator C1
> control (U+009C), or more commonly, a 7-bit version of the string
> terminator, ESC \.  (I expect because U+009C requires a multibyte
> character sequence in UTF-8.)

I have deliberately omitted C1 (8-bit variant) from this discussion.

For OSC, "ls" already uses the C0 (7-bit) version.

Xterm refuses to support C1 in UTF-8, for reasons explained at the
beginning of https://invisible-island.net/xterm/ctlseqs/ctlseqs.txt.
(Not that I fully agree with that; I don't think reparsing would be
needed, just do the charset decoding first and then look for escape
sequences.)

VTE added C1 support in 2014 (i.e. 12 years into VTE's existence), due
to 1 person needing it for a legacy in-house app
(https://bugs.launchpad.net/ubuntu/+source/vte3/+bug/1297051 comment
29).

Out of the terminals I've tested, the majority of them doesn't support
the C1 variant of OSC 8 hyperlinks.

Even if C1 was universally supported, C0 would be the safe bet in case
the locale is misconfigured.

The C1 variants (0x80 .. 0x9F, or U+0080 .. U+009F) are practically
dead.  Just go with the C0 variants (7-bit clean ESC + followup byte)
and never look back.


e.

On Wed, Jan 21, 2026 at 7:09 AM G. Branden Robinson
<[email protected]> wrote:
>
> Hi Collin,
>
> At 2026-01-20T20:06:26-0800, Collin Funk wrote:
> > Taking a look at the other GNU programs that implement hyperlinks for
> > terminals [1]:
> >
> > * Emacs accepts both (see lisp/ansi-osc.el).
> > * Groff emits \e.
>
> I don't understand this claim.
>
> The context here would appear to be what a program uses to terminate an
> OSC 8 sequence.  As far as I know, nobody terminates one just with `\e`
> (ESC).  They either use BEL (Control+G) or the ST string terminator C1
> control (U+009C), or more commonly, a 7-bit version of the string
> terminator, ESC \.  (I expect because U+009C requires a multibyte
> character sequence in UTF-8.)
>
> https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/src/devices/grotty/tty.cpp?h=1.24.0.rc1#n93
> https://cgit.git.savannah.gnu.org/cgit/groff.git/tree/src/devices/grotty/tty.cpp?h=1.24.0.rc1#n473
>
> Did you mean to write either "\e\" or "\e\\"?
>
> Here's what grotty, the program that renders GNU troff output for a
> terminal device, does.
>
> Regards,
> Branden

Reply via email to