Index: /trunk/FACT++/src/Readline.cc
===================================================================
--- /trunk/FACT++/src/Readline.cc	(revision 16936)
+++ /trunk/FACT++/src/Readline.cc	(revision 16937)
@@ -50,4 +50,5 @@
 
  - <A HREF="http://cnswww.cns.cwru.edu/php/chet/readline/rltop.html">GNU Readline</A>
+ - <A HREF="http://www.rendezvousalpha.com/f/bash_d596c169?fn=1670">GNU Readline (src code)</A>
 
  */
@@ -59,4 +60,5 @@
 #include <iostream>
 
+#include <sys/ioctl.h>
 #include <readline/readline.h>
 #include <readline/history.h>
@@ -328,9 +330,6 @@
         rl_on_new_line();
 
-    if (rl_prompt==p)
-    {
-        Redisplay();
+    if (rl_prompt==p && !newline)
         return;
-    }
 
     UpdatePrompt(p);
@@ -387,4 +386,5 @@
 {
     rl_display_match_list(matches, num, max);
+    rl_forced_update_display();
 }
 
@@ -574,9 +574,8 @@
             break;
 
-        // It seems like history_search_pos works more like
-        // history_search_prefix, therefore the identity is checked again
-        const HIST_ENTRY *e = history_get(p+1);
-        if (e && str==e->line)
-            free(remove_history(p));
+        HIST_ENTRY *e = remove_history(p--);
+
+        free(e->line);
+        free(e);
     }
 
@@ -1031,4 +1030,6 @@
     fprintf(rl_outstream, "   Ctrl-left       One word backward\n");
     fprintf(rl_outstream, "   Ctrl-right      One word forward\n");
+    fprintf(rl_outstream, "   Home            Beginning of line\n");
+    fprintf(rl_outstream, "   End             End of line\n");
     fprintf(rl_outstream, "   Ctrl-d          Quit\n");
     fprintf(rl_outstream, "   Ctrl-y          Delete line\n");
