Giter Site home page Giter Site logo

vscode plugin in MacOS about utools HOT 7 CLOSED

mohuishou avatar mohuishou commented on June 3, 2024
vscode plugin in MacOS

from utools.

Comments (7)

mohuishou avatar mohuishou commented on June 3, 2024

提议在mac下用zsh启动:

cmd = `bash -l -c '${cmd}'`;

现在mac默认shell是zsh, 然后关于个人的PATH设置都是在zsh config里, 用bash启动会导致debug的时候找不到PATH.
当然其实也可以自己设置bash的config...

这个后面可以优化一下,修改一下默认值

from utools.

mohuishou avatar mohuishou commented on June 3, 2024

最新版已支持,shell 可以使用 vsc-setting 修改

from utools.

FoundTheWOUT avatar FoundTheWOUT commented on June 3, 2024

我发现改了zsh还是不能正确的获得PATH...怎么回事,
我在terminal跑code .能是正常debug的,
但是用插件就会就debug不了了.
截屏2021-04-05 下午11 17 41
截屏2021-04-05 下午11 17 51

from utools.

mohuishou avatar mohuishou commented on June 3, 2024

你这个 debug 的意思是在 vscode 里面运行 debug 命令?

from utools.

FoundTheWOUT avatar FoundTheWOUT commented on June 3, 2024

你这个 debug 的意思是在 vscode 里面运行 debug 命令?

这个, vscode自带的Run and Debug
截屏2021-04-05 下午11 25 48

from utools.

mohuishou avatar mohuishou commented on June 3, 2024

这个要看一下你的环境问题了,按理说这个应该和启动方式关系不大才对

from utools.

FoundTheWOUT avatar FoundTheWOUT commented on June 3, 2024

用其它插件时无意中想到了一个解决方法.
就是不在node中运行启动脚本, 而是用osascript去调用本地terminal然后跑命令.
https://github.com/fofolee/uTools-quickcommand/blob/master/src/preload.js#L396

问题原因

在Unix系统中, 不同于Window, 我们一般都是在shell的conf下追加PATH, 比如.zshrc中追加node路径, 或者其它包路径
然而当我们用zsh -l -c时它会根据其调用者(当前node)路径进行响应, 在utools中的node是一个沙盒, 它的环境仅仅包含了必要的参数, 没有也理应没有办法拿到用户的个人配置(除非添加设置选项), 那么启动后的vscode找不到软件的路径也就理所当然了.

解决办法

启用一个terminal进程, 让该进程运行code, 这样就能有效的避免环境丢失的问题.

示例

FoundTheWOUT@e06e705
也许可以加个开关, 比如用本地terminal启动, 之类的...🥲

其它问题

  • Unix系统中, 如果目录路径带有空格, 启动会失效(路径中空格应改为'\ ', 但我想不到什么好办法)
  • utools.d.tsisMacOs isWindows isLinux三个方法应该返回布尔值

from utools.

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.