Skip to content

Commit 97ffdb8

Browse files
fix: update eraseTui method to optionally preserve header lines
1 parent 331ea86 commit 97ffdb8

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

app/Commands/Concerns/TuiCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ protected function runTuiLoop(callable $poll, ?callable $shouldStop = null): voi
115115
} finally {
116116
$this->disableRawMode();
117117
$this->cleanupProcesses();
118-
$this->eraseTui();
118+
$this->eraseTui(preserveHeader: true);
119119
}
120120
}
121121

@@ -616,9 +616,9 @@ protected function sortOrderFor(string $dir): int
616616
return (int) ($this->state[$dir]['order'] ?? 0);
617617
}
618618

619-
protected function eraseTui(): void
619+
protected function eraseTui(bool $preserveHeader = false): void
620620
{
621-
$total = $this->headerLines + $this->renderedLines;
621+
$total = $preserveHeader ? $this->renderedLines : $this->headerLines + $this->renderedLines;
622622

623623
if ($total > 0) {
624624
$this->output->write(sprintf("\033[%dA\033[J", $total));

0 commit comments

Comments
 (0)