Skip to content

Instantly share code, notes, and snippets.

@mitchellh
Created July 23, 2025 23:40
Show Gist options
  • Select an option

  • Save mitchellh/73777dc99c3ba6d3393690d01a6bd93a to your computer and use it in GitHub Desktop.

Select an option

Save mitchellh/73777dc99c3ba6d3393690d01a6bd93a to your computer and use it in GitHub Desktop.

Revisions

  1. mitchellh created this gist Jul 23, 2025.
    28 changes: 28 additions & 0 deletions progress.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@
    #!/usr/bin/env bash

    counter=1
    echo "demo: error state"
    while [ $counter -le 25 ]; do
    printf "\x1b]9;4;2;${counter}\x07"
    ((counter++))
    sleep 0.1
    done
    echo "demo: normal state"
    while [ $counter -le 50 ]; do
    printf "\x1b]9;4;1;${counter}\x07"
    ((counter++))
    sleep 0.1
    done
    echo "demo: pulsing"
    while [ $counter -le 75 ]; do
    printf "\x1b]9;4;3\x07"
    ((counter++))
    sleep 0.1
    done
    echo "demo: normal state"
    while [ $counter -le 100 ]; do
    printf "\x1b]9;4;1;${counter}\x07"
    ((counter++))
    sleep 0.1
    done
    printf "\x1b]9;4;0\x07"