wslpath icon indicating copy to clipboard operation
wslpath copied to clipboard

Can NOT run my code in the right path with wslpath in VScode!

Open JamesQian1999 opened this issue 4 years ago • 0 comments

I setup WSL Ubuntu in VScode but I still can't run my code in the right path with wslpath. How to fix this problem?

This is my settings.json { "code-runner.runInTerminal": true, "terminal.integrated.shell.windows": "C:\\WINDOWS\\System32\\wsl.exe", "code-runner.executorMap": { "c": "cd $(wslpath $dir) & gcc $fileName -o $fileNameWithoutExt & ./$fileNameWithoutExt", "cpp": "g++ $fileName -o $fileNameWithoutExt -std=c++11 & ./$fileNameWithoutExt"}, "python": "python3 -u ./$fileName", }

When I run my code with "ctrl+alt+N" The output became: jamesqian@J:/mnt/c/Users/Jamesqian/Desktop/tmp$ cd $(wslpath "c:\Users\Jamesqian\Desktop\tmp\") & gcc test.c -o test & ./test

JamesQian1999 avatar Jun 12 '20 15:06 JamesQian1999