[Sublime Text] SublimeLinter 出現 could not determine shell PATH 的錯誤訊息

[Sublime Text] SublimeLinter 出現 could not determine shell PATH 的錯誤訊息

最近 Mac 從休眠中回復之後,

Sublime Text 常常會出現 count not determine your shell PATH 的訊息:

Screen Shot 2016-05-06 at 10.44.14 AM

 

打開 View > Show console 看一下…

裡面有一行比較相關的訊息 SublimeLinter: shell timed out after 10 seconds:

reloading plugin SublimeLinter-cppcheck.linter
SublimeLinter: cppcheck linter loaded
reloading plugin SublimeLinter-html-tidy.linter
Unable to fetch update url contents
SublimeLinter: shell timed out after 10 seconds, executing ('/bin/bash', '-l', '-c', 'echo "__SUBL_PATH__${PATH}__SUBL_PATH__"')
SublimeLinter: Could not parse shell PATH output:
<empty>
error: SublimeLinter could not determine your shell PATH. It is unlikely that any linters will work.
Please see the troubleshooting guide for info on how to debug PATH problems.
SublimeLinter: htmltidy linter loaded
reloading plugin SublimeLinter-jshint.linter
SublimeLinter: jshint linter loaded
reloading plugin SublimeLinter-shellcheck.linter
SublimeLinter: shellcheck linter loaded

 

嗯… 不是很確定發生了什麼事,但這問題並不是每次都會發生, 

查了一下 SublimeLinter: Troubleshooting,說可以開啟 Debug Mode 試試, 

但並沒有出現更多的除錯訊息:

Screen Shot 2016-07-20 at 11.00.16 AM  

 

上網看了一下,有人說可以直接設定 SublimeLinter 裡的 shell 的路徑,

也有人說可以延長 timeout 的時間~

我問題發生的時間通常是休眠復原之後,猜想可能是復原的時候系統很慢,

導致 SublimeLinter 沒辦法在 10 秒內取得 shell 的路徑,

於是修改了一下 Sublime Text > Preferences > Package Settings >

SublimeLinter > Settings – User,把 shell_timeout 從預設的 10 改成 120 秒:

{
"default": {
"shell_timeout": 120,
}
}

 

這樣修改完之後,上面的錯誤訊息就沒有再看到了,應該算是解決囉~

 

參考資料:stackoverflow: SublimeLinter could not determine shell PATH

 

(本頁面已被瀏覽過 163 次)

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *

這個網站採用 Akismet 服務減少垃圾留言。進一步了解 Akismet 如何處理網站訪客的留言資料