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

Windows: Use / instead of \ in paths #2344

Open
Yohnny777 opened this issue Jan 23, 2023 · 3 comments
Open

Windows: Use / instead of \ in paths #2344

Yohnny777 opened this issue Jan 23, 2023 · 3 comments
Labels
enhancement Enhancement to performance, inner workings or existent features

Comments

@Yohnny777
Copy link

Typing \ when searching on Windows is really annoying, I would rather use forward slashes.

Describe the solution you'd like
A clear and concise description of what you want to happen.

There should be a way to make 'assets/image' search resolve 'assets\image'.

@Yohnny777 Yohnny777 added the enhancement Enhancement to performance, inner workings or existent features label Jan 23, 2023
@KevinSilvester
Copy link
Contributor

A workaround for this would be to specify a custom find_command.

I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows.

This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

@JustBarnt
Copy link

A workaround for this would be to specify a custom find_command.

I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows.

This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

I tried convert the rg commands to fd but I couldn't it to work, do you know if there is way in fd?

@KevinSilvester
Copy link
Contributor

KevinSilvester commented Jan 29, 2024

A workaround for this would be to specify a custom find_command.
I had the same issue on my windows machine but if you have ripgrep there's a handy --path-separator flag you can use to change the default \ on windows.
This is what I have for reference

   pickers = {
      find_files = {
         hidden = true,
         find_command = {
            'rg',
            '--files',
            '--color=never',
            '--no-heading',
            '--line-number',
            '--column',
            '--smart-case',
            '--hidden',
            '--glob',
            '!{.git/*,.svelte-kit/*,target/*,node_modules/*}',
            '--path-separator',
            '/',
         },
      }
   }

I tried convert the rg commands to fd but I couldn't it to work, do you know if there is way in fd?

The --path-separator option should be working the same way with fd as well. I think you might have encountered a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement to performance, inner workings or existent features
Projects
None yet
Development

No branches or pull requests

3 participants