Fork me on GitHub
#cursive
<
2022-09-29
>
Thanh Nguyen09:09:15

Hi. When I try to press "Add as Clojure Deps project", I got a error notification "Cannot execute: Clojure command not configured" from Cursive. What should I do in this case? I fiddled around with the project configurations and stuff, but nothing seems to be the case here

Thanh Nguyen11:09:29

Sorry for not researching more carefully. Basically I have to configure the Build Tool to let Cursive now how to invoke clj. I did it and things seem to work fine now

kwladyka19:09:50

is it possible in Curisve to print something like progress bar, but keeping it updating instead of print new line with each change? something like: 1% which after a while change into 2% instead of 1% 2% 3% …

Ivar Refsdal09:09:59

Yes, that's possible... You can use (str \u001b "[1K") instead of the usual \r and use (str \u001b "[0K") for clear to end of line

Ivar Refsdal09:09:37

Example autoclosable ticker-thingie I've used tor Cursive: https://gist.github.com/ivarref/e50b7906f0e50c2129781c2ec87e7eb2

Ivar Refsdal09:09:48

I did turn it off though, don't remember why.

Ivar Refsdal09:09:37

Code is slightly modified from: https://github.com/ivarref/clj-paginate/blob/main/test/com/github/ivarref/clj_paginate/ticker.clj which have some basic tickers for performance tests

kwladyka20:09:23

Does (str \u001b "[1K") work outside cursive?

Ivar Refsdal16:10:55

Yes I think so

👍 1
cfleming23:10:09

Yes, Cursive interprets a limited set of escape codes.

cfleming23:10:30

It’s far from a full terminal interpreter, but simple cases like this should work ok.

onetom08:10:33

is it any better to use \u001b instead of "\033"? eg:

(def cr
  "Carrige Return as ANSI escape sequence"
  "\033[1K")

(println (str "Hello" cr "World"))

kwladyka19:09:16

I would like to have some progress information when process large data