Skip to content
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

Function to distinguish Positron and RStudio #310

Closed
vincentarelbundock opened this issue Nov 14, 2024 · 2 comments
Closed

Function to distinguish Positron and RStudio #310

vincentarelbundock opened this issue Nov 14, 2024 · 2 comments

Comments

@vincentarelbundock
Copy link

vincentarelbundock commented Nov 14, 2024

As a package developer, I would find it very useful to have a function that allows me to distinguish between IDEs like Positron and RStudio.

For instance, Positron does not support inline display of tables in Quarto notebooks, whereas RStudio does. So a table-drawing package needs to behave differently and only tables in the viewer when in Positron.

Currently, we can hack our way there by checking if some function is available (ie: generates an error), but those solutions feel hacky.

Unless there is 100% feature parity between editors, it will likely always be useful for developers to know where things are run.

Thanks for considering!

Related to: #302

@gadenbuie
Copy link
Member

gadenbuie commented Nov 15, 2024

There are RSTUDIO and POSITRON environment variables that you can consult that are each set within the context of the respective IDEs. They're briefly mentioned in an example here: https://positron.posit.co/extensions.html#compatibility

@vincentarelbundock
Copy link
Author

Thanks, this is exactly what I was looking for!

Sorry I missed this in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants