Skip to content

Instantly share code, notes, and snippets.

@mdgrs-mei
Created June 15, 2023 14:43
Show Gist options
  • Save mdgrs-mei/244496f094abc367d46a64d6c7f7dd7e to your computer and use it in GitHub Desktop.
Save mdgrs-mei/244496f094abc367d46a64d6c7f7dd7e to your computer and use it in GitHub Desktop.
Show spinner on the Windows Terminal tabs for every command.
$global:originalPSConsoleHostReadLine = $function:global:PSConsoleHostReadLine
$global:originalPrompt = $function:global:Prompt
$function:global:PSConsoleHostReadLine = {
$startProgressIndicator = "`e]9;4;3;50`e\"
$command = $originalPSConsoleHostReadLine.Invoke()
$startProgressIndicator | Write-Host -NoNewLine
$command
}
$function:global:Prompt = {
$stopProgressIndicator = "`e]9;4;0;50`e\"
$stopProgressIndicator | Write-Host -NoNewLine
$originalPrompt.Invoke()
}
@mdgrs-mei
Copy link
Author

mdgrs-mei commented Jun 15, 2023

TerminalSpinner

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment