Skip to content

find_files doesn't work for remote directories #3568

@myarcana

Description

@myarcana

Description

vim -u <(cat <<'EOF'                                                                 
vim.opt.rtp:append("~/.local/share/nvim/lazy/plenary.nvim")
vim.opt.rtp:append("~/.local/share/nvim/lazy/telescope.nvim")

require('telescope').setup{}

vim.keymap.set(
  'n',
  '<Space>ff',
  function()
    local builtin = require("telescope.builtin")
    builtin.find_files({
      search_dirs = {
        vim.fn.fnamemodify(vim.fn.expand('%:p'), ':h')
      }
    })
  end,
  { noremap = true, silent = true }
)
EOF
) scp://myserver.com//etc/hosts

vim loads and displays scp://myserver.com//etc/hosts

<space>ff should now do find_files in scp://myserver.com//etc, but the find_files picker is totally empty! There should be an error message at least.

Neovim version

NVIM v0.11.5
Build type: Release
LuaJIT 2.1.1762795099

Operating system and version

macOS 15

Telescope version / branch / rev

0294ae3

checkhealth telescope

==============================================================================
telescope:                                                                1 ⚠️

Checking for required plugins ~
- ✅ OK plenary installed.

Checking external dependencies ~
- ✅ OK rg: found ripgrep 14.1.1
- ⚠️ WARNING fd: not found. Install [sharkdp/fd](https://github.com/sharkdp/fd) for extended capabilities

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

Telescope Extension: `frecency` ~
- ✅ OK Neovim version is 0.10 or higher.
- nvim-web-devicons is not installed.
- ✅ OK ripgrep installed.

Telescope Extension: `ui-select` ~
- No healthcheck provided

Steps to reproduce

minimal config:

vim.opt.rtp:append("~/.local/share/nvim/lazy/plenary.nvim")
vim.opt.rtp:append("~/.local/share/nvim/lazy/telescope.nvim")

require('telescope').setup{}

vim.keymap.set(
  'n',
  '<Space>ff',
  function()
    local builtin = require("telescope.builtin")
    builtin.find_files({
      search_dirs = {
        vim.fn.fnamemodify(vim.fn.expand('%:p'), ':h')
      }
    })
  end,
  { noremap = true, silent = true }
)

This starts vim with no plugins except telescope and plenary.

The paths ~/.local/share/nvim/lazy/plenary.nvim come from having installed telescope in the first place with Lazy. I wanted to reuse the ones I had installed, hopefully easy for many maintainers to copy/paste too.

Expected behavior

Telescope should ideally succeed to do find_files in an scp:// location, but if it cannot, there should be an error message.

Actual behavior

Empty picker

Minimal config

vim.opt.rtp:append("~/.local/share/nvim/lazy/plenary.nvim")
vim.opt.rtp:append("~/.local/share/nvim/lazy/telescope.nvim")

require('telescope').setup{}

vim.keymap.set(
  'n',
  '<Space>ff',
  function()
    local builtin = require("telescope.builtin")
    builtin.find_files({
      search_dirs = {
        vim.fn.fnamemodify(vim.fn.expand('%:p'), ':h')
      }
    })
  end,
  { noremap = true, silent = true }
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions