Skip to content
New issue

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

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

Already on GitHub? # to your account

Ignore OSC ansi sequences when calculating line length #633

Open
isaacs opened this issue Oct 10, 2023 · 2 comments
Open

Ignore OSC ansi sequences when calculating line length #633

isaacs opened this issue Oct 10, 2023 · 2 comments

Comments

@isaacs
Copy link
Contributor

isaacs commented Oct 10, 2023

I thought to add hyperlinks to stack trace reporting in node-tap but the OSC ansi sequence makes ink think that it's a very long line, and wrap inappropriately, even though there are no visible characters printed.

Proposal: when calculating line length, ignore any strings matching /\x1b].*?\x1b\\/. This will prevent ink from including title setting sequences or hyperlinks in the length calculation.

@vadimdemedes
Copy link
Owner

Makes sense. I'd welcome a PR for this.

@vadimdemedes vadimdemedes changed the title ignore OSC ansi sequences when calculating line length Ignore OSC ansi sequences when calculating line length Nov 11, 2023
@cakoose
Copy link

cakoose commented Dec 3, 2023

@isaacs: Would your problem be solved if you used ink-link to render the hyperlink?

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

3 participants