summaryrefslogtreecommitdiff
path: root/lib/Term
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.ohio-state.edu>1997-04-14 17:12:18 +1200
committerTim Bunce <Tim.Bunce@ig.co.uk>1997-08-07 00:00:00 +1200
commitf36776d9df3fd477364b55a7c4728f0820f06f99 (patch)
treee74ce64114cc56015cb5d6c5999b71e7543698b1 /lib/Term
parenta6ed719b27c92569338047d45a029ec503c5d762 (diff)
downloadperl-f36776d9df3fd477364b55a7c4728f0820f06f99.tar.gz
Repost of fork() debugger patch
Here is the repost of what was apparently lost during some turmoil on p5-p. Enjoy, p5p-msgid: 199707252101.RAA11846@monk.mps.ohio-state.edu
Diffstat (limited to 'lib/Term')
-rw-r--r--lib/Term/ReadLine.pm45
1 files changed, 37 insertions, 8 deletions
diff --git a/lib/Term/ReadLine.pm b/lib/Term/ReadLine.pm
index 105e6dd536..a9df784d79 100644
--- a/lib/Term/ReadLine.pm
+++ b/lib/Term/ReadLine.pm
@@ -105,14 +105,33 @@ support reacher set of commands.
All these commands are callable via method interface and have names
which conform to standard conventions with the leading C<rl_> stripped.
-The stub package included with the perl distribution allows two
-additional methods: C<tkRunning> and C<ornaments>. The first one
+The stub package included with the perl distribution allows some
+additional methods:
+
+=over 12
+
+=item C<tkRunning>
+
makes Tk event loop run when waiting for user input (i.e., during
-C<readline> method), the second one makes the command line stand out
-by using termcap data. The argument to C<ornaments> should be 0, 1,
-or a string of a form "aa,bb,cc,dd". Four components of this string
-should be names of I<terminal capacities>, first two will be issued to
-make the prompt standout, last two to make the input line standout.
+C<readline> method).
+
+=item C<ornaments>
+
+makes the command line stand out by using termcap data. The argument
+to C<ornaments> should be 0, 1, or a string of a form
+C<"aa,bb,cc,dd">. Four components of this string should be names of
+I<terminal capacities>, first two will be issued to make the prompt
+standout, last two to make the input line standout.
+
+=item C<newTTY>
+
+takes two arguments which are input filehandle and output filehandle.
+Switches to use these filehandles.
+
+=back
+
+One can check whether the currently loaded ReadLine package supports
+these methods by checking for corresponding C<Features>.
=head1 EXPORTS
@@ -206,12 +225,22 @@ sub new {
bless [$FIN, $FOUT];
}
}
+
+sub newTTY {
+ my ($self, $in, $out) = @_;
+ $self->[0] = $in;
+ $self->[1] = $out;
+ my $sel = select($out);
+ $| = 1; # for DB::OUT
+ select($sel);
+}
+
sub IN { shift->[0] }
sub OUT { shift->[1] }
sub MinLine { undef }
sub Attribs { {} }
-my %features = (tkRunning => 1, ornaments => 1);
+my %features = (tkRunning => 1, ornaments => 1, newTTY => 1);
sub Features { \%features }
package Term::ReadLine; # So late to allow the above code be defined?