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

Within the Pluto notebook isinteractive() returns false #3074

Closed
vojtamolda opened this issue Oct 23, 2024 · 7 comments
Closed

Within the Pluto notebook isinteractive() returns false #3074

vojtamolda opened this issue Oct 23, 2024 · 7 comments

Comments

@vojtamolda
Copy link

Dear developers here,

First, thanks a lot for creating such a nice package! It's probably my favorite Julia project.

When moving over some of my work from REPL, I noticed that the return value from isinteractive() is always false within the notebook. I think this is a bug because the standard Julia REPL returns true and I believe the Pluto notebooks are very interactive :)


I've attached a screenshot and the actual notebook file for reproducing the problem.

interactive_bug
@vojtamolda vojtamolda changed the title Within the Pluto notebook isinteractive() returns false Within the Pluto notebook isinteractive() returns false Oct 23, 2024
@cstjean
Copy link

cstjean commented Oct 24, 2024

It's not clear what isinteractive is supposed to imply (and what it's meant to be used for), but IMO an interactive session should support readline, which Pluto does not.
{46050D30-2BBF-4A0A-A6A6-45CDDD4DD538}

@vojtamolda
Copy link
Author

Thanks for the response. Yeah, you're probably right. I just checked and Jupyter notebooks return the same value. So this probably isn't a bug.

Screenshot 2024-10-23 at 8 28 24 PM

On a more general level, is there a way for a piece of code to tell that it's running in a Pluto.jl notebook?

@cstjean
Copy link

cstjean commented Oct 24, 2024

Check "Not really hooks but internally very hook-ish" in PlutoHooks

@pankgeorg
Copy link
Collaborator

Thanks for the report! I'll close this for now, but keep the reports coming; we love hearing from you! ❤️ 🎉

@pankgeorg pankgeorg closed this as not planned Won't fix, can't repro, duplicate, stale Oct 24, 2024
@vojtamolda
Copy link
Author

Yep. Makes total sense to close this. Thanks for your help gentlemen!

@fonsp
Copy link
Owner

fonsp commented Oct 24, 2024

The official API is https://plutojl.org/en/docs/abstractplutodingetjes/#is_inside_pluto

@fonsp
Copy link
Owner

fonsp commented Oct 24, 2024

To answer the original question, Pluto is indeed interactive 🐣 but Base.isinteractive() is supposed to return: "is this Julia process in a TTY terminal with user input"? And the answer in Pluto is no, since we have no stdin (because that is very hard to implement in a sensible way).

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

4 participants