Skip to content

Commit 387c418

Browse files
committed
⬆️ Upgrade dependency and fix fallout
1 parent 1319d7b commit 387c418

File tree

4 files changed

+9
-16
lines changed

4 files changed

+9
-16
lines changed

deps.edn

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
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}}}

src/progress/ansi.clj

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,11 @@
2222

2323
(def available?
2424
"Are ANSI escape sequences available on this JVM's stdout?"
25-
(case (.name (.getType (org.fusesource.jansi.AnsiConsole/out)))
25+
(case (.name (.getType (org.jline.jansi.AnsiConsole/out)))
2626
"Unsupported" false
2727
"Redirected" false
2828
true))
2929

30-
(defn terminal-width
31-
"The width, in display columns, of the terminal window this JVM is running in.
32-
Returns `nil` if the width cannot be determined."
33-
[]
34-
(let [w (org.fusesource.jansi.AnsiConsole/getTerminalWidth)]
35-
(when (pos? w)
36-
w)))
37-
3830
(defn save-cursor!
3931
"Issues both SCO and DEC save-cursor ANSI codes, for maximum compatibility."
4032
[]

src/progress/determinate.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
{:keys [style label line width total units counter? preserve? redraw-rate]
236236
:or {style (get styles default-style)
237237
total 100
238-
width (if-let [w (ansi/terminal-width)]
238+
width (if-let [w (jansi/terminal-width)]
239239
(- w 2) ; Allow space for the cursor
240240
72)
241241
counter? true

test/progress/indeterminate_test.clj

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@
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

0 commit comments

Comments
 (0)