Closed rpop0 closed 1 month ago
Thanks for your PR but can you provide a solution that does not hard code the path? I'm not 100% sure this will not break someone's setup.
I don't have a WSL running right now but I think there is a environment variable that points to windows/system32. Can you check and use that instead?
Sure, I'll look into it if there is any way to determine this path automatically, but I don't think having it hard coded is an issue.
As far as I am aware, the Windows drive is always mapped to C:\ and it seems like that's always mounted under "/mnt/c" in WSL (https://learn.microsoft.com/en-us/windows/wsl/filesystems)
I didn't see any env variable but you could check if clip.exe is in the system path and only try the hardcoded path if this fails.
shutil.which("clip.exe") is not None
Looks good (I'll fix the formatting). Thanks!
As explained in issue #125 if appendWindowsPath is disabled in /etc/wsl.conf, using the clip.exe executable directly is not possible. Switching to the full path fixes this and should work in all situations, regardless of appendWindowsPath.