# How to print rotating ◓-\>tick as progress bar in terminal?

**URL:** https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099
**Category:** New to Julia
**Tags:** question
**Created:** [May 30, 2021, 7:18pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099 "2021-05-30T19:18:14Z")
**Posts on this page:** 8
**Page:** 1

<div class="post-metadata">

### Author: ![yingqiuz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yingqiuz/32/25165_2.png) [@yingqiuz](https://discourse.julialang.org/u/yingqiuz)
#### Post date: [May 30, 2021, 7:18pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/1 "2021-05-30T19:18:15Z")

</div>

Hi all

I’m looking into progress bar options for Julia. Many packages, during installation, show a rotating ◓ becoming a tick when finished. Anyone can help how to print out this dynamic symbol?

Thanks a lot!

---

<div class="post-metadata">

### Author: ![carstenbauer](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/carstenbauer/32/4981_2.png) [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)
#### Post date: [May 30, 2021, 7:21pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/2 "2021-05-30T19:21:27Z")

</div>

Not the rotating symbol but [GitHub - timholy/ProgressMeter.jl: Progress meter for long-running computations](https://github.com/timholy/ProgressMeter.jl) offers a progress bar.

---

<div class="post-metadata">

### Author: ![contradict](https://avatars.discourse-cdn.com/v4/letter/c/ac91a4/32.png) [@contradict](https://discourse.julialang.org/u/contradict)
#### Post date: [May 30, 2021, 8:11pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/3 "2021-05-30T20:11:26Z")

</div>

Looks like it is mixed in with the precompile monitoring logic, but the list of characters is easy to grab:

> <https://github.com/JuliaLang/Pkg.jl/blob/9f67253529c72753cbfbb0078a80717f6c9bd90f/src/API.jl#L1121>

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 30, 2021, 8:33pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/4 "2021-05-30T20:33:17Z")

</div>

See also this issue to add spinner animations to ProgressMeter.jl, which links to some sample code: [Different ProgressBar styles? · Issue #92 · timholy/ProgressMeter.jl · GitHub](https://github.com/timholy/ProgressMeter.jl/issues/92)

---

<div class="post-metadata">

### Author: ![yingqiuz](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yingqiuz/32/25165_2.png) [@yingqiuz](https://discourse.julialang.org/u/yingqiuz)
#### Post date: [May 30, 2021, 8:53pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/5 "2021-05-30T20:53:52Z")

</div>

Thank you, it is very helpful.

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [May 30, 2021, 10:47pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/6 "2021-05-30T22:47:33Z")

</div>

> [@carstenbauer](#):
>
> Not the rotating symbol

A PR to support rotating “spinners” in ProgressMeter.jl is here: [add spinner option to ProgressUnknown by stevengj · Pull Request #206 · timholy/ProgressMeter.jl · GitHub](https://github.com/timholy/ProgressMeter.jl/pull/206)

---

<div class="post-metadata">

### Author: ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)
#### Post date: [June 1, 2021, 12:00pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/7 "2021-06-01T12:00:36Z")

</div>

With the latest version of ProgressMeter (1.7.1), you can now just pass `spinner=true` when creating a `ProgressUnknown` meter. For example:

```julia
prog = ProgressUnknown("Working hard:", spinner=true)
while true
    ProgressMeter.next!(prog)
    rand(1:2*10^8) == 1 && break
end
ProgressMeter.finish!(prog)

```

---

<div class="post-metadata">

### Author: ![Ashlin\_Harris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ashlin_harris/32/210166_2.png) [@Ashlin\_Harris](https://discourse.julialang.org/u/Ashlin_Harris)
#### Post date: [February 1, 2023, 3:27pm UTC](https://discourse.julialang.org/t/how-to-print-rotating-tick-as-progress-bar-in-terminal/62099/8 "2023-02-01T15:27:21Z")

</div>

Another (somewhat silly) way to draw a spinner:

```julia
command = "
  t=Threads.@async read(stdin, Char)
  while !istaskdone(t)
    for q=['◒','◐','◓','◑']
      print(q)
      sleep(0.1)
      print('\b')
    end
  end
";
let
  proc_input = Pipe();
  proc = run(pipeline(`julia -e $command`, stdin = proc_input, stdout = stdout, stderr = stderr), wait = false)
  sleep(2)
  write(proc_input,'c') #Signal the spinner process to stop
  while(process_running(proc))
    sleep(0.1)
  end
end

```

The spinner is drawn by shelling out to an external Julia process, which has its downsides, but it can update completely independently of the main process. I could never get `kill()` to work here, so the spinner process just runs until it reads something from its `stdin`.
