historyExpansion = $historyExpansion; } /** * Replace the HistoryExpansionAction (e.g. after Shell is set). */ public function setHistoryExpansion(HistoryExpansionAction $historyExpansion): void { $this->historyExpansion = $historyExpansion; } /** * {@inheritdoc} */ public function execute(Buffer $buffer, Terminal $terminal, Readline $readline): bool { if ($this->historyExpansion->detectExpansion($buffer->getText(), $buffer->getCursor()) === null) { return false; } return $this->historyExpansion->execute($buffer, $terminal, $readline); } /** * {@inheritdoc} */ public function getName(): string { return 'expand-history-on-tab'; } }