[os] Simplify and improve `show_spinner` function
[os] Simplify and improve `show_spinner` function

Cherry-picked from
https://github.com/alrra/dotfiles/commit/fbbe5f43fac178c20633f247fb448d371ab9bf79

wingy3181/dotfiles,wingy3181/dotfiles,wingy3181/dotfiles