projects
/
spider.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
*** empty log message ***
[spider.git]
/
perl
/
console.pl
diff --git
a/perl/console.pl
b/perl/console.pl
index 41eb8016cc38249e2eccb891b38fedc05cede131..50196907829e16608af9cfc0a4f95f0132efdbcb 100755
(executable)
--- a/
perl/console.pl
+++ b/
perl/console.pl
@@
-159,6
+159,7
@@
sub rec_stdin
# $prbuf =~ s/\n/\\n/;
# print "sys: $r ($prbuf)\n";
if (defined $r) {
# $prbuf =~ s/\n/\\n/;
# print "sys: $r ($prbuf)\n";
if (defined $r) {
+
if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") {
# save the lines
if ($r eq KEY_ENTER || $r eq "\n" || $r eq "\r") {
# save the lines
@@
-266,6
+267,13
@@
sub rec_stdin
beep();
}
} elsif ($r ge ' ' && $r le '~') {
beep();
}
} elsif ($r ge ' ' && $r le '~') {
+ # move the top screen back to the bottom if you type something
+ if ($spos < @shistory - 1) {
+ $spos = @shistory;
+ show_screen();
+ }
+
+ # insert the character into the keyboard buffer
if ($pos < $lth) {
my $a = substr($inbuf, 0, $pos);
my $b = substr($inbuf, $pos);
if ($pos < $lth) {
my $a = substr($inbuf, 0, $pos);
my $b = substr($inbuf, $pos);