------------------------------------------------------------------------------- Spinners, Heartbeats, Throbber, 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 used when you have no definite 'progress' so you don’t know how much longer it would take. If you can determine the real 'progress' you can make use of the Progress Bars (see the end of the file) instead. These traditionally take the form of a character sequence that 'spin' on the spot, or 'circle' in some way so as to repeat. See Wikipedia, Throbber https://en.wikipedia.org/wiki/Throbber Many of the following spinners I figured out myself, especially the longer 'clock' and 'cycle' sequences, which are not found in any of the other sources of spinners, though some have probably copied into them by now... Definitions I use below... Patrol An animation that moves 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 'start 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 the difference between Clock and Cycle a lot clearer. Progress Bar A indicator of how far a task has gone (not just a working indicator). This requires you to know in advance a definite 'end point' to the task which is not always possible. 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://github.com/sindresorhus/cli-spinners/blob/master/spinners.json https://gist.github.com/ellemenno/9489706 It looks like many of these sources copy from each other, which is hardly surprising. And some include multi-character cycles. WARNING: Some spinners are coded into a 'library' which then run the spinner AS 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, as the spinner could remain running. That is the coded library only believes the main process is still running, or the machine itself is still running, creating a false report to the user! 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 by network delays. Anthony Thyssen , 19 August 2021 Last updated 23 April 2024 ------------------------------------------------------------------------------- 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): "-≺‹⟨|⟩›≻" Folding 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 Circle Tail b: "bᓂqᓄ" not in xterm fonts Circle Tail d: "dᓇpᓀ" Rain Circle: " ⋅∘○⨀" Pulsing Circle "◌○⊙●⊙○" Pulsing Dot: "⋅∙●∙" Pulsing Heart: "⋅•❤•⋅⋅⋅" Pulsing Line: "❘❙❚❙" Pulsing Line Heart: "❘❙❚❤❚❙❘" depends on font Pulsing Square: "▪◼█◼▪" Pulsing Square 2: "▪■□▫" 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: "≑≒≑≓" I-Ching: "☱☲☴" Arrow: "←↖↑↗→↘↓↙" Dingbat Arrow: "➵➴➵➶" Dibbat Bold Arrows: "➸➷➸➹" -- Pulsing (two character)... Squish: "╫╪" Toggle Line: "⊶⊷" Toggle Sm Box: "▫▪" Toggle Lg Box: "□■" Toggle Shogi "☖☗" --- 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! It was a bad design choice by font foundaries. Braille Circling Dot: "⡀⠄⠂⠁⠈⠐⠠⢀" Braille Circling Dot Db: "⣀⡄⠆⠃⠉⠘⠰⢠" Braille Circling Hole: "⢿⣻⣽⣾⣷⣯⣟⡿" Braille Circling Hole Db: "⣶⣧⣏⡟⠿⢻⣹⣼" 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: "⢸⣸⢼⢺⢹⢺⢼⣸⢸⡇⣇⡧⡗⡏⡗⡧⣇⡇" Falling Sand (35): "⠁⠂⠄⡀⡈⡐⡠⣀⣁⣂⣄⣌⣔⣤⣥⣦⣮⣶⣷⣿⡿⠿⢟⠟⡛⠛⠫⢋⠋⠍⡉⠉⠑⠡⢁" ___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): "⠂⠃⠊⠒⠢⢂⡂⠆⠂⠁⠉⠑⠡⢁⡁⠅⠃⠁⠈⠘⠨⢈⡈⠌⠊⠉⠈⠐⠰⢐⡐⠔⠒⠑⠘⠐⠠⢠⡠⠤⠢⠡⠨⠰⠠⢀⣀⢄⢂⢁⢈⢐⢠⢀⡀⡄⡂⡁⡈⡐⡠⣀⡀⠄⠆⠅⠌⠔⠤⢄⡄⠄" ------------------------------------------------------------------------------- Emoji Spinners... Circle Lines: "㊀㊁㊂" Hour Clock: "🕛🕐🕑🕒🕓🕔🕕🕖🕗🕘🕙🕚" Earth: "🌍🌎🌏" Moon Phases: "🌑🌒🌓🌔🌕🌖🌗🌘" Runner: "🚶🏃" Speaker: "🔈🔉🔊🔉" ------------------------------------------------------------------------------- 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. "▐ ⋅ ▌" "| • |" "( ● )" " ──▷ " " ══➤ " " ──➤ " " ⋅•● " " ⸫⸪>=- " "▹▸▹▹▹" "▰▰▰▱▱▱▱▱▱" " ● " "▐⠀⠀⠁⠂⠄⡀⠄⠀⠀▌" Bouncing like a game "Pong" (bad with true type fonts) "______|\___" Shark fin swiming back and forth Braille dots falling into a stack (tetris-like) Quite complex to implement, but would be a interesting exercise. "⠀⠀⠀⠀⠄⠀⠀⠀⠀⠀⣺" Also see Bar Graphing, next... ------------------------------------------------------------------------------- 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 Single Char "-" "=" "#" "▒" (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) The 'Incremental' is ideal with 8 increments per characters. As such in a 50 character percentage bar, each increment represents a ¼% On the other hand 'Half Chars' over 50 characters is 1% per increment. -------------------------------------------------------------------------------