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
Support Windows commands created using "Copy as cURL (cmd)" #143
Comments
Steps to reproduce:
|
Is ^ an escape character? |
Oh... ^ is escape character in Windows environment. On mac and Linux, there is no option to export as cmd. Why not use export as bash? |
I dunno. I haven't really used it, tbh. I'm just pointing out this case. Perhaps you want to handle it. |
Perhaps. Is |
If you mean, if it has to be escaped for windows cmd usage, I believe yes. |
This is not solvable without adding a handling for a new input language of |
@jgroom33 I would also consider cmd curl out of scope, BUT @cf512 already has an in-progress PR to support this kind of input. The only thing left is to separate out the code path into a new input language parser. I'm meeting with him today to see if he wants to proceed. @Revadike Thanks for providing a clear example. |
To support Windows cmd, someone needs to write a tree-sitter grammar for it (also see How to write a tree-sitter grammar in an afternoon). Anyone interested in doing that could take the bash tree-sitter grammar as a starting point. You can also look at the actual Chrome code that generates these cmd curl commands here Until/unless someone writes a grammar, the most we can do is improve the screenshot on the website so that Windows users have a chance to know that they need to click "Copy as cURL (bash)" instead of "Copy as cURL (cmd)". |
In cmd curl, this is an escaped thing:
--data "a=b^&c=d^&e=f^&h=i^&j=k^&l=m"
In this case:
^&
should be&
.In other words, you'll have to unescape the string.
The text was updated successfully, but these errors were encountered: