Closed BuZZ-dEE closed 4 years ago
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.
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
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.
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
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?
I have fish version 2.4.0. That does work :+1:
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.