Message: Re: Finishing a G4UIterminal session Not Logged In (login)
 Next-in-Thread Next-in-Thread
 Next-in-Forum Next-in-Forum

Feedback Re: Finishing a G4UIterminal session 

Forum: Run Management
Re: Question Finishing a G4UIterminal session (C Mos)
Date: 30 May, 2013
From: Michael H. Kelsey <Michael H. Kelsey>

On Thu, 30 May 2013 18:41:57 GMT, C Mos wrote:
> Hi I am looking for a way (if there is any) to finish a terminal session
> through a single command in my script file. Is there such a thing?

No. The "exit" keyword is not a normal G4UIcommand; it is intercepted directly by the command-line processor (G4UIbatch::SessionStart()) before the line is passed to UI->ApplyCommand().

When you run a macro, the UI system creates a "daughter" G4UIbatch session. At the end of the macro, or if it encounters the magic "exit" keyword, that session will be terminated and control passes up to the previously existing session (i.e., your interactive prompt).

There's no built-in way for a session to terminate the whole chain. You could define your own macro command (/MyApp/quit) and just have it call ::exit(0); as its action. Of course, if your main() does any special post-processing or cleanup after the UI exits, none of that will happen, so this is NOT a recommended practice!

-- Michael Kelsey

Inline Depth:
 1 1
 All All
Outline Depth:
 1 1
 2 2
 All All
Add message: (add)

1 None: Re: Finishing a G4UIterminal session   (C Mos - 30 May, 2013)
(_ None: Re: Finishing a G4UIterminal session   (Mike Kelsey - 30 May, 2013)
 Add Message Add Message
to: "Re: Finishing a G4UIterminal session"

 Subscribe Subscribe

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews

[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]