diff --git a/lib/modules/Stdio.pmod/Readline.pike b/lib/modules/Stdio.pmod/Readline.pike
index b57fe4e4d88ce0bd1ebf2bbb134412e9c617ae84..0017fef4676e84596aa4bcc33f1c492e6908f325 100644
--- a/lib/modules/Stdio.pmod/Readline.pike
+++ b/lib/modules/Stdio.pmod/Readline.pike
@@ -1,4 +1,4 @@
-// $Id: Readline.pike,v 1.26 1999/09/10 16:17:59 noring Exp $
+// $Id: Readline.pike,v 1.27 1999/10/04 00:16:42 js Exp $
 
 class OutputController
 {
@@ -1013,6 +1013,11 @@ class History
   static private mapping(int:string) historykeep=([]);
   static private int minhistory, maxhistory, historynum;
 
+  array(string) encode()
+  {
+    return historylist;
+  }
+  
   int get_history_num()
   {
     return historynum;
@@ -1062,9 +1067,9 @@ class History
     maxhistory = maxhist;
   }
 
-  void create(int maxhist)
+  void create(int maxhist, void|array(string) hist)
   {
-    historylist = ({ "" });
+    historylist = hist || ({ "" });
     minhistory = historynum = 0;
     maxhistory = maxhist;
   }
@@ -1079,7 +1084,7 @@ static private string text="", readtext;
 static private function(string:void) newline_func;
 static private int cursorpos = 0;
 static private int mark = 0;
-static private object(History) historyobj = 0;
+/*static private */ object(History) historyobj = 0;
 static private int hide = 0;
 
 static private array(string) kill_ring=({});
@@ -1408,6 +1413,8 @@ string edit(string data, string|void local_prompt)
   output_controller->enable();
   insert(data, 0);
   int res = input_controller->run_blocking();
+
+
   set_nonblocking(oldnl);
   
   if(local_prompt)
@@ -1421,10 +1428,12 @@ string read(string|void prompt)
   return edit("", prompt);
 }
 
-void enable_history(object(History)|int hist)
+void enable_history(array(string)|object(History)|int hist)
 {
   if (objectp(hist))
     historyobj = hist;
+  else if(arrayp(hist))
+    historyobj = History(512,hist);
   else if(!hist)
     historyobj = 0;
   else if(historyobj)
@@ -1433,6 +1442,11 @@ void enable_history(object(History)|int hist)
     historyobj = History(hist);
 }
 
+History get_history()
+{
+  return historyobj;
+}
+
 void destroy()
 {
   if(input_controller)
diff --git a/lib/modules/Tools.pmod/Hilfe.pmod b/lib/modules/Tools.pmod/Hilfe.pmod
index 1e10013697e74daed1e5327c4a064548f6fc78ed..44470ee838f17855d924cfedb293f6abae779d52 100644
--- a/lib/modules/Tools.pmod/Hilfe.pmod
+++ b/lib/modules/Tools.pmod/Hilfe.pmod
@@ -596,42 +596,74 @@ import Getopt;
 class StdinHilfe
 {
   inherit Evaluator;
+  
+  object(Stdio.Readline) readline;
 
+  void save_history()
+  {
+    catch {
+      if(string home=getenv("HOME")||getenv("USERPROFILE"))
+      {
+	if(object f=Stdio.File(home+"/.hilfe_history","wc"))
+	{
+	  f->write(sprintf("array history=%O;",readline->get_history()->encode()));
+	  f->close();
+	}
+      }
+    };
+  }
+  
   void signal_trap(int s)
-    {
-      clean_buffer();
-      throw("**Break\n");
-    }
+  {
+    clean_buffer();
+    save_history();
+    exit(1);
+  }
   
   void create()
+  {
+    write=predef::write;
+    ::create();
+    
+    if(string home=getenv("HOME")||getenv("USERPROFILE"))
     {
-      write=predef::write;
-      ::create();
-
-      if(string home=getenv("HOME"))
+      if(string s=Stdio.read_file(home+"/.hilferc"))
+      {
+	add_buffer(s);
+      }
+    }
+    
+    readline = Stdio.Readline();
+    array(string) hist;
+    catch{
+      if(string home=getenv("HOME")||getenv("USERPROFILE"))
       {
-	if(string s=Stdio.read_file(home+"/.hilferc"))
+	if(object f=Stdio.File(home+"/.hilfe_history","r"))
 	{
-	  add_buffer(s);
+	  string s=f->read();
+	  catch(hist=compile_string(s)()->history);
+	  readline->enable_history(hist);
 	}
       }
-	
-      object(Stdio.Readline) readline = Stdio.Readline();
+    };
+    if(!hist)
       readline->enable_history(512);
-
-      for(;;)
-      {
-	readline->set_prompt(strlen(input) ? ">> " : "> ");
-	string s=readline->read();
-	if(!s)
-	  break;
-	signal(signum("SIGINT"),signal_trap);
-	add_input_line(s+"\n");
-	signal(signum("SIGINT"));
-      }
-      destruct(readline);
-      write("Terminal closed.\n");
+    signal(signum("SIGINT"),signal_trap);
+    
+    for(;;)
+    {
+      readline->set_prompt(strlen(input) ? ">> " : "> ");
+      string s=readline->read();
+      if(!s)
+	break;
+//       signal(signum("SIGINT"),signal_trap);
+      add_input_line(s+"\n");
+//       signal(signum("SIGINT"));
     }
+    save_history();
+    destruct(readline);
+    write("Terminal closed.\n");
+  }
 }
 
 class GenericHilfe