Skip to content

counsel-rg, counsel-ag don't work with tramp #2160

@li1

Description

@li1

Issue

I am trying to run counsel-rg / counsel-ag on a remote server using TRAMP.

This doesn't work, as the remote binary apparently isn't being used for searching.

Steps to reproduce:

  • Install rg / ag on remote server (at /usr/bin/rg / /usr/bin/ag)
  • clean emacs init with ivy & counsel installed from melpa: (use-package counsel :ensure t :config (ivy-mode 1)) (ivy 0.12)
  • C-x C-f to tramp into some remote file ssh://...
  • M-x counsel-rg or M-x counsel-ag
  • error message: "no such file or directory, rg" / "required program ag not found in your path"

Notes

  • Commenting out the (counsel-require-program counsel-ag-command) suppresses the error message, but rg / ag remain dysfunctional
  • installing ripgrep on the local machine also passes the file not found error, but obviously leads to other issues as the local binary is being used to search through remote buffers.

Update: I noticed that on long-running tramp sessions, rg and ag start to work. Perhaps the caching just takes a while. Also, at that point I receive an error code if I remove the remote binaries. So it appears that

  1. The check for installed ag/rg is always looking at the local binary even if they should be executed remotely (not a big deal imo)
  2. Initial caching takes a (pretty long) while — not sure what the reason for that might be

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions