A pure C single-header library with 90 configurable terminal spinner/progress indicators.
BSD-2-CLAUSE License
libspinner is a C single-headerlibrary that provides terminal spinners and progress indicators to display in the terminal. This is a port of the Go library here.
NOTE: Be sure to call spinner_stop(s)
in any signal handlers or clean up routines so the underlying pthread doesn't leak.
An example can be found in the examples
directory.
make test
(cursor not visible in normal operation)
index | character set | sample gif |
---|---|---|
0 | ←↖↑↗→↘↓↙ |
|
1 | ▁▃▄▅▆▇█▇▆▅▄▃▁ |
|
2 | ▖▘▝▗ |
|
3 | ┤┘┴└├┌┬┐ |
|
4 | ◢◣◤◥ |
|
5 | ◰◳◲◱ |
|
6 | ◴◷◶◵ |
|
7 | ◐◓◑◒ |
|
8 | .oO@* |
|
9 | |/-\ |
|
10 | ◡◡⊙⊙◠◠ |
|
11 | ⣾⣽⣻⢿⡿⣟⣯⣷ |
|
12 | >))'> >))'> >))'> >))'> >))'> <'((< <'((< <'((< |
|
13 | ⠁⠂⠄⡀⢀⠠⠐⠈ |
|
14 | ⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏ |
|
15 | abcdefghijklmnopqrstuvwxyz |
|
16 | ▉▊▋▌▍▎▏▎▍▌▋▊▉ |
|
17 | ■□▪▫ |
|
18 | ←↑→↓ |
|
19 | ╫╪ |
|
20 | ⇐⇖⇑⇗⇒⇘⇓⇙ |
|
21 | ⠁⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈⠈ |
|
22 | ⠈⠉⠋⠓⠒⠐⠐⠒⠖⠦⠤⠠⠠⠤⠦⠖⠒⠐⠐⠒⠓⠋⠉⠈ |
|
23 | ⠁⠉⠙⠚⠒⠂⠂⠒⠲⠴⠤⠄⠄⠤⠴⠲⠒⠂⠂⠒⠚⠙⠉⠁ |
|
24 | ⠋⠙⠚⠒⠂⠂⠒⠲⠴⠦⠖⠒⠐⠐⠒⠓⠋ |
|
25 | ヲァィゥェォャュョッアイウエオカキクケコサシスセソタチツテトナニヌネノハヒフヘホマミムメモヤユヨラリルレロワン |
|
26 | . .. ... |
|
27 | ▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▏▎▍▌▋▊▉█▇▆▅▄▃▂▁ |
|
28 | .oO°Oo. |
|
29 | +x |
|
30 | v<^> |
|
31 | >>---> >>---> >>---> >>---> >>---> <---<< <---<< <---<< <---<< <---<< |
|
32 | | || ||| |||| ||||| |||||| ||||| |||| ||| || | |
|
33 | [] [=] [==] [===] [====] [=====] [======] [=======] [========] [=========] [==========] |
|
34 | (*---------) (-*--------) (--*-------) (---*------) (----*-----) (-----*----) (------*---) (-------*--) (--------*-) (---------*) |
|
35 | █▒▒▒▒▒▒▒▒▒ ███▒▒▒▒▒▒▒ █████▒▒▒▒▒ ███████▒▒▒ ██████████ |
|
36 | [ ] [=> ] [===> ] [=====> ] [======> ] [========> ] [==========> ] [============> ] [==============> ] [================> ] [==================> ] [===================>] |
|
37 | 🌍 🌎 🌏 |
|
38 | ◜ ◝ ◞ ◟ |
|
39 | ⬒ ⬔ ⬓ ⬕ |
|
40 | ⬖ ⬘ ⬗ ⬙ |
|
41 | [>>> >] []>>>> [] [] >>>> [] [] >>>> [] [] >>>> [] [] >>>>[] [>> >>] |
Please feel free to open a PR!
libspinner source code is available under the BSD 2 clause License.