a few detail changes
[spider.git] / perl / console.pl
index 0cb15bd0fbc0171446f40fde6151ee100621f8d7..41eb8016cc38249e2eccb891b38fedc05cede131 100755 (executable)
@@ -163,6 +163,21 @@ sub rec_stdin
                        
                        # save the lines
                        if ($inbuf) {
+                               # check for a pling and do a search back for a command
+                               if ($inbuf =~ /^!/o) {
+                                       my $i;
+                                       $inbuf =~ s/^!//o;
+                                       for ($i = $#khistory; $i >= 0; $i--) {
+                                               if ($khistory[$i] =~ /^$inbuf/) {
+                                                       $inbuf = $khistory[$i];
+                                                       last;
+                                               }
+                                       }
+                                       if ($i < 0) {
+                                               beep();
+                                               return;
+                                       }
+                               }
                                push @khistory, $inbuf if $inbuf;
                                shift @khistory if @khistory > $maxkhist;
                                $khistpos = @khistory;