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

Basic curl cheatsheet doesn't work on zsh due to quoting issues #856

Open
brandon-fryslie opened this issue Sep 25, 2023 · 2 comments
Open
Labels
bug Something isn't working

Comments

@brandon-fryslie
Copy link

Describe the bug
A clear and concise description of what the bug is.

Using the default cheatsheets, the curl examples are broken in zsh for some URLs.

To Reproduce
Steps to reproduce the behavior:

  1. Install Navi
  2. Activate via ctrl+g and install 'default cheatsheets' (/pat/to/navi repo add denisidoro/cheats)
  3. Press ctrl+g again and type curl
  4. Choose send a get http request
  5. Paste a URL such as https://github.com/denisidoro/navi/blob/master/docs/installation.md#installing-the-shell-widget into the variable
  6. The resulting command in the terminal will be curl https://github.com/denisidoro/navi/blob/master/docs/installation.md#installing-the-shell-widget
  7. Executing this command fails with the error zsh: no matches found: https://github.com/denisidoro/navi/blob/master/docs/installation.md#installing-the-shell-widget

Expected behavior
A clear and concise description of what you expected to happen.

Executing the command curl 'https://github.com/denisidoro/navi/blob/master/docs/installation.md#installing-the-shell-widget' succeeds, so it looks like a quoting issue.

Parameters that contain special characters should be quoted automaticaly.

Screenshots
If applicable, add screenshots to help explain your problem.

N/A

Versions:

  • OS: macOS
  • Shell Version: zsh 5.9 (x86_64-apple-darwin20.6.0)

Additional context
Add any other context about the problem here.

This is likely to shell-specific, and might be difficult to implement. However it really limits the usefulness of the tool if we need to manually go back in and add quotes around specific parameters.

@brandon-fryslie brandon-fryslie added the bug Something isn't working label Sep 25, 2023
@welcome
Copy link

welcome bot commented Sep 25, 2023

Thanks for opening your first issue here! In case you're facing a bug, please update navi to the latest version first. Maybe the bug is already solved! :)

@tjex
Copy link
Contributor

tjex commented Nov 4, 2023

Are you open to making a pr for this?
It would simply be a case of changing the curl.cheat file.

# send a get http request
curl <url>

to

# send a get http request
curl "<url>"

The repo is a community cheat sheet, so prs are welcome.

Putting quotes around the string, will not break the command for other OSs / shells (it's actually better practice). So it's safe to change the cheat sheet globally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants