nrebl.middleware
nrebl.middleware copied to clipboard
Managed REBL window
Running REBL from within CIDER opens a new JavaFX window that is not recognized and managed by MacOS. As a result, after switching windows via cmd+tab
one cannot find it again via cmd+tab
.
If I start REBL via (1), then there is a managed Java window one can correctly cmd+tab
to.
If I start REBL via (2), then there is a headless Java window.
Interestingly, if I start an nrepl session (3), and run (cognitect.rebl/-main)
, it also will start a headless Java window.
;; (1)
clj -A:rebl -m cognitect.rebl
;; (2)
clj -A:nrepl:cider:rebl -m nrepl.cmdline --middleware '[nrebl.middleware/wrap-nrebl cider.nrepl/cider-middleware]'
;; (3)
clj -A:nrepl:cider:rebl -m nrepl.cmdline --middleware '[nrebl.middleware/wrap-nrebl cider.nrepl/cider-middleware]' --interactive
(require 'cognitect.rebl)
(cognitect.rebl/-main)
I believe this lands outside the scope of support the author of this middleware is able to provide. Please consider raising this issue on Cognitect's REBL repo issues as it effects any invocation of (cognitect.rebl/ui)
.
I've been looking into this issue further and it looks like the problem is in ciders wrap-debug middleware. Not sure exactly what causes it but by bisecting the middlewares you can see that this fails:
$ clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/wrap-debug]" -i
nREPL server started on port 58662 on host localhost - nrepl://localhost:58662
nREPL 0.6.0
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_191-b12
Interrupt: Control+C
Exit: Control+D or (exit) or (quit)
user=> (require 'clojure.inspector)
nil
user=> (clojure.inspector/inspect {:a :b})
#object[javax.swing.JFrame 0x17a01b0c "javax.swing.JFrame[frame0,0,23,400x400,invalid,layout=java.awt.BorderLayout,title=Clojure Inspector,resizable,normal,defaultCloseOperation=HIDE_ON_CLOSE,rootPane=javax.swing.JRootPane[,0,22,400x378,invalid,layout=javax.swing.JRootPane$RootLayout,alignmentX=0.0,alignmentY=0.0,border=,flags=16777675,maximumSize=,minimumSize=,preferredSize=],rootPaneCheckingEnabled=true]"]
Where as this works (the middlewares are all that are included in cider-middleware
except wrap-debug
):
clj -Sdeps '{:deps {cider/cider-nrepl {:mvn/version "0.21.1"}}}' -m nrepl.cmdline --middleware "[cider.nrepl/wrap-ns,cider.nrepl/wrap-spec,cider.nrepl/wrap-profile,cider.nrepl/wrap-refresh,cider.nrepl/wrap-resource,cider.nrepl/wrap-stacktrace,cider.nrepl/wrap-test,cider.nrepl/wrap-trace,cider.nrepl/wrap-out,cider.nrepl/wrap-undef,cider.nrepl/wrap-version,cider.nrepl/wrap-format,cider.nrepl/wrap-info,cider.nrepl/wrap-inspect,cider.nrepl/wrap-macroexpand,cider.nrepl/wrap-apropos,cider.nrepl/wrap-classpath,cider.nrepl/wrap-complete]" -i
nREPL server started on port 59408 on host localhost - nrepl://localhost:59408
nREPL 0.6.0
Clojure 1.10.0
Java HotSpot(TM) 64-Bit Server VM 1.8.0_191-b12
Interrupt: Control+C
Exit: Control+D or (exit) or (quit)
user=> (require 'clojure.inspector)
nil
user=> (clojure.inspector/inspect {:a :b})
I filed more on this issue here earlier today: https://github.com/clojure-emacs/cider-nrepl/issues/610
Still not sure of root cause
This behaviour seems to fixed (or at least better) if you run on JDK 12 (maybe 9, 10 or 11 too). I've tried it only on the adoptopenjdk 12 build.