This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-06-17
Channels
- # announcements (4)
- # babashka (22)
- # beginners (50)
- # biff (2)
- # calva (4)
- # cider (18)
- # clj-kondo (12)
- # cljs-dev (3)
- # clojars (2)
- # clojure (66)
- # clojure-austin (1)
- # clojure-belgium (11)
- # clojure-europe (90)
- # clojure-hungary (5)
- # clojure-norway (6)
- # clojure-switzerland (1)
- # clojure-uk (4)
- # clojurescript (19)
- # datascript (2)
- # datomic (41)
- # fulcro (4)
- # gratitude (2)
- # helix (20)
- # jackdaw (2)
- # jobs (9)
- # jobs-discuss (38)
- # kaocha (1)
- # minecraft (8)
- # off-topic (11)
- # polylith (21)
- # rdf (2)
- # remote-jobs (1)
- # sci (1)
- # shadow-cljs (12)
- # specter (7)
- # tools-deps (16)
when I run cider-jack-in-cljs
, and using the built in browser REPL, is there a way to tell it to open a different browser (or give me a chance to copy URL to the clipboard) instead of opening the default browser
I’ve been using https://www.choosyosx.com/ for this, so would love a simpler solution
in cider.el
(browser "(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env)))")
we can pass {:launch-browser false}
to the repl-env
call thereSince it’s just calling browse-url
, I think there’s some ability to customize a var there
This looks promising — https://assortedarray.com/posts/browse-url-sites-custom/
here's what I added to my .spacemacs
config
(defun spacemacs/user-config ()
,,,
(with-eval-after-load 'cider
(cider-register-cljs-repl-type
'browser-no-open
"(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env :launch-browser false)))")))
after the nREPL server is launched and connected, the REPL buffer has the URL in it that I can copy paste into Chrome
there’s also
(defcustom cider-offer-to-open-cljs-app-in-browser t
"When nil, do not offer to open ClojureScript apps in a browser on connect."
:type 'boolean
:safe #'booleanp
:version '(cider . "0.15.0"))
not sure if you’re also hitting that?you can see the snippet i pasted above, (repl-env) is called with no arguments meaning that it is actually CLJS that opens the browser, not CIDER
i think it would be great for CIDER to add the prompt to the browser REPL type, but my elisp-fu is quite weak
here's what I added to my .spacemacs
config
(defun spacemacs/user-config ()
,,,
(with-eval-after-load 'cider
(cider-register-cljs-repl-type
'browser-no-open
"(do (require 'cljs.repl.browser) (cider.piggieback/cljs-repl (cljs.repl.browser/repl-env :launch-browser false)))")))