App-AltSQL
view release on metacpan or search on metacpan
lib/App/AltSQL/Term.pm view on Meta::CPAN
$term->Attribs->{autolist} = 0;
$term->Attribs->{completion_function} = sub {
$self->completion_function(@_);
};
$term->Attribs->{beat} = sub {
# Check on things in the background here; called every second there is no input from the user
};
$term->bindkey('^Z', sub {
# The Term::ReadLine::Zoid uses Term::ReadKey in 'raw' mode which disables all signals
# If we can find a way to background ourselves at this point, that's the only option that I can see
$self->log_info("Backgrounding is not currently possible");
});
$term->bindkey('^D', sub {
print "\n";
$self->app->shutdown();
});
$term->bindkey('return', sub { $self->return_key });
$self->read_history();
return $term;
}
sub return_key {
my $self = shift;
## The user has pressed the 'enter' key. If the buffer ends in ';' or '\G', or if they've typed the bare word 'quit' or 'exit', accept the buffer
( run in 3.804 seconds using v1.01-cache-2.11-cpan-2398b32b56e )