------------------------------------------------------------------------------- Spinners, Heartbeats, Progress, Waiting, Idle, Loading Indicators Various character sequences that can be used to show a program is working, and has not stalled. That is the program is still working (looping), or is waiting for some input of some kind. Generally when you have no definite 'progress' so you don’t know how much longer it would take... However If you can determine the real 'progress' you can make use of the Progress Bars (see the end of the file) instead. I generally only list sequences of at least 4+ characters (see below)... Many of the following spinners I figured out myself, especially the longer 'clock' and 'cycle' sequences, and are not found in any of the other sources of spinners, though some have probably copied them by now... Definitions I use below... Patrol An animation that moved back-and-forth, like a guard on patrol. The Pacman 'munching spinner is a good example of a patrol animation. Such spinners are often twice as long as normal spinners to animate the 'reverse' sequence, unless specifically coded to handle the 'patrol'. Clock A sequence with 2 'hands' which will 'tick' the slower 'hand' when the first completes a circle back to the starting point. That is there is a defined starting 'position' somewhere in the circle, typically on the top or left side. Cycle Much like a 'clock' this has 2 'hands'. However the slower hand will tick as the faster hand passes over it. As such there is no 'starting position'. The 'cycle' sequence is slightly longer than a 'clock' and while less logical, I found them more graphically pleasing. The longer Braille clock/cycle sequences can show this difference between the two styles a lot clearer. Percentage Bar A real indicator of how far a task has gone (not just a working indicator). This requires you to know in advance a definate 'end point' to the task which is not always posible. That is, show a percentage, of how much has been done, or how full something is. Other Sources of Spinners... https://stackoverflow.com/questions/2685435/cooler-ascii-spinners https://gist.github.com/ellemenno/9489706 https://github.com/sindresorhus/cli-spinners/blob/HEAD/spinners.json https://github.com/sindresorhus/cli-spinners/blob/master/spinners.json It looks like many of these sources copy from each other, which is hardly surprising. And some include multi-character cycles. WARNING: Some of code these 'library' defined spinner providers run the spinner in a separate process, external to the main loop the user use waiting on. This means they are not truly telling the user if the main program (loop) has stalled (and no longer running, while the spinner remains running, only that it believed to be still running, or the machine itself is still running, creating a false response. NOTE: If the terminal is a remote ssh connection, then network delays can cause some fast (longer running) clocks to behave slightly erratic, as update sequences become grouped together in time by network delays. Anthony Thyssen, 19 August 2021 ------------------------------------------------------------------------------- Using a Spinner To really see or understand what many of these look like you need to demonstrate them. This is especially true of some of longer 'Braille' sequences. Perl Spinner/Heartbeat demonstrator (Unicode complaint) perl -CO -Mutf8 -e '$|=1; $c=" ▏▎▍▌▋▊▉█"; while(1){ for $i ($c=~/(.)/g) { print " $i\r"; select(undef,undef,undef,.1+1/length($c)); } };' Python version =======8<-------- import time; while True: for i in "-≻›⟩|⟨‹≺": print(" "+i+"\r", end="") time.sleep(.1) =======8<-------- If there are many choices for a Unicode character in a Spinner, it is often best to select from the same Unicode block for best glyph similarities in different fonts. A Reference for Unicode characters https://antofthy.gitlab.io/info/data/utf8-demo.txt Shell usage example (not Unicode compliant)... =======8<-------- spinner='-\|/'; spinlen=${#spinner} timeout=30 # timeout in seconds printf -v start '%(%s)T' -1 # save the start time while true; do # wait for some condition # if finished... # printf "Condition has been met\r" # success, and clean wait line # break # fi # Timeout check printf -v elapsed '%(%s)T' -1 # current time elapsed=$(( elapsed - start )) # elapsed time if (( elapsed > timeout )); then echo "Timeout waiting for condition" # timeout, and clean wait line break fi # Wait line with spinner... char=$(( (char+1)%spinlen )) printf "Waiting... %c %d sec\r" "${spinner:$char:1}" $elapsed sleep .2 # loop sleep, minimum spin rate done =======8<-------- ------------------------------------------------------------------------------- ASCII Spinner/Heartbeat Character Sequences Replace each character with next, in a loop A patrol is the same sequence going forward then reverse Spinning Line "-\|/" (for coding use... "-\\|/") (This was made famous by Sun Workstations Boot sequence) Pulsing Circle: ".oOo" Balloon: " .oO@*" Flip line: "__\|/__" (for coding "__\\|/__") Flip line (patrol): "__\|/____/|\__" (for coding "__\\|/____/|\\__") Folding Over: "-<|>-" patrol: "->|<--<|>-" Pacman Muncher: "->|>-" Bat and Ball: "dqpb" ------------------------------------------------------------------------------- Unicode Spinner/Heartbeat Character Sequences Unicode Spinning Line "─╲│╱" Better to use ASCII version! Flip Line Quote: "_-`'´-_" I think it could be better! Pacman Muncher: "-≻›⟩›≻-" Folding Over (left-right): "-≻›⟩|⟨‹≺" Folding Over (right-left): "-≺‹⟨|⟩›≻" iFolding Over (patrol): "-≻›⟩|⟨‹≺-≺‹⟨|⟩›≻" Quarter Circle Spinner: "◟◜◝◞" Extended Circle Spinner: "◜◠◝◞◡◟" Corner Circle Spinner: "◴◷◶◵" Half Circle Spinner: "◐◓◑◒" small in some fonts Half Circle Flip: "◡⊙◠⊙" Ellipses: " ․‥…" not very visible Rain Circle: " ⋅∘○⨀" Pulsing Circle "◌○⊙●⊙○" Pulsing Dot: "⋅∙●∙" Pulsing Heart: "⋅•❤•" Pulsing Line: "❘❙❚❙❘" Pulsing Heart: "❘❙❚❤❚❙❘" depends on font Pulsing Square: "▪◼█◼▪" Corners: "⌞⌜⌝⌟" Large Corners: "⎿⎾⏋⏌" Corner Box: "◰◳◲◱" Triangle: "◣◤◥◢" Triangle Pulse: "▫◸◤◸▫◹◥◹▫◿◢◿▫◺◣◺" Triangle Pulse 2: "■◤◸◤■◥◹◥■◢◿◢■◣◺◣" Moving Horizontal Bar: "⎽⎼―⎻⎺ " patrol: "⎽⎼―⎻⎺⎻―⎼" Moving Vertical Bar: "▏⎢⎪⎥▕ " patrol: "▏⎢⎪⎥▕⎥⎪⎢" Tone Bar: "˩˨˧˦˥" patrol: "˩˨˧˦˥˦˧˨" Rising Vertical Bar: "ˌ╷❘ﺍ╵ˈ" Growth & Decay: "․|†¥∨⌄" Pulsing Star: "⋅˖+⟡✧⟡+˖" Pulsing Plus: "⋅˖+┼╋┼+˖" Bouncing Bubble: "'°º¤ø,¸¸,ø¤º°'" Mathematical Equals: "−=≡" Mathematical Compares: "≑≒≑≓" Arrow: "←↖↑↗→↘↓↙" Dingbat Arrow: "➵➴➵➶" bold: "➸➷➸➹" --- Box Graphic Glyphs... Noise Fading: "█▓▒░ " Quarter Block Spinner: "▘▝▗▖" Half Block Spinner: "▄▌▀▐" Quarter Block Worm: "▘▀▝▐▗▄▖▌" Diagonally Moving Block: " ▖◼▝ ▗◼▘" Box Bar Horizontal: " ▏▎▍▌▋▊▉█" patrol: " ▏▎▍▌▋▊▉█▉▊▋▌▍▎▏" Box Bar Vertical: " ▁▂▃▄▅▆▇█" patrol: " ▁▂▃▄▅▆▇█▇▆▅▄▃▂▁" (with some reverse video these can be made fancier) --- Half Lane Glyphs... Half Line Spinner: "╷╴╵╶" Half Line Spinner Bold: "╻╸╹╺" Half Line Spinner Pulsed: "╷╴╹╶" Pulsing Half Line Spinner: "╷╴╵╶╻╸╹╺" Moving Line: "╴━╶ " Rotating Moving Line: "╴━╶╷┃╵╶━╴╵┃╷" Wind-shield Wiper Patrol: "╷╴╵╶╷╷╷╶╵╴╷╷" Pipe Spinner: "┤┘┴└├┌┬┐" Pipe Spinner Bold: "┫┛┻┗┣┏┳┓" Pipe Spinner Mixed: "┤┙┚┴┖┕├┍┎┬┒┑" Two Handed Clock (16): "╹┖╿┚┕╺┍╼╽┎╻┒┙╾┑╸" Two Handed Cycle (20): "╹┖╿┚╹╺┍╼┕╺╻┒╽┎╻╸┙╾┑╸" --- Braille Glyphs... NOTE: Braille Glyphs work well as spinners, but the glyphs are not good when used with most True Type fonts as 'Braille Space', ('⠀') is not blank, but a set of empty circles, making the use of them, even for braille readers, problematical! Braille Circling Dot: "⡀⠄⠂⠁⠈⠐⠠⢀" Braille Circling Hole: "⢿⣻⣽⣾⣷⣯⣟⡿" Braille Twin Circling Dots: "⡈⠔⠢⢁" Braille Leapfrog: "⣀⢄⢂⢁⡈⡐⡠" Braille Bouncing Dot: "⡀⠄⠂⠁⠁⠂⠄" right-side: "⢀⠠⠐⠈⠈⠐⠠" Braille Bounce Side-Side: "⡀⠄⠂⠁⠈⠐⠠⢀⠠⠐⠈⠁⠂⠄" Braille Bouncing Ball: "⣤⠶⠛⠛⠶" Braille Climber: "⣀⡠⠤⠢⠒⠊⠉⠑⠒⠔⠤⢄" Braille Coveyer Belt: "⢸⣸⢼⢺⢹⡏⡗⡧⣇⡇" Braille Up-Down Belt: "⢸⣸⢼⢺⢹⢺⢼⣸⢸⡇⣇⡧⡗⡏⡗⡧⣇⡇" ___Braille 6 dot___ Braille 6 Circle Worm: "⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏" Braille 6 Bounce Worm: "⠄⠆⠇⠋⠙⠸⠰⠠⠰⠸⠙⠋⠇⠆" Braille Zigzag Worm: "⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓" Braille Zigzag Stop: "⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓" Braille 6 Step Left (24): "⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁" Braille 6 Step Right (24): "⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈" Braille 6 Step Both (30): "⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈⠉" Braille Two Dot Clock (top 36): "⠈⠘⠨⠌⠊⠉⠘⠐⠰⠔⠒⠑⠨⠰⠠⠤⠢⠡⠌⠔⠤⠠⠆⠅⠊⠒⠢⠆⠂⠃⠉⠑⠡⠅⠃⠁" Braille Two Dot Clock (left 36): "⠂⠃⠊⠒⠢⠆⠃⠁⠉⠑⠡⠅⠊⠉⠈⠘⠨⠌⠒⠑⠘⠐⠰⠔⠢⠡⠨⠰⠠⠤⠆⠅⠌⠔⠤⠄" Braille Two Dot Cycle (42): "⠂⠃⠊⠒⠢⠆⠂⠁⠉⠑⠡⠅⠃⠁⠈⠘⠨⠌⠊⠉⠈⠐⠰⠔⠒⠑⠘⠐⠠⠤⠢⠡⠨⠰⠠⠄⠆⠅⠌⠔⠤⠄" ___Braille 8 dot___ Braille Circle Worm: "⠋⠙⠹⠸⢰⣰⣠⣄⣆⡆⠇⠏" Braille Bounce Worm: "⡀⡄⡆⠇⠋⠙⠸⢰⢠⢀⢠⢰⠸⠙⠋⠇⡆⡄" Braille Worm Uturn: "⠋⠙⠹⠸⢰⣰⣠⣄⣆⡆⡖⠖⠚⠙⠋⠏⠇⡆⣆⣄⣠⣰⢰⢲⠲" Braille Step Left (36): "⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⢤⣠⣀⢀⢀⣀⣠⢤⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁" Braille Step Right (36): "⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⡤⣄⣀⢀⢀⣀⣄⡤⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈" Braille Step Both (40): "⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⢤⣠⡀⡀⣀⢀⢀⣄⡤⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈⠉" Braille Stacking (40): "⠀⡀⠄⠂⠁⠈⠐⠠⢀⣀⢄⢂⢁⢈⢐⢠⣠⢤⢢⢡⢨⢰⣰⢴⢲⢱⢸⣸⢼⢺⢹⣹⢽⢻⣻⢿⣿⣶⣤⣀" Braille Two Dot Clock (top, 64): "⠈⠘⠨⢈⡈⠌⠊⠉⠘⠐⠰⢐⡐⠔⠒⠑⠨⠰⠠⢠⡠⠤⠢⠡⢈⢐⢠⢀⣀⢄⢂⢁⡈⡐⡠⣀⡀⡄⡂⡁⠌⠔⠤⢄⡄⠠⠆⠅⠊⠒⠢⢂⡂⠆⠂⠃⠉⠑⠡⢁⡁⠅⠃⠁" Braille Two Dot Clock (left, 64): "⠂⠃⠊⠒⠢⢂⡂⠆⠃⠁⠉⠑⠡⢁⡁⠅⠊⠉⠈⠘⠨⢈⡈⠌⠒⠑⠘⠐⠰⢐⡐⠔⠢⠡⠨⠰⠠⢠⡠⠤⢂⢁⢈⢐⢠⢀⣀⢄⡂⡁⡈⡐⡠⣀⡀⡄⠆⠅⠌⠔⠤⢄⡄⠄" Braille Two Dot Cycle (72): "⠂⠃⠊⠒⠢⢂⡂⠆⠂⠁⠉⠑⠡⢁⡁⠅⠃⠁⠈⠘⠨⢈⡈⠌⠊⠉⠈⠐⠰⢐⡐⠔⠒⠑⠘⠐⠠⢠⡠⠤⠢⠡⠨⠰⠠⢀⣀⢄⢂⢁⢈⢐⢠⢀⡀⡄⡂⡁⡈⡐⡠⣀⡀⠄⠆⠅⠌⠔⠤⢄⡄⠄" ------------------------------------------------------------------------------- Special 2 Character, Braille "Circling Dots" Loading Sequence... perl -CO -Mutf8 -e '$|=1; $c="⢀⠀⡀⠀⠄⠀⢂⠀⡂⠀⠅⠀⢃⠀⡃⠀⠍⠀⢋⠀⡋⠀⠍⠁⢋⠁⡋⠁⠍⠉⠋⠉⠋⠉"; $c.="⠉⠙⠉⠙⠉⠩⠈⢙⠈⡙⢈⠩⡀⢙⠄⡙⢂⠩⡂⢘⠅⡘⢃⠨⡃⢐⠍⡐⢋⠠⡋⢀⠍⡁⢋⠁⡋⠁⠍⠉⠋⠉⠋⠉"; $c.="⠉⠙⠉⠙⠉⠩⠈⢙⠈⡙⠈⠩⠀⢙⠀⡙⠀⠩⠀⢘⠀⡘⠀⠨⠀⢐⠀⡐⠀⠠⠀⢀⠀⡀"; while(1){ for $i ($c=~/(..)/g) { print " $i\r"; select(undef,undef,undef,.2); } };' ------------------------------------------------------------------------------- Line Sequences Sonar " . " " o " " (O) " " (( )) " " ((( ))) " "((( )))" "(( ))" "( )" " " Scrolling arrows and bouncing balls are straight forward to implement. The individual characters interchangeable, so I only represent a example frame. They are all reversable and you can mix and match as needed. "▐ ⋅ ▌" "| • |" "( ● )" " ──▷ " " ══➤ " " ──➤ " " ⋅•● " " ⸫⸪>=- " "▹▸▹▹▹" "▰▰▰▱▱▱▱▱▱" " ● " "⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⣺" Braille dots falling into a stack (tetris-like) More complex to implement "▐⠀⠀⠁⠂⠄⡀⠄⠀⠀▌" Bouncing like a game "Pong" (bad with true type fonts) "______|\___" Shark fin swiming back and forth Also see Bar Graphing, next... ------------------------------------------------------------------------------- Precentage Bar, Prograss Bars, and Bar Chart... These are not spinners, but used for generating horizontal bar graphs. Or for reporting actual progress of a task that has a known 'end'. See Unicode percent script https://antofthy.gitlab.io/software/#percent_utf ASCII Only "-" "=", "#" "▒" (single character graphs) ASCII Seq "-=#" (not great) Hash Chars "░▒▓█" Half chars "▌█", Quarter chars "▖▌▛█" Incremental "▏▎▍▌▋▊▉█" <--- the ideal 8 character increment bargraph Braille chars "⡀⡄⡆⡇⣇⣧⣷⣿" braille character in 8 increments (quite good) -------------------------------------------------------------------------------