This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
i'm trying to shell out to something that uses an ncurses-like library, but it's not rendering the text UI, e.g. (shell/sh "gum" "choose" "a" "b" "c")
afaik, that's essentially a limitation of sh - inheritting the IO streams should resolve that, but I don't think there's a trivial way to do so with clojure.java.shell/sh
- with that said, babashka.process/shell
does it by default
and for gum specifically, <https://github.com/lispyclouds/bblgum> wraps the calls if you don't want to deal with the shell layer at all
This is much better than i thought it was going to be as a bash replacement, finally drank the kool-aid, 10 mins in i'm already more productive than a lifetime of bash scripting.
You can also change babashka.process/*defaults*
and change the :pre-start-fn
to print the command, but alter-var-root also works :)
trying to implement function die()
with System/exit, but be able to test it in the nREPL session
i'll just eval (defn abort [code] (throw (RuntimeException. "abort called")))
when i start a REPL session
my pre-start-fn
seems to only be called for p/shell, not p/exec, (either that or it's just not flushing the STDOUT in time for exec)
(alter-var-root #'p/*defaults* assoc :pre-start-fn (fn [{:keys [cmd]}]
(when *verbose?* (apply println "++" cmd) (flush))))
@U0J3J79FE which version of bb do you have installed?
i don't think its being called
(alter-var-root #'p/*defaults* assoc :pre-start-fn (fn [{:keys [cmd]}]
(when *verbose?* (apply println "++" cmd)
(flush)
(Thread/sleep 10000))))
have to go for an appt in 5 mins, but i'll be back in ~2 hours, thanks for debugging this!