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

Superfluous backslash #306

Closed
syimyuzya opened this issue Mar 22, 2020 · 7 comments · Fixed by #308
Closed

Superfluous backslash #306

syimyuzya opened this issue Mar 22, 2020 · 7 comments · Fixed by #308
Labels
bug Something isn't working

Comments

@syimyuzya
Copy link

When retrieving a multiline command (with \ at the end of each line except the last) using <C-g>, the actual output becomes a single line but the backslashes are preserved, which causes bash to parse it incorrectly.

To Reproduce

  • Install misc/weather.cheat.
  • Invode navi with <C-g> and type weather. (In the interactive window the command is shown correctly as curl -s "wttr.in" | grep -v "New feature" | grep -v Follow)
  • Press enter. The output is curl -s "wttr.in" \ | grep -v "New feature" \ | grep -v Follow, which would give an error grep: : No such file or directory (the single space after the second backslach treated as a filename).

Expected behavior

The output should be curl -s "wttr.in" | grep -v "New feature" | grep -v Follow, as in the interactive window.

Versions:

  • navi: 3.2.0
  • OS: macOS Mojave
  • Shell Version: Bash 5.0.16
@syimyuzya syimyuzya added the bug Something isn't working label Mar 22, 2020
@welcome
Copy link

welcome bot commented Mar 22, 2020

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! :)

@denisidoro
Copy link
Owner

I'm not able to reproduce the problem 😞

Could you please take a screenshot of the preview window for the weather command?

@syimyuzya
Copy link
Author

I'm not able to reproduce the problem 😞

Could you please take a screenshot of the preview window for the weather command?

weather.cheat:

navi-1

Preview:

navi-2

Output:

navi-3

@denisidoro
Copy link
Owner

Thanks! That was insightful. I'll look into it

denisidoro added a commit that referenced this issue Mar 24, 2020
Fixes #306 

This only happens when using the bash widget
@chubin
Copy link

chubin commented Mar 24, 2020

Just for your information, to switch the Follow line off, you can just add the ?F option:

curl wttr.in/Berlin?F

See curl wttr.in/:help for more options

@bonsairobo
Copy link

bonsairobo commented Jul 20, 2024

I am still having this problem in the current latest version 2.23.

> navi --version
navi 2.23.0

> navi --print --query weather
...select in TUI...
curl -s "wttr.in" \     | grep -v "New feature" \     | grep -v Follow

And of course the command fails.

P.S. I am confused why the OP said they were using version 3.2.0. AFAICT this version does not exist?

@syimyuzya
Copy link
Author

P.S. I am confused why the OP said they were using version 3.2.0. AFAICT this version does not exist?

Oops 😂 should be 2.2.0 (latest version at the time when I reported this

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

Successfully merging a pull request may close this issue.

4 participants