Carets in script args require double-escaping on Windows
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Domain
- cli, operating-systems
Research direction
Start by reproducing the issue with the shown foo.clj script after running bbin install foo.clj, then compare argument handling in zsh, bash, PowerShell, and cmd.exe. Trace the generated .bat wrapper path mentioned in the issue; done means a single caret reaches the script on Windows without requiring four carets, while Unix behavior remains unchanged.
Written by the indexing model from the issue text.
Description
Overview
On Windows, each bbin script has a .bat wrapper that interprets ^ in the args as an escape character. There appear to be two levels of escaping because you need to write ^^^^ to pass a single ^ to the bbin script. This problem doesn't happen on macOS/Linux because zsh and bash interpret ^ as a literal character.
I did a little research and I couldn't find an easy way to fix this while still keeping the .bat wrappers. I'm not sure how to fix this issue.
Steps to Reproduce
- Start with a script called
foo.clj:
(prn *command-line-args*)
- Install the script:
$ bbin install foo.clj
- In
zshandbash, carets don't need to be escaped to be passed through:
In PowerShell and$ foo ^hello ("^hello")cmd.exe, carets need to be escaped four times:$ foo ^hello ("hello") $ foo ^^hello ("hello") $ foo ^^^^hello ("^hello")
- Dominant language
- Clojure
- Stars
- 195
- Forks
- 15
- Avg merge
- 1m
- Merged PRs (30d)
- 2
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from babashka/bbin
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
bug
Difficulty 3/5 1-2 days Newbie friendliness 64/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
nextjournal/clerk#830 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
IOP tokens release blocker team qa team qa autotests WG adoption
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
penpot/penpot#13540 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
izhangzhihao/intellij-rainbow-brackets#2903 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 67/100