pipe-rename icon indicating copy to clipboard operation
pipe-rename copied to clipboard

Can't use command line arguments in EDITOR

Open jminer opened this issue 4 years ago • 1 comments

I use Visual Studio Code, and I have to pass the --wait option to use it with pipe-rename. However, if I try doing that, I get an error:

PS C:\Files> $env:EDITOR="code.exe --wait"
PS C:\Files> renamer *.txt
Error: Failed to execute editor process

Caused by:
    The system cannot find the file specified. (os error 2)

I found that, as a workaround, I can create a batch file, say code-wait.bat, containing

code --wait %1

and then set EDITOR to it:

PS C:\Files> $env:EDITOR="code-wait.bat"

And then it works, but I'd rather not have to use the batch file. I may try to fix this someday if no one else does.

I'm using Windows 10 and pipe-rename 1.3.0 (updated today from crates.io).

BTW, I love the idea of pipe-rename! Thanks for writing and releasing it!

jminer avatar Aug 07 '21 23:08 jminer

This is a really interesting case, I don't see why we couldn't call the $EDITOR as a command and not as a file, I'd welcome a PR for this, otherwise I'll try to get to it.

Glad you like the idea!

marcusbuffett avatar Aug 10 '21 13:08 marcusbuffett