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

Is there a way to detect command line execution? #603

Closed
leohallier opened this issue Oct 23, 2020 · 1 comment
Closed

Is there a way to detect command line execution? #603

leohallier opened this issue Oct 23, 2020 · 1 comment

Comments

@leohallier
Copy link

I want to detect whether my code is executed through Pluto or with the command line (ie. >julia notebook.jl) so diagnostic plots and similar things do not get computed unnecessarily. So far I have been using @bind missingifcmd html"<input type=range min=5 max=5>" and the ismissing() function. The problem is that during Pluto execution it first gets set to missing anyway for a short time causing unwanted behaviour at startup. Is there a better solution?

@fonsp
Copy link
Owner

fonsp commented Oct 23, 2020

You can use isdefined(:PlutoRunner), it will always be supported

@fonsp fonsp closed this as completed Oct 23, 2020
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