Comments (9)
没有问题
from dowww.
我刚才测试了一下,我这边去掉/mnt/后,跑python路径也是不正确的。很期待你明天的工作成果
from dowww.
原来这样,谢谢告知,issue可以关了
from dowww.
我在这里做了一些更改,看一下 这个链接。
from dowww.
其实我刚才没设置之前也没出问题,运行的时候路径都没问题,Python 和 C/C++ 都能正常编译,不过 code-runner 确实明确说了:
For Windows system, replaces the Windows style drive letter in the command with a Unix style root when using a custom shell as the terminal, like Bash or Cgywin. Example: Setting this to '/mnt/' will replace 'C:\path' with '/mnt/c/path'
为什么呢?有点玄学。
from dowww.
你修改过"code-runner.executorMap"参数吗? 默认是不会将windows的盘符路径替换掉啊
from dowww.
改了 C/C++ 的,但是没改 Python 的。不过 Python 确实路径正常,我刚刚特意试了一下。
PS:感觉 code-runner 是个挺重要的插件,明天我把这个单独分一个页面写吧,各种语言基本都能用它来编译运行。然后再看看 code-runner 到底怎么判定这个路径的。感谢您的建议!👏👏👏
from dowww.
新增了一个页面,单独介绍 Code Runner,在 这里。
今天详细看了一下 Code Runnner 下面的 Issue,有关 WSL 的里面确实有几个重点说明了这个路径问题。Issue #106 解决了这个问题,就是如果让 Code Runner 在集成终端中运行,集成终端默认用的是 Bash on Windows,那么 Code Runner 会自动将路径切换至 Linux 路径。
@garytyler Did you set WSL for the VS Code terminal? If yes, the Code Runner would automatically change the file path. Refer to #106
这里的 code-runner.terminalRoot
看来是为了重点解决使用 WSL 和使用 Git Bash 的用户的路径冲突问题(根目录路径一个是 /mnt/c
,一个是 /c
)。无论如何,这里设置一下还是有益无害的,确保正常运行。感谢建议!👏👏👏
没什么问题的话我就把这个 Issue 关掉了~
from dowww.
我在这里做了一些更改,看一下 这个链接。
修改root路径确实能解决问题,但如果我要修改回powershell的话怎么办呢,最好有个方法能够根据终端不同动态修改路径。
from dowww.
Related Issues (20)
- WLS2 在 2004 版本后,使用一行命令即可直接安装
- 关于图形化界面配置方面的更新建议
- 想问一下vmmem进程消耗的内存怎么比wsl2实际使用的大呢?没有使用其他任何虚拟机
- 在 WSL 中运行 exe 遇到权限问题 HOT 4
- WSL 列出 Windows 文件颜色问题时,重启 WSL 的方式错误 HOT 1
- 配置 vscode 在中文标点符号处断句 HOT 1
- 更新到Windows Terminal Preview v0.11.1191.0后setting 的变化 HOT 9
- windows terminal选择新terminal的时候颜色异常 HOT 1
- 向 WSL 2 添加 USB 支持 HOT 1
- 关于 .wslconfig 文件的配置 HOT 1
- <主机名>.mshome.net 访问主机 HOT 5
- ls背景色问题 HOT 4
- 请教WSL安装arch后使用xfce桌面的问题 HOT 6
- 找不到 python-pip 包 Unable to locate package python-pip HOT 1
- 编译内核出错
- 图形化界面安装过程中 一个更方便的配置WSL2参数的方法
- wsl2使用windows代理 HOT 2
- 增加wslg的介绍
- WSL2 中的127.0.0.1 和 localhost
- 隔壁仓库的powershell美化教程错误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dowww.