$r =
[$inputStream];
} $c =
fread($inputStream, 1
);
// as opposed to fgets(), fread() returns an empty string when the stream content is empty, not false.
if (false ===
$c || ('' ===
$ret && '' ===
$c && null ===
$question->
getDefault())) { shell_exec('stty '.
$sttyMode);
throw new MissingInputException('Aborted.'
);
} elseif ("\177" ===
$c) { // Backspace Character
if (0 ===
$numMatches && 0 !==
$i) { --
$i;
$cursor->
moveLeft(s($fullChoice)->
slice(-1
)->
width(false
));
$fullChoice = self::
substr($fullChoice, 0,
$i);
} if (0 ===
$i) { $ofs = -1;
$matches =
$autocomplete($ret);
$numMatches = \
count($matches);
} else { $numMatches = 0;
}