# New Ticket Created by  David E. 
# Please include the string:  [perl #130512]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=130512 >


I'm attempting to use Perl6 && Proc::Async to automate a series of tests
that requires interacting with multiple shell-based applications.  This is
on Linux using the latest rakduobrew installation as of
yesterday (2016.12-200-gf9ed730).

For some applications, everything works perfectly, while others do not.

SSH is one example.  When using key-based logins everything works
perfectly.  If not using key-based logins (as required for a certain piece
of hardware I need to work with), the password prompt is not captured by
Proc::Async.  STDIN is read directly from the user shell, and the prompt
itself is never output from the 'tapped' stdout.  Further, SSH will refuse
to get even that far if the "-T" parameter is not given to it.

Screen is another example (I'm trying to use this because
Device::SerialPort hasn't been ported to Perl6 yet).  No matter what I try,
screen always aborts with the error "Must be connected to a terminal."

my $serial_proc = Proc::Async.new(:w, :r, "screen", "/dev/ttyUSB0",
"38400");

$serial_proc.stdout.tap(-> $v { say $v; });

my $promise = $serial_proc.start;

await $promise;

# Exits almost immediately, with "Must be connect to a terminal" being the
only thing output.


In this case, I found a temporary workaround using (ironically) ssh, for
which the man page documents the "-t -t" option as specifically resolving
this problem by forcing "pseudo-tty allocation."

my $serial_proc = Proc::Async.new(:w, :r, "ssh",
"-t","-t","localhost","screen /dev/ttyUSB0 38400")


Another application I need to use with this is a (JTAG) debug tool.  An
older version of the tool works perfectly, while the newer version fails to
recognize any STDIN from the script, though it does at least respond to
signals (ie: SIGINT).


I can't claim that I fully understand what's going on here, but clearly
this has something to do with Perl6's Proc::Async interface not supplying a
"psuedo-tty".

Reply via email to