Reputation: 18005
I am wondering if there is a way to have the output of the current execution in emacs cider when using cider-connect
.
For instance :
I run lein repl
on a project directory
then connect to it in emacs using cider-connect
.
Now let's say that I have (println "cider is amazing by the way")
in the code of one of my ring handlers, this will only be printed in the console I ran lein repl
when a request is made.
How can I have this output also in my nrepl
buffer ?
Upvotes: 3
Views: 1134
Reputation: 91617
Sorry to say, I suspect that you cannot do this in the way you describe. The output is going strait to the console of that device and not through anything related to nrepl on the way. This also makes sense if you consider that nrepl is often not even running on the same computer. (the "n" in nrepl is for "network").
Perhaps you can arrange for that output to be tee
d to a file where you can get at it? Then you could start a thread on your nrepl buffer that cat
ed that file. Or have a buffer in emacs that watches the remote file.
Upvotes: 2
Reputation: 3504
If you start leiningen via cider-jack-in
you should get the output in the repl buffer.
One way to use this with a remote setup could be to call C-u M-x cider-jack-in
and use a specialized server command that will essentially trigger the lein repl
command (say over ssh) on the remote machine -- I haven't checked whether this will actually work, but I don't see any reason why it shouldn't. If you can access the code over tramp, it shouldn't matter much whether the code is remote or not.
Upvotes: 0