updated streamline-setup v2

This commit is contained in:
2025-01-15 08:53:49 -08:00
committed by alec.turner
parent a2ce9248f0
commit 4b569f81b0
20228 changed files with 2932048 additions and 63204 deletions
@@ -25,7 +25,7 @@ use Psy\Util\Str;
*/
class Libedit extends GNUReadline
{
private $hasWarnedOwnership = false;
private bool $hasWarnedOwnership = false;
/**
* Let's emulate GNU Readline by manually reading and parsing the history file!
@@ -48,6 +48,10 @@ class Libedit extends GNUReadline
*/
public function listHistory(): array
{
if ($this->historyFile === false) {
return [];
}
$history = \file_get_contents($this->historyFile);
if (!$history) {
return [];
@@ -63,6 +67,7 @@ class Libedit extends GNUReadline
// decode the line
$history = \array_map([$this, 'parseHistoryLine'], $history);
// filter empty lines & comments
return \array_values(\array_filter($history));
}