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

live_grep doesn't work with ripgrep from nixpkgs on PATH, but works with ripgrep from homebrew on PATH (nushell) #3375

Open
rykugur opened this issue Dec 4, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@rykugur
Copy link

rykugur commented Dec 4, 2024

Description

On my macbook, using nix-darwin and nushell, the version of ripgrep from nixpkgs does not work with live_grep - I get this error:

[telescope.live_grep]: 'ripgrep', or similar alternative, is a required dependency for the live_grep picker. Visit https://github.com/BurntSushi/ripgrep#installation for installation instructions.

I've verified that rg is on my PATH:

~ 
❯ which -a rg | to text
command: rg
path: 
type: external
command: rg
path: /Users/rykugur/.nix-profile/bin/rg
type: external

However, if I install it via homebrew and add /opt/homebrew/bin to my path (and thus have two instances of rg on my PATH), live_grep works fine.

Additionally, on my linux desktop (running nixOS with the same nushell config), the version of ripgrep from nixpkgs works fine for live_grep.

My telescope config for neovim is mostly the standard config from LazyVim extras.

NOTE: fd is also on my path, even though the checkhealth command says otherwise.

Neovim version

NVIM v0.10.2
Build type: Release
LuaJIT 2.1.1713773202
Run "nvim -V1 -v" for more info

Operating system and version

macOS 14.7.1 (23H222)

Telescope version / branch / rev

branch main commit cf48d4d

checkhealth telescope

==============================================================================
telescope: require("telescope.health").check()

Checking for required plugins ~
- OK plenary installed.
- OK nvim-treesitter installed.

Checking external dependencies ~
- ERROR rg: not found. `live-grep` finder will not function without [BurntSushi/ripgrep](https://github.com/BurntSushi/ripgrep) installed.
- WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

===== Installed extensions ===== ~

Telescope Extension: `aerial` ~
- No healthcheck provided

Telescope Extension: `fzf` ~
- OK lib working as expected
- OK file_sorter correctly configured
- OK generic_sorter correctly configured

Telescope Extension: `git_worktree` ~
- No healthcheck provided

Telescope Extension: `projects` ~
- No healthcheck provided

Steps to reproduce

  1. Have ripgrep from nixpkgs installed on nix-darwin
  2. Open up neovim
  3. run :Telescope live_grep
  4. Error

Expected behavior

live_grep works

Actual behavior

Live_grep gives error:

[telescope.live_grep]: 'ripgrep', or similar alternative, is a required dependency for the live_grep picker. Visit https://github.com/BurntSushi/ripgrep#installation for installation instructions.

Minimal config

My config is here: https://github.com/rykugur/dotfiles/tree/master/configs/nvim/lazyvim

EDIT: some rg version info:


~ 
❯ which -a rg
╭───┬─────────┬──────────────────────────────────────────┬──────────╮
│ # │ command │                   path                   │   type   │
├───┼─────────┼──────────────────────────────────────────┼──────────┤
│ 0 │ rg      │                                          │ external │
│ 1 │ rg      │ /Users/rykugur/.nix-profile/bin/rg │ external │
│ 2 │ rg      │ /opt/homebrew/bin/rg                     │ external │
╰───┴─────────┴──────────────────────────────────────────┴──────────╯

# note - rg external is a completion function; however, same behavior exists with it disabled/removed
~ 
❯ /Users/rykugur/.nix-profile/bin/rg --version
ripgrep 14.1.1

features:+pcre2
simd(compile):+NEON
simd(runtime):+NEON

PCRE2 10.43 is available (JIT is available)

~ 
❯ /opt/homebrew/bin/rg --version
ripgrep 14.1.0

features:-simd-accel,+pcre2
simd(compile):+NEON
simd(runtime):+NEON

PCRE2 10.42 is available (JIT is available)
@rykugur rykugur added the bug Something isn't working label Dec 4, 2024
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

1 participant