- 
      
- 
        Save forsgren/81a353b9509e4484bf419d10e9c1e3be to your computer and use it in GitHub Desktop. 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #!/usr/bin/env zsh | |
| sleep 10 &! | |
| pid=$! # Process Id of the previous running command | |
| spin='⠋⠙⠚⠞⠖⠦⠴⠲⠳⠓' | |
| i=0 | |
| while kill -0 $pid 2>/dev/null; do | |
| i=$(((i + 1) % 10)) | |
| printf "$fg[magenta]\r${spin:$i:1}" | |
| printf "$fg[white] Waiting..." | |
| sleep .1 | |
| done | |
| printf "\r$fg[green]✓\n" | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment