Skip to content

Allow batch mode (gROOT::SetBatch) to be changed from true to false in middle of session #18900

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

Open
will-cern opened this issue May 29, 2025 · 2 comments · May be fixed by #18911
Open

Allow batch mode (gROOT::SetBatch) to be changed from true to false in middle of session #18900

will-cern opened this issue May 29, 2025 · 2 comments · May be fixed by #18911
Assignees

Comments

@will-cern
Copy link
Contributor

Feature description

Hello,
I have noticed that if I start a python session in batch mode (ROOT.gROOT.SetBatch(True)) and run some lines that would draw some things to a canvas, if I subsequently set ROOT.gROOT.SetBatch(False) in the same session, I am unable to visualize new canvases.
Is there a way to switch between batch mode in the same session? It would be great if this was supported!
Thanks
Will

Alternatives considered

No response

Additional context

No response

@ferdymercury
Copy link
Collaborator

ferdymercury commented May 29, 2025

It works fine directly in Cling:

gROOT->SetBatch(kTRUE);
new TCanvas();
gROOT->SetBatch(kFALSE);
new TCanvas();
gROOT->SetBatch(kTRUE);
new TCanvas();

But indeed fails in Python:

import ROOT
ROOT.gROOT.SetBatch(True)
c = ROOT.TCanvas()
ROOT.gROOT.SetBatch(False)
c2 = ROOT.TCanvas()
ROOT.gROOT.SetBatch(True)
c3 = ROOT.TCanvas()

ferdymercury added a commit to ferdymercury/root that referenced this issue May 29, 2025
@ferdymercury ferdymercury linked a pull request May 29, 2025 that will close this issue
2 tasks
@ferdymercury
Copy link
Collaborator

@will-cern Could you try applying this change? #18911
(Rebuilding is immediate).

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

Successfully merging a pull request may close this issue.

3 participants