mirror of
https://github.com/NixOS/nix
synced 2025-07-06 00:51:47 +02:00
Filter OSC 8 correctly
This allows Nix to use lowdown 1.2.0 which outputs OSC-8 links.
This commit is contained in:
parent
14edb78d53
commit
1301f8434d
2 changed files with 12 additions and 0 deletions
|
@ -45,6 +45,13 @@ std::string filterANSIEscapes(std::string_view s, bool filterAll, unsigned int w
|
|||
while (i != s.end() && *i >= 0x20 && *i <= 0x2f) e += *i++;
|
||||
// eat final byte
|
||||
if (i != s.end() && *i >= 0x40 && *i <= 0x7e) e += last = *i++;
|
||||
} else if (i != s.end() && *i == ']') {
|
||||
// OSC
|
||||
e += *i++;
|
||||
// eat ESC
|
||||
while (i != s.end() && *i != '\e') e += *i++;
|
||||
// eat backslash
|
||||
if (i != s.end() && *i == '\\') e += last = *i++;
|
||||
} else {
|
||||
if (i != s.end() && *i >= 0x40 && *i <= 0x5f) e += *i++;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue