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

Fail to process unix style file path in MSYS2 #3116

Open
lifei opened this issue May 18, 2024 · 0 comments
Open

Fail to process unix style file path in MSYS2 #3116

lifei opened this issue May 18, 2024 · 0 comments
Labels
bug Something isn't working Windows Relates to window operating system

Comments

@lifei
Copy link

lifei commented May 18, 2024

Description

The builtin pickers git_files/git_commits etc features of telescope.nvim in MSYS2 is not work.

Neovim version

NVIM v0.9.5
Build type: Release
LuaJIT 2.1.1707061634

OS Info:
{
  machine = "x86_64",
  release = "10.0.22631",
  sysname = "MINGW32_NT-10.0",
  version = "Windows 11 Pro"
}

Operating system and version

Windows 11 Pro

Telescope version / branch / rev

0c12735

checkhealth telescope

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

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

Checking external dependencies ~
- OK rg: found ripgrep 14.1.0 (rev e50df40a19)
- OK fd: found fd 9.0.0

===== 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

Steps to reproduce

  1. Prepare the environment, the important part is using the MSYS2 git componment. Using the follow command to install git pacman -S git. This version of git return the path of files in uinx style.
  2. Enter into a directory with git repo, cd git_repo
  3. Open neovim, nvim
  4. Execute command: :Telescope
  5. Choose git_files

Expected behavior

No response

Actual behavior

Neovim can not process the unix style path of files. It throws an error with "ENOENT: no such file or directory".

[WARN  2024/5/18 0:21:47] C:/Users/lifei/AppData/Local/nvim-data/lazy/telescope.nvim/lua/telescope/pickers.lua:669: Finder failed with msg:  .../Local/nvim-data/lazy/telescope.nvim/lua/telescope/_.lua:77: Failed to spawn process: {
  command = "git",
  pid = "ENOENT: no such file or directory",
  stderr = {
    close = <function 1>,
    eof_rx = <function 2>,
    eof_tx = <function 3>,
    read_start = <function 4>,
    start = <function 5>,
    <metatable> = <1>{
      __call = <function 6>,
      __index = <table 1>,
      __tostring = <function 7>,
      new = <function 8>,
      super = <2>{
        __call = <function 6>,
        __index = <table 2>,
        __tostring = <function 7>,
        close = <function 9>,
        new = <function 10>,
        super = <3>{
          __call = <function 6>,
          __index = <table 3>,
          __tostring = <function 7>,
          extend = <function 11>,
          implement = <function 12>,
          is = <function 13>,
          new = <function 14>
        },
        <metatable> = <table 3>
      },
      <metatable> = <table 2>
    }
  },
  stdin = {
    close = <function 15>,
    eof_rx = <function 16>,
    eof_tx = <function 17>,
    read_start = <function 18>,
    start = <function 19>,
    <metatable> = <table 1>
  },
  stdout = {
    eof_rx = <function 20>,
    eof_tx = <function 21>,
    handle = <userdata 1>,
    <metatable> = <4>{
      __call = <function 6>,
      __index = <table 4>,
      __tostring = <function 7>,
      iter = <function 22>,
      new = <function 23>,
      read = <function 24>,
      super = <table 2>,
      <metatable> = <table 2>
    }
  },
  uv_opts = {
    args = { "-c", "core.quotepath=false", "ls-files", "--exclude-standard", "--cached", "--others" },
    cwd = "/d/Code/Android-SMS-Automatic-Reply-GPS",
    stdio = {
      [2] = <userdata 1>
    }
  },
  <metatable> = <5>{
    __index = <table 5>,
    _for_each_pipe = <function 25>,
    close = <function 26>,
    new = <function 27>
  }
}
stack traceback:
	.../Local/nvim-data/lazy/telescope.nvim/lua/telescope/_.lua:77: in function 'spawn'
	...cope.nvim/lua/telescope/finders/async_oneshot_finder.lua:48: in function 'finder'
	.../nvim-data/lazy/telescope.nvim/lua/telescope/pickers.lua:665: in function <.../nvim-data/lazy/telescope.nvim/lua/telescope/pickers.lua:664>
	[C]: in function 'pcall'
	.../nvim-data/lazy/telescope.nvim/lua/telescope/pickers.lua:664: in function <.../nvim-data/lazy/telescope.nvim/lua/telescope/pickers.lua:611>

Minimal config

vim.cmd [[set runtimepath=$VIMRUNTIME]]
vim.cmd [[set packpath=/tmp/nvim/site]]
local package_root = '/tmp/nvim/site/pack'
local install_path = package_root .. '/packer/start/packer.nvim'
local function load_plugins()
  require('packer').startup {
    {
      'wbthomason/packer.nvim',
      {
        'nvim-telescope/telescope.nvim',
        requires = {
          'nvim-lua/plenary.nvim',
          { 'nvim-telescope/telescope-fzf-native.nvim', run = 'make' },
        },
      },
      -- ADD PLUGINS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
    },
    config = {
      package_root = package_root,
      compile_path = install_path .. '/plugin/packer_compiled.lua',
      display = { non_interactive = true },
    },
  }
end
_G.load_config = function()
  require('telescope').setup()
  require('telescope').load_extension('fzf')
  -- ADD INIT.LUA SETTINGS THAT ARE _NECESSARY_ FOR REPRODUCING THE ISSUE
end
if vim.fn.isdirectory(install_path) == 0 then
  print("Installing Telescope and dependencies.")
  vim.fn.system { 'git', 'clone', '--depth=1', 'https://github.com/wbthomason/packer.nvim', install_path }
end
load_plugins()
require('packer').sync()
vim.cmd [[autocmd User PackerComplete ++once echo "Ready!" | lua load_config()]]
@lifei lifei added the bug Something isn't working label May 18, 2024
@jamestrew jamestrew added the Windows Relates to window operating system label May 23, 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 Windows Relates to window operating system
Projects
None yet
Development

No branches or pull requests

2 participants