X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=perl%2Fconsole.pl;h=41eb8016cc38249e2eccb891b38fedc05cede131;hb=e03572bb51a1ab00ed6be9bc8286354fba91bfa4;hp=0cb15bd0fbc0171446f40fde6151ee100621f8d7;hpb=dc999e28c96ebb4589dbdda8435a548ade15a37d;p=spider.git diff --git a/perl/console.pl b/perl/console.pl index 0cb15bd0..41eb8016 100755 --- a/perl/console.pl +++ b/perl/console.pl @@ -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;