From f10556a162ccbd8098f8725b0fa66e11a1bb03c0 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 29 Mar 2026 19:45:40 +0000 Subject: [PATCH] fix: use Console::Write for progress bar to avoid duplicate bars when piped via iex Agent-Logs-Url: https://github.com/MCCTeam/Minecraft-Console-Client/sessions/2c598307-7028-46d4-ac37-045f5ce125ed Co-authored-by: milutinke <441903+milutinke@users.noreply.github.com> --- docs/.vuepress/public/install.ps1 | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/.vuepress/public/install.ps1 b/docs/.vuepress/public/install.ps1 index 8a14a86c..31f2e324 100644 --- a/docs/.vuepress/public/install.ps1 +++ b/docs/.vuepress/public/install.ps1 @@ -64,7 +64,12 @@ try { $bar = $filled.PadRight(50) $recv = [math]::Round($totalRead / 1MB, 1) $total = [math]::Round($totalBytes / 1MB, 1) - Write-Host -NoNewline ("`r[{0}] {1,3}% {2,6:N1} / {3,6:N1} MB" -f $bar, $pct, $recv, $total) + # Use [Console]::Write with an explicit \r so the cursor returns to + # column 0 and overwrites the previous bar. Write-Host -NoNewline + # does not reliably reposition the cursor when the script is run + # via iex (pipe mode), producing multiple bars on one line. + $line = "`r[{0}] {1,3}% {2,6:N1} / {3,6:N1} MB" -f $bar, $pct, $recv, $total + [Console]::Write($line) } } } finally { @@ -73,7 +78,7 @@ try { $response.Close() } -Write-Host "" # end the progress line +[Console]::WriteLine() # end the progress line Write-Host "" Write-Host "Downloaded: .\$OUTPUT"