Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@sravioli
Copy link

@sravioli sravioli commented Nov 2, 2023

Right now Yazi only searches for the $HOME variable that is not present on windows. Either the user has to set $env:HOME = "$env:USERPROFILE" in his profile file or Yazi could also check for the $USERPROFILE variable.

My implementation of this functionality is pretty basic

@sravioli sravioli marked this pull request as ready for review November 2, 2023 08:08
@sxyazi
Copy link
Owner

sxyazi commented Nov 2, 2023

BTW this was intentionally not implemented for Windows, as it seems that Windows lacks the concept of ~/ or even a root directory (/); it uses drive letter instead

@sravioli
Copy link
Author

sravioli commented Nov 2, 2023

BTW this was intentionally not implemented for Windows, as it seems that Windows lacks the concept of ~/ or even a root directory (/); it uses drive letter instead

true, windows is weird. On my shell (powershell-core) ~ gets expanded to $env:USERPROFILE but on cmd that does not happen.

If i'm not mistaken windows should automatically set the userprofile variable: %USERPROFILE% on cmd and $env:USERPROFILE in powershell-core

@sxyazi
Copy link
Owner

sxyazi commented Nov 2, 2023

Thank you, LGTM!

@sxyazi sxyazi merged commit 73941c2 into sxyazi:main Nov 2, 2023
@sxyazi sxyazi changed the title feat(yazi-plugin): retrieve HOME also on windows feat: use USERPROFILE to retrieve readable path on Windows Nov 2, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 10, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants