Tk-Terminal
view release on metacpan or search on metacpan
lib/Tk/Terminal.pm view on Meta::CPAN
package Tk::Terminal;
=head1 NAME
Tk::Terminal - Running system commands in a Tk::Text widget.
=cut
use strict;
use warnings;
use vars qw( $VERSION );
$VERSION = '0.03';
use Cwd;
use Fcntl;
use File::Basename;
use POSIX ":sys_wait_h";
use IPC::Open3;
use IO::Handle;
#use IO::Pty;
use Term::ANSIColor;
use Tk;
require Tk::Clipboard;
#boilerplating
my $sep = '/';
my $qsep = quotemeta($sep);
my $root = qr/^\//;
use base qw(Tk::Derived Tk::TextANSIColor);
Construct Tk::Widget 'Terminal';
=head1 SYNOPSIS
require Tk::Terminal;
my $text= $window->Terminal(@options)->pack;
=head1 DESCRIPTION
Inherits L<Tk::TextANSIColor>.
This module works as a modest command shell. You can enter a command and go into dialog with
the program you are running, if the program does not buffer it's output.
It is in no way a replacement for the standard command shell on your system. It handles ANSI
colored output, but only colours.
This module will install but not work on Windows.
=head1 OPTIONS
If you change any of the color options while running, you should call B<configureTags> to see the changes.
=over 4
=item Switch B<-buffering>
Default value: 1 (boolean flag)
Used when a process is running.
If buffering is set you have the opportunity to edit your response line
before sending it to the process with return. If buffering is not set every
key stroke will be sent to the process immediately.
=item Switch B<-dircall>
Callback, called when you change directory.
=item Name B<errorbg>
=item Class B<Errorbg>
=item Switch B<-errorbg>
Default value: #FF0000 (red)
Background color for text tagged as 'error'.
=item Name B<errorfg>
=item Class B<Errorfg>
=item Switch B<-errorfg>
Default value: #FFFF00 (yellow)
Foreground color for text tagged as 'error'.
=item Switch B<-historyfile>
( run in 2.347 seconds using v1.01-cache-2.11-cpan-140bd7fdf52 )