Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to match links ended with \u001B rather than \u0007. #56

Open
RedYetiDev opened this issue Jul 8, 2024 · 1 comment
Open

Unable to match links ended with \u001B rather than \u0007. #56

RedYetiDev opened this issue Jul 8, 2024 · 1 comment

Comments

@RedYetiDev
Copy link

RedYetiDev commented Jul 8, 2024

ansi-regex cannot match link regexes that end in \u0001B, as the regex only allows \u0007.

Example: \x1b]8;;http://example.com/\x1b\\This is a link\x1b]8;;\x1b\\ hello
Reference: nodejs/node#53697

@hildjj
Copy link

hildjj commented Aug 1, 2024

For anyone digging into this, "OSC" is an "Operating System Command". One reference I've found is from Microsoft, which claims:

As OSC sequences, they are ended with a String Terminator represented as and
transmitted with ESC \ (0x1B 0x5C). BEL (0x7) may be used instead as the terminator,
but the longer form is preferred.

So the bug should probably read "cannot match link regexes that end in \u0001B\u005c".

I've verified that iTerm2 at least does accept the sample string, so this isn't just a Microsoft thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants