OS X Sublime Text3使用zsh shell [英] OS X Sublime Text3 to use zsh shell

查看:240
本文介绍了OS X Sublime Text3使用zsh shell的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想构建一个python文件,出现以下错误:

I want to build a python file I get the following error:

/bin/bash: python: command not found

原因是我使用的是zsh而不是bash.那么如何让Sublime看/bin/zsh?

The reason is that I'm using zsh instead of bash. So how to let Sublime to look at /bin/zsh?

推荐答案

这表明您的路径不正确,而不是您通常使用的shell.对于OSX,GUI应用程序的路径是通过与终端程序不同的方式设置的(根据您在上述问题中的评论知道).

This is indicative of your path not being correct and not what shell you normally use. In the case of OSX the path for GUI applications is set via different means than that of terminal programs (which you know based on your comments in your question above).

无论如何回答Sublime中的exec命令(用于执行包括构建系统的任务),都是要通过bash执行.

Regardless, to answer your question (and for future reference) the exec command in Sublime, which is used to execute tasks including build systems, is what is specifying that things be executed via bash.

使用 PackageResourceViewer ,您可以从默认包中提取文件exec.py并修改其对"/bin/bash"更改为"/bin/zsh"(或您想要的任何其他shell).

Using PackageResourceViewer you can extract the file exec.py from the Default package and modify it's use of "/bin/bash" to "/bin/zsh" (or whatever other shell you want) as you see fit.

尽管上面的方法行得通,但是当您从这样的包中覆盖文件时,您的覆盖将永久存在.也就是说,如果Sublime的较新版本包含具有错误修复或较新功能的exec.py的其他版本,则您将看不到它们,因为您已覆盖了文件.

While the above will work, when you override a file from a package like this, your override persists forever. That is to say, if a newer version of Sublime includes a different version of exec.py with bug fixes or newer features, you won't see them because you've overridden the file.

因此要记住的一点是,如果您采用这种方法,那么您有责任始终将您的替代更新为当前发布的版本.当发现您已覆盖文件时,有关exec问题的错误报告也可能会充耳不闻或引起眼泪.

So something to keep in mind is that if you take this route the onus is on you to always keep your override up to date with the current released version. Bug reports of exec problems are probably also going to fall on deaf ears or cause tears when it's discovered you've overridden the file.

这篇关于OS X Sublime Text3使用zsh shell的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆