Index: trunk/FACT++/src/StateMachineDimControl.cc
===================================================================
--- trunk/FACT++/src/StateMachineDimControl.cc	(revision 14369)
+++ trunk/FACT++/src/StateMachineDimControl.cc	(revision 14370)
@@ -31,8 +31,6 @@
 int StateMachineDimControl::ChangeState(int qos, const Time &time, int scriptdepth, string scriptfile, string user)
 {
-    ostringstream pid;
-    pid << getpid();
-
     string msg;
+    /*
     switch (qos)
     {
@@ -47,17 +45,22 @@
         }
     }
-
-    if (qos<0)
-        msg += "-"+to_string(scriptdepth);
-
-    msg += ": "+scriptfile+" ["+user+":"+pid.str()+"]";
-
-    if (fDebug)
-        Write(time, Line(msg, qos<-1 ? '=' :'-'), 90);
+    */
+
+    //if (qos<0)
+        msg += to_string(scriptdepth);
+
+    msg += ":"+scriptfile+"["+user+":"+to_string(getpid())+"]";
+
+    //if (fDebug)
+    //Write(time, Line(msg, qos<-1 ? '=' :'-'), MessageImp::kInternal);
 
     if (qos==-3)
         fScriptUser = fUser;
 
-    return qos+3;
+    SetCurrentState(qos+3, msg.c_str());
+    //SetCurrentState(qos+3, Line(msg, qos<-1 ? '=' :'-').c_str());
+    return GetCurrentState();
+
+    //return qos+3;
 }
 
@@ -66,4 +69,11 @@
     if (txt=="")
     {
+        return ChangeState(qos, time, Readline::GetScriptDepth(), Readline::GetScript(), fScriptUser);
+        /*
+         === This might be necessary for thread safety,
+         === but it break that the signal for the start of a new
+         === script arrives synchronously before the first output
+         === from the script
+
         // Post an anonymous event to the event loop
         Event evt("");
@@ -72,4 +82,5 @@
                                 Readline::GetScript(), fScriptUser));
         return PostEvent(evt);
+        */
     }
 
@@ -426,5 +437,5 @@
 }
 
-StateMachineDimControl::StateMachineDimControl(ostream &out) : StateMachineDim(out, fIsServer?"DIM_CONTROL2":"")
+StateMachineDimControl::StateMachineDimControl(ostream &out) : StateMachineDim(out, fIsServer?"DIM_CONTROL":"")
 {
     fDim.Subscribe(*this);
