Code Monkey home page Code Monkey logo

Comments (9)

mapleriver avatar mapleriver commented on July 19, 2024 1

没有问题

from dowww.

mapleriver avatar mapleriver commented on July 19, 2024 1

我刚才测试了一下,我这边去掉/mnt/后,跑python路径也是不正确的。很期待你明天的工作成果

from dowww.

mapleriver avatar mapleriver commented on July 19, 2024 1

原来这样,谢谢告知,issue可以关了

from dowww.

spencerwooo avatar spencerwooo commented on July 19, 2024

我在这里做了一些更改,看一下 这个链接

我这样表述没问题吧?

from dowww.

spencerwooo avatar spencerwooo commented on July 19, 2024

其实我刚才没设置之前也没出问题,运行的时候路径都没问题,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.

mapleriver avatar mapleriver commented on July 19, 2024

你修改过"code-runner.executorMap"参数吗? 默认是不会将windows的盘符路径替换掉啊

from dowww.

spencerwooo avatar spencerwooo commented on July 19, 2024

改了 C/C++ 的,但是没改 Python 的。不过 Python 确实路径正常,我刚刚特意试了一下。

PS:感觉 code-runner 是个挺重要的插件,明天我把这个单独分一个页面写吧,各种语言基本都能用它来编译运行。然后再看看 code-runner 到底怎么判定这个路径的。感谢您的建议!👏👏👏

from dowww.

spencerwooo avatar spencerwooo commented on July 19, 2024

新增了一个页面,单独介绍 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.

Tracker647 avatar Tracker647 commented on July 19, 2024

我在这里做了一些更改,看一下 这个链接

我这样表述没问题吧?

修改root路径确实能解决问题,但如果我要修改回powershell的话怎么办呢,最好有个方法能够根据终端不同动态修改路径。

from dowww.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.