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

Recognize both 'powershell' and 'pwsh' as powershell commands #3074

Closed
rwtodd opened this issue Oct 18, 2021 · 1 comment
Closed

Recognize both 'powershell' and 'pwsh' as powershell commands #3074

rwtodd opened this issue Oct 18, 2021 · 1 comment
Labels
enhancement good first issue A simple tasks suitable for first-time contributors

Comments

@rwtodd
Copy link
Contributor

rwtodd commented Oct 18, 2021

Expected behavior

M-x cider-jack-in base64-encodes a powershell command when I've set cider-clojure-cli-command to "pwsh" for powershell core.

Actual behavior

M-x cider-jack-in tries to call pwsh as if it's the clojure cli, without base64-encoding a call to clj, and it fails.

I had to edit cider.el cider--update-jack-in-cmd to check for both "powershell" and "pwsh", after which it appears to be working. I don't know if hardcoding both names is the kind of solution you'd want to merge, but realistically, powershell will be running under one of these two names in almost every case.

Steps to reproduce the problem

Install the powershell module under pwsh (powershell core) on Windows as described in the docs (at https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows).

Now install cider in emacs, and try to use it. cider-jack-in tries to call powershell, where the module isn't installed, and fails. So, set your cider-clojure-cli-command to "pwsh" to get past that. At this point, cider doesn't realize it's dealing with powershell anymore, and issues a non-base64 command that fails.

So, to work around the issue, edit your cider.el cider--update-jack-in-cmd to check for both "powershell" and "pswh" in the if-check. Now it works.

CIDER version information

;; CIDER 1.2.0snapshot (package: 20211013.2024), nREPL 0.9.0-beta3
;; Clojure 1.10.3, Java 17

Emacs version

27.2

Operating system

Windows 10

@bbatsov bbatsov added enhancement good first issue A simple tasks suitable for first-time contributors labels Oct 20, 2021
@bbatsov
Copy link
Member

bbatsov commented Oct 20, 2021

This should be an easy change. I didn't know about pwsh.

rwtodd added a commit to rwtodd/cider that referenced this issue Oct 21, 2021
The recent powershell executables (in the .NET Core era) are
named pwsh.exe, and should be treated the same as powershell
for the purposes of cider-jack-in.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue A simple tasks suitable for first-time contributors
Projects
None yet
Development

No branches or pull requests

2 participants