Placing this here for Windows people to fill in more details.
So what i could gather is that the jack-in execute the same command that is described in the wiki.
lein update-in :dependencies conj "[nrepl \"0.6.0\"]" -- update-in :dependencies conj "[cider/piggieback \"0.4.1\"]" -- update-in :dependencies conj "[figwheel-sidecar \"0.5.19-SNAPSHOT\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.21.1\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.piggieback/wrap-cljs-repl\"]" -- repl
When i execute this in the powershell this is the result:
java.lang.RuntimeException: Unsupported escape character: \]
at clojure.lang.Util.runtimeException (Util.java:221)
clojure.lang.LispReader$StringReader.invoke (LispReader.java:607)
clojure.lang.LispReader.read (LispReader.java:285)
clojure.lang.LispReader.readDelimitedList (LispReader.java:1398)
clojure.lang.LispReader$VectorReader.invoke (LispReader.java:1347)
clojure.lang.LispReader.read (LispReader.java:285)
clojure.lang.LispReader.read (LispReader.java:216)
clojure.lang.LispReader.read (LispReader.java:205)
clojure.lang.RT.readString (RT.java:1874)
clojure.lang.RT.readString (RT.java:1869)
clojure.core$read_string.invokeStatic (core.clj:3815)
clojure.core$read_string.invoke (core.clj:3805)
clojure.core$mapv$fn__8430.invoke (core.clj:6912)
clojure.core.protocols$fn__8144.invokeStatic (protocols.clj:168)
clojure.core.protocols/fn (protocols.clj:124)
clojure.core.protocols$fn__8099$G__8094__8108.invoke (protocols.clj:19)
clojure.core.protocols$seq_reduce.invokeStatic (protocols.clj:31)
clojure.core.protocols$fn__8131.invokeStatic (protocols.clj:75)
clojure.core.protocols/fn (protocols.clj:75)
clojure.core.protocols$fn__8073$G__8068__8086.invoke (protocols.clj:13)
clojure.core$reduce.invokeStatic (core.clj:6828)
clojure.core$mapv.invokeStatic (core.clj:6903)
clojure.core$mapv.invoke (core.clj:6903)
leiningen.update_in$parse_args.invokeStatic (update_in.clj:13)
But when i change the command like this:
lein update-in :dependencies conj '[nrepl \"0.6.0\"]' -- update-in :dependencies conj '[cider/piggieback \"0.4.1\"]' -- update-in :dependencies conj '[figwheel-sidecar \"0.5.18\"]' -- update-in :plugins conj '[cider/cider-nrepl \"0.21.1\"]' -- update-in '[:repl-options :nrepl-middleware]' conj '[\"cider.nrepl/cider-middleware\"]' -- update-in '[:repl-options :nrepl-middleware]' conj '[\"cider.piggieback/wrap-cljs-repl\"]' -- repl
It works then. The only thing i changed was using single-quotes instead of double.
Thanks. Do single quotes work in the regular cmd.exe or does it need to be different between it and PowerShell?
No there i get the java.lang.RuntimeException: EOF while reading Exception.
Hmm, so how many windows scenarios are there?
4 i would say:
For 4 and 1 you can use double quotes. For 3 i have no idea but would guess double quote works there too. Only exception seems to be powershell.
So, the EOF while reading only happens if you use single quotes there?
3 is the same as WSL?
Yes to both :).
What determines if the jack-in is performed by one or the other of these? Are there vscode settings for this?
I am trying to figure out how to tell what quoting to use.
Alternatively, how to instruct the user to start Calva for it to work.
This is the setting: terminal.integrated.shell.windows
Here the doc from vs-code.
https://code.visualstudio.com/docs/editor/integrated-terminal#_configuration
So, if you manipulate that setting the jack-in task is affected?
Hi. When I try to use the jack-in feature on Windows 10, I'm getting the following error. I'm not sure if this is related, but it looks like it may be.
> Executing task: C:\Users\MyUserName\bin\lein.bat update-in :dependencies conj "[nrepl \"0.6.0\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.21.1\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- repl :headless <
/d : The term '/d' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ /d /c C:\Users\MyUserName\bin\lein.bat update-in :dependencies conj [nre ...
+ ~~
+ CategoryInfo : ObjectNotFound: (/d:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
The terminal process terminated with exit code: 1
Terminal will be reused by tasks, press any key to close it.
Update: Using single quotes worked for me as well.
I spent some time trying to come up with a format that would work at least in both powershell and cmd, and unfortunately could not get anything to work. So it seems the best method would be, as stated above, read the terminal environment and output the appropriate command.
I'm also using Windows and encountered the EOF issue. Here's the full log:
> Executing task: C:\Users\felix\bin\cmd\lein.bat update-in :dependencies conj "[nrepl \"0.6.0\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.21.1\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- repl :headless <
java.lang.RuntimeException: EOF while reading
Interestingly, if i paste the upper command into cmd, it works fine. It I paste it into the powershell, I get a different error:
PS C:\Users\felix\git\event-data> C:\Users\felix\bin\cmd\lein.bat update-in :dependencies conj "[nrepl \"0.6.0\"]" -- update-in :plugins conj "[cider/cider-nrepl \"0.21.1\"]" -- update-in "[:repl-options :nrepl-middleware]" conj "[\"cider.nrepl/cider-middleware\"]" -- repl :headless
java.lang.RuntimeException: Unsupported escape character: \]
This would indicate to me that it is a problem with the vs-code task runner and not the shell itself. The integrated shell that I'm using is the power shell. I hope, that added something useful for you.
PS: For brevity and because I don't think it's, I omitted the full stack trace. If you're interested in the full stack trace, just give me a shoutout :)
@felixlinker It is an issue with the way quoting works in Powershell, mostly. A workaround is to set your default shell in VSCode to cmd. Then the jack-in command should work.
The command will work in powershell if you replace the double quotes on the outside to single quotes (leave the escaped ones as double quotes). Something like this might work in powershell for you (if I didn't make a typo):
C:\Users\felix\bin\cmd\lein.bat update-in :dependencies conj '[nrepl \"0.6.0\"]' -- update-in :plugins conj '[cider/cider-nrepl \"0.21.1\"]' -- update-in '[:repl-options :nrepl-middleware]' conj '[\"cider.nrepl/cider-middleware\"]' -- repl :headless