You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Usecase: from a WSLv1 bash get a Windows absolute dir path, to be passed to a python script to be passed to Chrome headless via selenium.
Succinctly: wslpath -a -w . gets me what I want except that I need this path to have a trailing backslash. Unfortunately, wslpath -a -w ./" still returns the same path. It would be nice to have an option to return a trailing backslash for a directory in an easy way. My current workaround: $(wslpath -a -w .)\\. This is not too bad, just a bit inconvenient, and less clear to the reader as the backslash here may be somehow leaking through the abstraction
Also, it might be nice if wslpath -a -w directly returned path to the current directory - again, not very important.
The text was updated successfully, but these errors were encountered:
wslpath -a -w . should already do what you want for current directory. Seems like appending a trailing slash should be pretty easy to do in the python script as well?
Python script in WSLv1 thinks it's completely in Linux land, so os.sep is forward slash, and I'd like to keep my Python script as simple+portable as possible. So keeping it at the upper level of wslpath would be good. I agree, it's a minor issue, but it would be a bit nicer if wslpath could produce trailing slash as well (probably via opt-in option is best)
vadimkantorov
changed the title
Allow wslpath to keep trailing slash for directories (possibly via an option)
Allow wslpath to keep trailing slash for directories (possibly via an option e.g. --preserve-trailing-slash or --force-trailing-slash)
Sep 19, 2022
Usecase: from a WSLv1 bash get a Windows absolute dir path, to be passed to a python script to be passed to Chrome headless via selenium.
Succinctly:
wslpath -a -w .
gets me what I want except that I need this path to have a trailing backslash. Unfortunately,wslpath -a -w ./"
still returns the same path. It would be nice to have an option to return a trailing backslash for a directory in an easy way. My current workaround:$(wslpath -a -w .)\\
. This is not too bad, just a bit inconvenient, and less clear to the reader as the backslash here may be somehow leaking through the abstractionAlso, it might be nice if
wslpath -a -w
directly returned path to the current directory - again, not very important.The text was updated successfully, but these errors were encountered: