I would like to add an "open with vim in wsl" item for files when right-clicking it. Sometimes, the file path or name would have space, so I must enclose the parameter with double-quotes. After trying many many times, I found the command
wt nt wsl -d Ubuntu-20.04 -e bash --login -c -v "vim \"""$(wslpath 'D:\Source Insight 4.0\test.txt')"""""""
which gives me the correct behavior. As you can see there is a space in the path D:\Source Insight 4.0\test.txt.
I was wondering why I must put \""" in before $( to give a " in the bash command while I should put multiple " after ) to get a ".
Could someone give me an explanation?
The windows terminal version is 1.5.10411.0
The cmd version is
Microsoft Windows [版本 10.0.19042.804]
I would like to add an "open with vim in wsl" item for files when right-clicking it. Sometimes, the file path or name would have space, so I must enclose the parameter with double-quotes. After trying many many times, I found the command
which gives me the correct behavior. As you can see there is a space in the path
D:\Source Insight 4.0\test.txt.I was wondering why I must put
\"""in before$(to give a"in the bash command while I should put multiple"after)to get a".Could someone give me an explanation?
The windows terminal version is
1.5.10411.0The cmd version is