diff options
author | Lennart Poettering <lennart@poettering.net> | 2024-10-31 10:10:37 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2024-10-31 11:38:18 +0100 |
commit | de0ebee637636400a73b0d966f18a8826796f87d (patch) | |
tree | 5f0d7e45a7b9fd165b82fa3768b465c4c733c21d /src | |
parent | tree-wide: prefer generating 0x1B 0x5C as ANSI sequence "ST" (diff) | |
download | systemd-de0ebee637636400a73b0d966f18a8826796f87d.tar.xz systemd-de0ebee637636400a73b0d966f18a8826796f87d.zip |
ptyfwd: document why we only honour two of the three kinds of ST
Diffstat (limited to 'src')
-rw-r--r-- | src/shared/ptyfwd.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c index 11701f6768..34b24837ef 100644 --- a/src/shared/ptyfwd.c +++ b/src/shared/ptyfwd.c @@ -507,11 +507,16 @@ static int pty_forward_ansi_process(PTYForward *f, size_t offset) { } else { /* Otherwise, the OSC sequence is over * - * There are two allowed ways to end an OSC sequence: - * BEL '\x07' - * String Terminator (ST): <Esc>\ - "\x1b\x5c" - * since we cannot lookahead to see if the Esc is followed by a \ - * we cut a corner here and assume it will be \. */ + * There are three documented ways to end an OSC sequence: + * 1. BEL aka ^G aka \x07 + * 2. \x9c + * 3. \x1b\x5c + * since we cannot look ahead to see if the Esc is followed by a "\" + * we cut a corner here and assume it will be "\"e. + * + * Note that we do not support \x9c here, because that's also a valid UTF8 + * codepoint, and that would create ambiguity. Various terminal emulators + * similar do not support it. */ if (IN_SET(c, '\x07', '\x1b')) { r = insert_window_title_fix(f, i+1); |