-
-
Notifications
You must be signed in to change notification settings - Fork 645
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
Change command line quoting when calling clojure cli #2656
Comments
This is not an issue to me anymore, I've written a binary wrapper to the powershell command line, and also a complete clojure powershell scripts replacement. Both are sporting command line compatibility with the Posix clojure command line. I'll leave the issue open because these are in no way official, but solutions now exist outside of a cider change. Admins, feel free to close it, as well as the PR. |
I have a solution which uses the Would a PR be useful? |
To avoid multiple layers of escaping when using tools.deps with PowerShell, base64 encode the clojure command and arguments when calling jack-in with `cider-clojure-cli-command` as `"powershell"`.
To avoid multiple layers of escaping when using tools.deps with PowerShell, base64 encode the clojure command and arguments when calling jack-in with `cider-clojure-cli-command` as `"powershell"`. If no clojure command is found on a Windows system use "powershell" for `cider-clojure-cli-command` by default.
To avoid multiple layers of escaping when using tools.deps with PowerShell, base64 encode the clojure command and arguments when calling jack-in with `cider-clojure-cli-command` as `"powershell"`. If no clojure command is found on a Windows system use "powershell" for `cider-clojure-cli-command` by default.
To avoid multiple layers of escaping when using tools.deps with PowerShell, base64 encode the clojure command and arguments when calling jack-in with `cider-clojure-cli-command` as `"powershell"`. If no clojure command is found on a Windows system use "powershell" for `cider-clojure-cli-command` by default.
Is your feature request related to a problem? Please describe.
Cider does not start a deps.edn project under windows (using C-c M-j).
This is due to the lack of a clojure command, which in turn is due to the clojure team deciding to use a powershell command to run clojure. There is no file to run.
Even outside cider, the crux of the problem is that, under windows, we have to deal with no less than 3 competing escaping rules for the double quotes in the clojure command line (the shell we're using, powershell and java).
There are some tools to replace the command line provided by the clojure team. But even those have still to deal with 2 separate escaping rules.
Here is one of these : https://github.com/frericksm/clj-windows
I propose to change the way cider builds the command it uses to start clojure. By using double quote and backslash-double quote instead of single-quote, double-quote, we can make it compatible with windows in addition to unix.
I've done this in my local copy of cider and tested it under windows and ubuntu.
It works and i'll send a pull request for review.
Please note that this does not solve the windows problem. It only makes it more palatable. It is still necessary to use the command line tool linked above rather than the one provided by the clojure team. It is my belief that even if/when the clojure team changes its command line tool, we'll still need to have this change anyways.
Describe alternatives you've considered
I've been spending this day and several more hours considering any way to do it, tried so many tricks... Nothing worked but changing cider and using the command line tool listed above.
There is an alternative that wouldn't require an external tool : Directly executing the clojure launch command with powershell would be brittle and might require real parsing as we're back at dealing with 3 competing escaping rules. But cider could create a temp powershell file *.ps1 then execute powershell with this file as a parameter.
The change is very small, PR to follow.
The text was updated successfully, but these errors were encountered: