Index: /drsdaq/DAQReadout.cc
===================================================================
--- /drsdaq/DAQReadout.cc	(revision 50)
+++ /drsdaq/DAQReadout.cc	(revision 51)
@@ -1019,26 +1019,19 @@
   vsnprintf(Textbuffer, sizeof(Textbuffer), Format, ArgumentPointer);
   
-  // Print to console and generate new prompt
+  // Print to console
   if(Target & MsgToConsole) {
-    if(strlen(Textbuffer)>0 && Textbuffer[strlen(Textbuffer)-1]=='\n') printf("\r%s", Textbuffer);
+    if(strlen(Textbuffer)>0 && Textbuffer[strlen(Textbuffer)-1]=='\n') {
+      printf("\r%s%s", Textbuffer, Prompt);   // New prompt
+      fflush(stdout);
+    }
     else printf("%s", Textbuffer);
-
-    // New prompt only after newline
-    if(Textbuffer[strlen(Textbuffer)-1]=='\n' || strlen(Textbuffer)==0) {
-      if (NumBoards == 0) printf("\rDAQ> "); 
-      else if (FirstBoard == LastBoard) printf("\rDAQ|B%d> ",FirstBoard); 
-      else printf("\rDAQ|B%d-%d> ",FirstBoard,LastBoard); 
-      fflush(stdout);
-    }
-  }
-
-  // Print to log file and socket only if length not zero (then only prompt)
-  if (strlen(Textbuffer)>0) {
-    if((Target & MsgToLog) && Logfile!=NULL) {
-      fprintf(Logfile, "%s", Textbuffer);
-      fflush(Logfile);
-    }
-    if((Target & MsgToSocket) && Socket!=-1) write(Socket, Textbuffer, strlen(Textbuffer));
-  }
+  }
+  // Print to log file
+  if((Target & MsgToLog) && Logfile!=NULL) {
+    fprintf(Logfile, "%s", Textbuffer);
+    fflush(Logfile);
+  }
+  // Print to socket
+  if((Target & MsgToSocket) && Socket!=-1) write(Socket, Textbuffer, strlen(Textbuffer));
 }
 
Index: /drsdaq/DAQReadout.h
===================================================================
--- /drsdaq/DAQReadout.h	(revision 50)
+++ /drsdaq/DAQReadout.h	(revision 51)
@@ -81,5 +81,5 @@
     unsigned int RunNumber, FileNumber; 
     char FileName[MAX_PATH];
-
+    char Prompt[MAX_COM_SIZE];
     
     // Public functions
Index: /drsdaq/History.txt
===================================================================
--- /drsdaq/History.txt	(revision 50)
+++ /drsdaq/History.txt	(revision 51)
@@ -28,3 +28,4 @@
 19/5/2009   Subversion revision number included in run header. Added human readable
     	    date and time to slow data.
-28/5/2009   Replaced NCMCBoards by NBoards for clarity.
+28/5/2009   Replaced NCMCBoards by NBoards for clarity. Added line editing
+    	    capability with the readline library.
Index: /drsdaq/Makefile
===================================================================
--- /drsdaq/Makefile	(revision 50)
+++ /drsdaq/Makefile	(revision 51)
@@ -26,5 +26,5 @@
 
 CPPFLAGS = -DREVISION='"$(REVISION)"' -O3 -Wall $(VMECTRL)
-LIBS = -lstdc++ -lz -lpthread -lutil -lfl $(VMELIB)
+LIBS = -lstdc++ -lz -lpthread -lutil -lfl -lreadline -ltermcap $(VMELIB)
 
 drsdaq: $(OBJECTS)
Index: /drsdaq/drsdaq.cpp
===================================================================
--- /drsdaq/drsdaq.cpp	(revision 50)
+++ /drsdaq/drsdaq.cpp	(revision 51)
@@ -19,4 +19,6 @@
 #include <netdb.h>
 #include <arpa/inet.h>
+#include <readline/readline.h>
+#include <readline/history.h>
 
 #include "DAQReadout.h"
@@ -116,5 +118,6 @@
   ConsoleCommand thread
 
-  Handle console input
+  Handle console input using readline library functions to allow
+  line editing and history capability
 
 \********************************************************************/
@@ -122,18 +125,28 @@
 void ConsoleCommand(DAQReadout *m) {
 
-  char Command[MAX_COM_SIZE], Buf[MAX_COM_SIZE];
   time_t Time;
-
+  char *Command, Buf[MAX_COM_SIZE];;
+  
   while (!m->Exit) {
-    m->PrintMessage("");	// New prompt
-    if (fgets(Command, MAX_COM_SIZE, stdin)==NULL)
+    if (m->NumBoards == 0) snprintf(m->Prompt,sizeof(m->Prompt),"\rDAQ> "); 
+    else if (m->FirstBoard == m->LastBoard) snprintf(m->Prompt,sizeof(m->Prompt),"\rDAQ|B%d> ",m->FirstBoard); 
+    else snprintf(m->Prompt,sizeof(m->Prompt),"\rDAQ|B%d-%d> ",m->FirstBoard,m->LastBoard); 
+
+    Command = readline(m->Prompt);
+    if (Command==NULL) {
       m->PrintMessage("Error reading command line input\n");
-
-    strftime(Buf,MAX_COM_SIZE,"%d/%m/%y %X", localtime(&(Time=time(NULL))));
-    m->PrintMessage(MsgToLog, "CONSOLE(%s)> %s",Buf, Command);
+      continue;
+    }
+
+    if(strlen(Command)>0) add_history(Command);
+
+    strftime(Buf,MAX_COM_SIZE, "%d/%m/%y %X", localtime(&(Time=time(NULL))));
+    m->PrintMessage(MsgToLog, "CONSOLE(%s)> %s", Buf, Command);
 
     pthread_mutex_lock(&m->control_mutex);
     m->CommandControl(Command, false);
     pthread_mutex_unlock(&m->control_mutex);
+
+    free(Command);
   }
 }
@@ -206,5 +219,5 @@
       memset(Command,0,sizeof(Command));
       ReadResult = read(ConnectionSocket, Command, MAX_COM_SIZE);
-      if (ReadResult==0) break;  // Client no exisiting anymore
+      if (ReadResult==0) break;  // Client not exisiting anymore
       if (ReadResult==-1) {
 	if (errno!=EINTR) m->PrintMessage("Error read from socket (%s)\n", strerror(errno));
@@ -219,5 +232,4 @@
       m->CommandControl(Command, true);	// Process CC command
       pthread_mutex_unlock(&m->control_mutex);
-      m->PrintMessage("");	// New prompt
     }
     m->Socket = -1;
