ink icon indicating copy to clipboard operation
ink copied to clipboard

Ignore OSC ansi sequences when calculating line length

Open isaacs opened this issue 1 year ago • 2 comments

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.

isaacs avatar Oct 10 '23 21:10 isaacs

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

vadimdemedes avatar Nov 11 '23 18:11 vadimdemedes

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

cakoose avatar Dec 03 '23 21:12 cakoose