ITADN

fix: rm terminalLink.isSupported checks

#765Pull Requestmmkal 创建于 2025-03-31
M
mmkalcommented
They're not needed - the terminal-link package checks this internally and formats the URL using parentheses and zero-width spaces. As it is the logic is dropping the URL in terminals like VSCode's/Cursor's terminal. <img width="470" alt="image" src="https://github.com/user-attachments/assets/63c168ff-ea4a-415f-8cf0-0bd2eedfebbb" /> Can't rely on terminal-link as-is, though, because of https://github.com/sindresorhus/terminal-link/issues/18 I set the fallback to be `${text} ( ${url} )` (i.e. using regular spaces instead of zero-width, because many UIs include the trailing zero-width space which breaks the URL clickability/copyability - see the long list of references on that issue, from redwood, shopify cli, warp etc. etc.) <img width="1000" alt="image" src="https://github.com/user-attachments/assets/f4237e28-9da6-4dba-9adf-0c00d7d50c8d" /> I'm not familiar with terminal-link and unilaterally changing zero-width space to regular space could be a significant UI change, so I figured it's safer to sacrifice aesthetics for functionality just in the case of `np`. <!-- Thanks for submitting a pull request 🙌 **Note:** Please don't create a pull request which has significant changes (i.e. adds new functionality or modifies existing one in a non-trivial way) without creating an issue first. Try to limit the scope of your pull request and provide a general description of the changes. If this fixes an open issue, link to it in the following way: `Fixes #321`. New features and bug fixes should come with tests. -->
合并状态:未合并 2 条评论