We're updating the issue view to help you get more done. 

TDEPS on windows : Clojure alias not directly available

Description

When starting a new powershell, then querying for the presence of the clojure (or clj) alias, it is not found. After calling the underlying Invoke-Clojure, the alias is finally available. Note that invoking the alias while it is not found by "Get-Alias -Name clojure" actually works, as this triggers the search for that alias in the PSModulePath.

So what's the trouble you might ask ? Well if you have another executable named clojure.bat, clojure.cmd, clojure.exe or clojure.com in the regular command path, it will be invoked instead of the clojure alias, although we're in the powershell, and the search for the alias is never performed.

I've created a project that builds clojure.exe and clj.exe files for windows, these call into your powershell Invoke-Clojure function without the quoting issues (https://github.com/cark/clojure-win-cli-wrap). But with the issue I'm reporting here, we can't put such files in the path without risking to break the workflow of people that are already used to invoke clojure via the powershell. They'll try to invoke clojure with the arcane quoting of a powershell command line and fail (the first time only, but still).

The problem also leads to infinite recursion for people that for one reason or another want to create a clojure.cmd file and didn't do the research I did, and have it just call into powershell's clojure. They will effectively call their clojure.cmd recursively.

I've been looking for a solution, and it seems that there is no way around importing the ClojureTools module from one of the many profile.ps1 files. That's a code file, so editing these programmatically is always a bit hairy.

(Also I can't post attachments to this report, so no session transcript or screenshots for you!)

Environment

Windows 10, powershell 5.1

Status

Assignee

Unassigned

Reporter

Alex Miller

Labels

None

Approval

None

Patch

None

Priority

Major