File tree Expand file tree Collapse file tree 6 files changed +17
-13
lines changed
Expand file tree Collapse file tree 6 files changed +17
-13
lines changed Original file line number Diff line number Diff line change 99;
1010
1111{:deps
12- {jansi-clj/jansi-clj {:mvn/version " 1 .0.5 " }
12+ {jansi-clj/jansi-clj {:mvn/version " 2 .0.0 " }
1313 com.github.pmonks/clj-wcwidth {:mvn/version " 1.0.125" }
14- com.github.pmonks/embroidery {:mvn/version " 1.0.44" }
15-
16- ; Force the latest version of JANSI, since jansi-clj is out of date
17- org.fusesource.jansi/jansi {:mvn/version " 2.4.2" }}
14+ com.github.pmonks/embroidery {:mvn/version " 1.0.44" }}
1815 :aliases
1916 {:build {:deps {com.github.pmonks/pbr {:mvn/version " RELEASE" }}
2017 :ns-default pbr.build}}}
Original file line number Diff line number Diff line change 11Require clojure
22Output spinner-demo.gif
33Sleep 50ms
4- Type "clojure -M demo.clj"
4+ Type "clojure -J--enable-native-access=ALL-UNNAMED - M demo.clj"
55Sleep 250ms
66Enter
77Wait@90s
Original file line number Diff line number Diff line change 1010
1111(ns progress.ansi
1212 " Handy ANSI related functionality. Note: requiring this namespace has the side
13- effect of enabling [JANSI](https://github.com/fusesource/jansi?tab=readme-ov-file#example-usage)."
13+ effect of enabling [JANSI](https://github.com/fusesource/jansi?tab=readme-ov-file#example-usage).
14+
15+ Note:
16+
17+ * "
1418 (:require [clojure.string :as s]
1519 [jansi-clj.core :as jansi]))
1620
1721(jansi/enable! )
1822
1923(def available?
2024 " Are ANSI escape sequences available on this JVM's stdout?"
21- (case (.name (.getType (org.fusesource .jansi.AnsiConsole/out )))
25+ (case (.name (.getType (org.jline .jansi.AnsiConsole/out )))
2226 " Unsupported" false
2327 " Redirected" false
2428 true ))
Original file line number Diff line number Diff line change 235235 {:keys [style label line width total units counter? preserve? redraw-rate]
236236 :or {style (get styles default-style )
237237 total 100
238- width (let [console-width (org.fusesource.jansi.AnsiConsole/getTerminalWidth )]
239- (if (pos? console-width)
240- (- console-width 2 ) ; Allow space for the cursor
241- 72 ))
238+ width (if-let [w (jansi/terminal-width )]
239+ (- w 2 ) ; Allow space for the cursor
240+ 72 )
242241 counter? true
243242 preserve? false
244243 redraw-rate 10 }}
Original file line number Diff line number Diff line change 1616 [progress.indeterminate :as pi]))
1717
1818(jansi/erase-screen! )
19- (println " \n ☔️ Running tests on Clojure" (clojure-version ) " / JVM" (System/getProperty " java.version" ) (str " (" (System/getProperty " java.vm.name" ) " v" (System/getProperty " java.vm.version" ) " )" ))
19+
20+ (println " \n ☔️ Running tests on Clojure" (clojure-version )
21+ " / JVM" (System/getProperty " java.version" ) (str " (" (System/getProperty " java.vm.name" ) " " (System/getProperty " java.vm.version" ) " )" )
22+ " / ANSI escape sequences available?" (if ansi/available? " ✅" (str " ❌ (" (.name (.getType (org.jline.jansi.AnsiConsole/out ))) " )" )))
23+
2024(println
2125 (jansi/yellow-bg-bright
2226 (jansi/red
You can’t perform that action at this time.
0 commit comments