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

Setting 'map e $nvim $Env:f' does not work for shell pwsh #1370

Closed
saljic opened this issue Aug 4, 2023 · 3 comments · Fixed by #1371
Closed

Setting 'map e $nvim $Env:f' does not work for shell pwsh #1370

saljic opened this issue Aug 4, 2023 · 3 comments · Fixed by #1371

Comments

@saljic
Copy link

saljic commented Aug 4, 2023

I'm using powershell core for development and I use set shell pwsh to make sure that LF usees the powershell core for shell commands . But When I put map e $nvim $Env:f in the lfrc file it does not work for powershell core. It opens an empty file for some reason. It works fine if I use set shell powershell, but I'd prefer to use pwsh instead of powershell if possible

@joelim-work
Copy link
Collaborator

For Windows, environment variables for filenames are wrapped in quotes to be compatible with CMD, although I guess it probably doesn't work so well with PowerShell. However, I did manage to get it work by removing the quotes:

set shell pwsh
map e $nvim $Env:f.Trim('"')

@saljic
Copy link
Author

saljic commented Aug 5, 2023

Yes that works like a charm! Should we update the lfrc example for powershell with some comment about this or should I just close the issue?

@joelim-work
Copy link
Collaborator

Leave it open, I think it's better if the decision to wrap in quotes is handled internally inside lf.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants