def start
import ezx@1.11.0.0/src/share/spin.bend as Spinimport Base
import snap@1.4.0.0/main.bend as R
import ezx@1.11.0.0/src/share/say.bend as Say
24# the mark, when there is a terminal to draw it on
25def start(on: Bool, +dev: String, +msg: String) -> IO(Say.Spin):
26 match on:
27 case False{}:
28 IO.pure(Say.Spin, Say.Spin{"", "", ""})
29 case True{}:
30 do IO<Say.Spin>:
31 +pid : String <- R.start(["sh", "-c", Say.frames(), "sh", dev, msg])
32 return Say.Spin{dev, String.trim(pid), msg}