You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In RStudio file: URLs open within RStudio. If you click on a file link outside of RStudio, typically the operating system is consulted for the application to open it.
It might be interesting to have markup that produces the more common behaviour for a file hyperlink, i.e. to delegate opening to the OS.
In terms of mindset, then it becomes clear that .file is for file hyperlinks that you want to open "in this product", where the product might be RStudio or Positron (or VS Code). So probably a plain text file (maybe an image?). And .open (or some other designation) is for files where the OS should be consulted re: how to open. Like an Excel workbook or a Word document.
Context: In terminals in Positron/VS Code, file: hyperlinks are delegated to the OS and there's basically no way to intervene in that. (In the Positron R console, we can intervene and create behaviour similar to RStudio.) So in Positron/VS Code terminals, file hyperlinks that should open "in this product" have to be produced using a special URL scheme, e.g. vscode://file/{full path to file} or positron://file/{full path to file}.
This issue is related to a side point made in #601.
In hindsight, maybe it would have been good to introduce a scheme like rstudio://file{full path to file}, but I imagine that ship has sailed and it wouldn't make sense to reopen it.
Other interesting features supported by the vscode: and positron: scheme: can also be used to open a workspace (folder) or to go directly to the configuration for a setting.
The text was updated successfully, but these errors were encountered:
I tend to think the person writing the code (vs the person running the code) is in the best position to know which behaviour is desired:
Open with whatever the OS thinks is "best" = typical behaviour for file:// links, though not in RStudio (or Positron's R console, which is emulating RStudio)
Open with "the current product" = typical behaviour for product:// links, where the construction of said links might come from using an auto-detected template or user opt-in
Because it really comes down to how likely it is that the file is plain text versus something else.
https://cli.r-lib.org/reference/links.html#default-handler
It might be interesting to have markup that produces the more common behaviour for a file hyperlink, i.e. to delegate opening to the OS.
In terms of mindset, then it becomes clear that
.file
is for file hyperlinks that you want to open "in this product", where the product might be RStudio or Positron (or VS Code). So probably a plain text file (maybe an image?). And.open
(or some other designation) is for files where the OS should be consulted re: how to open. Like an Excel workbook or a Word document.Context: In terminals in Positron/VS Code,
file:
hyperlinks are delegated to the OS and there's basically no way to intervene in that. (In the Positron R console, we can intervene and create behaviour similar to RStudio.) So in Positron/VS Code terminals, file hyperlinks that should open "in this product" have to be produced using a special URL scheme, e.g.vscode://file/{full path to file}
orpositron://file/{full path to file}
.https://code.visualstudio.com/docs/editor/command-line#_opening-vs-code-with-urls
This issue is related to a side point made in #601.
In hindsight, maybe it would have been good to introduce a scheme like
rstudio://file{full path to file}
, but I imagine that ship has sailed and it wouldn't make sense to reopen it.Other interesting features supported by the
vscode:
andpositron:
scheme: can also be used to open a workspace (folder) or to go directly to the configuration for a setting.The text was updated successfully, but these errors were encountered: