Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Managed REBL window #2

Open
pithyless opened this issue Dec 10, 2018 · 4 comments
Open

Managed REBL window #2

pithyless opened this issue Dec 10, 2018 · 4 comments

Comments

@pithyless
Copy link

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)
@jaidetree
Copy link

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).

@RickMoynihan
Copy link
Owner

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})

@RickMoynihan
Copy link
Owner

I filed more on this issue here earlier today: clojure-emacs/cider-nrepl#610

Still not sure of root cause

@RickMoynihan
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants