“subl” command not working properly

后端 未结 4 1499
花落未央
花落未央 2021-02-02 16:33

I\'m running into a problem when using the \"subl\" command in my terminal. It used to work fine but lately when I run it does open the files I want but I can\'t edit them and m

相关标签:
4条回答
  • 2021-02-02 16:53

    Try creating the subl symlink, it may have been deleted.

    In Terminal:

    ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
    

    It should now work.

    Edit - one other thing you might check. Do you have two versions of Sublime Text installed, ie versions 2 and 3? From what you say about it not opening up properly with subl but opening fine when you click it in the dock, they may be opening different versions. Look in your applications folder.

    0 讨论(0)
  • 2021-02-02 16:54

    I was having the same issue, so i ran: ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl (do NOT escape-paste this command)
    The output was: ln: /usr/local/bin/subl: **file exists**
    and subl wasn't working, so I navigated to the directory it was located in, checked the "get info" and the size was either 24 or 32 bytes (idr) & I deleted it.
    After deleting the subl exec file, i ran the original command again and it worked and the new file size is 62bytes)
    If you're curios, the output for this sys link is: /usr/local/bin/subl -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

    0 讨论(0)
  • 2021-02-02 17:08

    Sublime Text 2

    ln -sv "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
    

    Sublime Text 3

    ln -sv "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/local/bin/subl
    
    0 讨论(0)
  • 2021-02-02 17:08

    I had this problem when I installed Sublime in Bash, but then switched to Zsh. Since I had installed Sublime using Homebrew, an easy fix was to uninstall Sublime and then reinstall it. After that, the subl command worked again.

    0 讨论(0)
提交回复
热议问题