formulahendry / formulahendry/vscode-code-runner

wsl terminal args issue when it use python interpreter on windows.

Offen
#282 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
enhancement
Vorherrschende Sprache
TypeScript
Sterne
2.4k
Forks
352
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I am using wsl as vscode default terminal. but I want execute my python script using window python interpreter.
```python
{
...
"code-runner.executorMap": {
"python": "/mnt/c/Python27_64/python.exe -u",
},
"code-runner.runInTerminal": true,
...
}
```
above is my custom option to do what I want. but I got argument error.
```
root@local:~/home/test# /mnt/c/Python27_64/python.exe -u "/mnt/c/Users/user/home/test.py"
C:\Python27_64\python.exe: can't open file '/mnt/c/Users/user/home/test.py': [Errno 2] No such file or directory
```
windows python interpreter use windows path form for the script which passed first argument. so if I change command line by hand then it works.
```
root@local:~/home/test# /mnt/c/Python27_64/python.exe -u "c\\Users\\user\\home\\test.py"
```
It would be great if there is way to change wsl path to window path form. how can I do that? or where can I hook code runner's process? and I think it would be nice if code runner support contrary case.

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Start by reproducing the command from the reported executorMap with runInTerminal enabled, using a WSL terminal and a Windows Python interpreter. Trace how Code Runner launches the script and handles its path; done means the Windows interpreter receives a usable Windows-form path, with the requested reverse case considered as well.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
typescript, vscode
Bereich
developer-experience, tooling
Issue-Typ
Feature
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.