This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2021-11-24
Channels
- # announcements (4)
- # asami (5)
- # babashka (20)
- # beginners (94)
- # bristol-clojurians (1)
- # calva (23)
- # cider (2)
- # clj-commons (3)
- # clj-kondo (43)
- # cljfx (2)
- # cljs-dev (13)
- # clojure (112)
- # clojure-dev (44)
- # clojure-europe (17)
- # clojure-nl (5)
- # clojure-poland (12)
- # clojure-spec (2)
- # clojure-uk (3)
- # clojurebridge (1)
- # clojurescript (92)
- # cursive (17)
- # data-science (8)
- # datahike (1)
- # datalevin (1)
- # datomic (3)
- # deps-new (7)
- # events (2)
- # fulcro (40)
- # graalvm (110)
- # holy-lambda (16)
- # introduce-yourself (1)
- # lsp (13)
- # malli (8)
- # missionary (12)
- # off-topic (10)
- # pathom (13)
- # polylith (10)
- # portal (28)
- # re-frame (37)
- # reitit (1)
- # releases (1)
- # shadow-cljs (30)
- # spacemacs (1)
- # tools-deps (9)
- # xtdb (10)
I wonder if bb should add some things from clojure 1.11 already. Since it's alpha there is a risk of breaking changes.
If I'm launching a UI application, is there a way for me to avoid having it killed in case I have to kill the script?
(process/process ["gedit"])
(-> (async/alts!! [(async/thread (loop [] (Thread/sleep 1000) (recur)))]))
I also tried running with nohup and other methods.
@thomascpendergrast use (process/process ["gedit"] {:shutdown process/destroy-tree})
process/process
doesn't actively kill child processes, nor does Java I think, but perhaps gedit checks if the parent process is still alive and then kills itself? I don't know
@thomascpendergrast you can use ["open" "gedit"]
probably to keep running gedit after the script has finished running
hmm.. that works with a filename, not a program. but it gets killed anyway if I use ["xdg-open" "1.txt"]
I also tried with ["xdg-open" "1.txt" "&"]
but I guess that doesn't work from babashka.process (I'm getting unexpected argument '$', if I read the error stream)
the weird thing is that even if I try regular bash scripts that I use to make sure a launched program isn't terminated if the terminal is killed, it still gets killed if invoked from babashka
another unrelated question, how can I invoke a function from something on the classpath. Similar to the classpath examples in the docs, but no with --main just a regular script or with -e.
I tried adding another function to a set-up like the example but:
bb --classpath scripts -e '(my.namespace/foo)'
fails with:
Could not resolve symbol: my.namespace/foo
@thomascpendergrast you first have to require
a namespace before it gets loaded. but actually you can run a function with -m
this way too: -m my.namespace/foo