diff --git a/shell-integration/ssh/bootstrap.sh b/shell-integration/ssh/bootstrap.sh index 7f349be62..c634ad769 100644 --- a/shell-integration/ssh/bootstrap.sh +++ b/shell-integration/ssh/bootstrap.sh @@ -149,9 +149,9 @@ while n > 0: } elif detect_perl; then read_n_bytes_from_tty() { - command "$perl" -MList::Util=min -e \ -'open(my $fh," /dev/null + command "$perl" -MList::Util=min -e ' +open(my $fh,"<","/dev/tty");binmode($fh);binmode(STDOUT);my ($n,$buf)=(@ARGV[0],""); +while($n>0){my $rv=sysread($fh,$buf,min(65536,$n));unless($rv){exit(1);};$n-=$rv;print STDOUT $buf;}' "$1" 2> /dev/null } else read_n_bytes_from_tty() {