-
Notifications
You must be signed in to change notification settings - Fork 91
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
File hyperlinks are broken in the R Console on Windows #2413
Comments
This comment was marked as off-topic.
This comment was marked as off-topic.
In my examples so far, the positron/src/vs/workbench/contrib/positronConsole/browser/components/outputRun.tsx Line 54 in f4765df
And, sometimes, but not always, there is also a problem with the (some of) the path separators, being A crude fixup along those lines does make the links work again, although I doubt that is the correct long-term solution.
The
which works once fixed up to:
|
This is how the file link looks on Windows currently:
This looks correct to me, This works on RStudio and also in other tools, e.g. Windows Terminal. Having three slashes before the drive letter, i.e. WRT backward slashes, yes, they need to be converted to forward slashes. This could be done by Positron, or by cli. I am not sure why cli is not doing it, I know I had resrvations about |
@gaborcsardi and I discussed this, so I'll give an update. Here's the TL;DR as I see it:
Basically, we'll work the problem from both sides. More context: any change to cli has to also be done in a way that doesn't break existing functionality in RStudio, which expects the links currently produced by cli. cli will start normalizing path separators to be cli has, today, an environment variable
We're going to expand on
|
Recoding some of my research here, so I can close these tabs! RFC 8089 The "file" URI Scheme: Excerpt from Appendix B. Example URIs: The syntax in Section 2 is intended to support file URIs that take Local files: o A traditional file URI for a local file with an empty authority.
Excerpt from Appendix E.2 DOS and Windows Drive Letters: URIs of the form Excerpt from Appendix E.4 Backslash as Separator: Historically, some usages have copied entire file paths into the path It may be possible to translate or update such an invalid file URI by |
In case it's relevant... in Edge and Chrome, if you try to navigate to a file like:
it will automatically "repair" the URI for you, e.g. you instead get:
with three leading slashes, and backslashes translated into forward slashes. So there's already some existing precedence for this sort of file URI repair. |
Verified with 2024.03.0-1061 I tried several different style and all the links seem to be working. |
Here I have clicked on the file-hyperlink contained in this line:
Interestingly, copy and paste actually yields the link:
leading to this error (also seen in screenshot):
I have seen this (and actually discovered it) with several other file links (and emanating from other packages, such as testthat), so it's not specific to this file or to usethis.
The text was updated successfully, but these errors were encountered: