64 G4cout <<
"aborting Run ...";
69 <<
"Session terminated." <<
G4endl;
74 "KeyboardInterrput with Ctrl-C");
95 UI-> SetSession(
this);
96 UI-> SetCoutDestination(
this);
101 if(aShell)
shell= aShell;
120 UI-> SetSession(NULL);
121 UI-> SetCoutDestination(NULL);
164 if(aCommand.length()<2)
return;
166 G4int returnVal =
UI-> ApplyCommand(aCommand);
168 G4int paramIndex = returnVal % 100;
171 G4int commandStatus = returnVal - paramIndex;
177 switch(commandStatus) {
182 if( aCommand.
index(
"@@") != G4String::npos) {
187 G4cerr <<
"illegal application state -- command refused" <<
G4endl;
199 G4cerr <<
"Parameter is out of candidate list (index " << paramIndex <<
")" <<
G4endl;
203 G4cerr <<
"Parameter is wrong type and/or is not omittable (index " << paramIndex <<
")" <<
G4endl;
207 G4cerr <<
"command refused (" << commandStatus <<
")" <<
G4endl;
218 newCommand=
shell-> GetCommandLineString(msg);
221 if( nC.length() == 0 ) {
222 newCommand= nullString;
224 }
else if( nC(0) ==
'#' ) {
226 newCommand= nullString;
228 }
else if(nC==
"ls" || nC.substr(0,3)==
"ls " ) {
230 newCommand= nullString;
232 }
else if(nC==
"lc" || nC.substr(0,3)==
"lc " ) {
234 newCommand= nullString;
236 }
else if(nC ==
"pwd") {
237 G4cout <<
"Current Command Directory : "
239 newCommand= nullString;
241 }
else if(nC ==
"cwd") {
242 shell-> ShowCurrentDirectory();
243 newCommand= nullString;
245 }
else if(nC ==
"cd" || nC.substr(0,3) ==
"cd ") {
248 newCommand= nullString;
250 }
else if(nC ==
"help" || nC.substr(0,5) ==
"help ") {
252 newCommand= nullString;
254 }
else if(nC(0) ==
'?') {
256 newCommand= nullString;
258 }
else if(nC ==
"hist" || nC ==
"history") {
259 G4int nh=
UI-> GetNumberOfHistory();
260 for (
G4int i=0; i<nh; i++) {
263 newCommand= nullString;
265 }
else if(nC(0) ==
'!') {
269 std::istringstream is(tt);
271 G4int nh=
UI-> GetNumberOfHistory();
273 newCommand=
UI-> GetPreviousCommand(vl);
276 G4cerr <<
"history " << vl <<
" is not found." <<
G4endl;
277 newCommand= nullString;
280 }
else if(nC ==
"exit") {
283 G4cout <<
"Please abort it using \"/run/abort\" command first" <<
G4endl;
284 G4cout <<
" and use \"continue\" command until the application"
289 newCommand= nullString;
292 }
else if( nC ==
"cont" || nC ==
"continue"){
294 newCommand= nullString;
296 }
else if( nC.empty() ){
297 newCommand= nullString;
310 std::cout << coutString << std::flush;
318 std::cerr << cerrString << std::flush;
329 G4cin.ignore(30,
'\n');
340 G4cin.getline(temp, 100);
G4String & remove(str_size)
virtual void PauseSessionStart(const G4String &msg)
virtual G4bool GetHelpChoice(G4int &aInt)
G4int ApplyCommand(const char *aCommand)
static G4ThreadLocal G4VUIshell * theshell
virtual G4int ReceiveG4cout(const G4String &coutString)
G4UIparameter * GetParameter(G4int i) const
G4String GetParameterCandidates() const
void TerminalHelp(const G4String &)
str_size index(const char *, G4int pos=0) const
static G4UImanager * GetUIpointer()
G4String GetPreviousCommand(G4int i) const
virtual G4UIsession * SessionStart()
G4String SolveAlias(const char *aCmd)
G4String strip(G4int strip_Type=trailing, char c=' ')
G4UIterminal(G4VUIshell *aShell=0, G4bool qsig=true)
const G4ThreeVector const G4double const
G4GLOB_DLL std::ostream G4cerr
G4UIcommand * FindCommand(const char *commandName) const
G4String GetCommand(const char *msg=0)
virtual void ExitHelp() const
G4String GetCurrentWorkingDirectory() const
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
virtual void ExecuteCommand(const G4String &aCommand)
void ListDirectory(const G4String &) const
static void SignalHandler(G4int)
void ChangeDirectoryCommand(const G4String &)
G4GLOB_DLL std::ostream G4cout
void ShowCurrent(const G4String &) const
void SetPrompt(const G4String &prompt)
G4String ModifyToFullPathCommand(const char *aCommandLine) const
virtual G4int ReceiveG4cerr(const G4String &cerrString)
static G4StateManager * GetStateManager()