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

Search using rg and fzf leads to xargs: command too long in fish-shell on Pinebook Pro #7

Closed
BuZZ-dEE opened this issue May 13, 2020 · 6 comments

Comments

@BuZZ-dEE
Copy link
Contributor

Thank you for implementing #6 it works great on my x86 64 bit Arch Linux system, but not on my Debian 9 ARM Pinebook Pro system.

rg slider --vimgrep --color ansi | fzf --ansi --print0 | cut - d : -f 1-3 | xargs -r -I {} code -g {}
@rlivings39
Copy link
Owner

What goes wrong in this case? Do you get errors? If you replace the code -g with echo does anything useful print out to help us debug?

Another thing to try is to remove the --print0 and see if that helps.

@BuZZ-dEE
Copy link
Contributor Author

I get only the error message: xargs: command too long

rg slider --vimgrep --color ansi | fzf --ansi | cut -d : -f 1-3 | xargs -r -I {} code -g {}                        
xargs: command too long
rg slider --vimgrep --color ansi | fzf --ansi --print0 | cut -d : -f 1-3 | xargs -r -I {} echo {}                  23:33:41
projects/apps/editor/src/app/ui/configurator/configurator.component.ts:72:15

@rlivings39
Copy link
Owner

Interesting. I'm kind of stumped. Will need to request your help since I can't reproduce.

Some ideas to try:

What does manually running code -g projects/apps/editor/src/app/ui/configurator/configurator.component.ts:72:15 do for you? Same error?

If that works fine, then does the -t argument to xargs print out anything useful (that shows the command being run)? xargs -t -r...

I wonder if somehow the pinebook pro has a smaller command line limit. Could be reason to move some of this code to typescript on my end.

@BuZZ-dEE
Copy link
Contributor Author

BuZZ-dEE commented May 13, 2020

What does manually running code -g projects/apps/editor/src/app/ui/configurator/configurator.component.ts:72:15 do for you? Same error?

It opens the file in VSCode.

rg slider --vimgrep --color ansi | fzf --ansi --print0 | cut -d : -f 1-3 | xargs -t -r -I {} code -g {}
xargs: command too long

Ah, I have to mention, that I use the fish-shell on both systems (Debian 9 ARM and Arch Linux x86_64). I also tried now the bash and the z-shell and in that shells it does open the file as intended.

getconf ARG_MAX                                                                                       
2097152

@BuZZ-dEE BuZZ-dEE changed the title Search using rg and fzf leads to xargs: command too long Search using rg and fzf leads to xargs: command too long in fish-shell on Pinebook Pro May 13, 2020
@rlivings39
Copy link
Owner

rlivings39 commented May 13, 2020

I came across:

https://news.ycombinator.com/item?id=4075158

which suggests that my use of {} may be buggering up fish. I also use fish 3.1.2 but maybe there's a version difference.

How does:

rg slider --vimgrep --color ansi | fzf --ansi --print0 | cut -z -d : -f 1-3 | xargs -0 code -g

work for you?

@BuZZ-dEE
Copy link
Contributor Author

BuZZ-dEE commented May 13, 2020

I have fish version 2.4.0. That does work 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants