Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"subl" command not working properly

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 moreover Sublime Text doesn't show up in the topbar of my mac as if it wasn't running at all (there's no dot besides the icon in the dock aswell). I kind of opens it as if it was just a window and not an application...But when I click on the icon from the dock it works just fine !

I've got an old macbook from 2008 running on Lion.

Thanks for the help (I'm a newbie),

Appreciated

like image 873
Martin B Avatar asked Nov 14 '14 13:11

Martin B


People also ask

What does SUBL do in terminal?

Sublime Text includes a command line tool, subl , to work with files on the command line. This can be used to open files and projects in Sublime Text, as well working as an EDITOR for unix tools, such as git and subversion.

What is SUBL command?

Sublime Text includes a command-line helper called subl . Using the command-line helper, you can open files and folders and perform other actions from the command line. Before using subl , make sure it is on your PATH . To put subl on your PATH , you may need to add directories to PATH or use symbolic links.

How do I run sublime from command prompt?

To open a command palette in Sublime Text editor, you can use the shortcut key combination Ctrl+Shift+P on Windows and Cmd+Shift+P on OSX.

How do I start Sublime Text from terminal Mac?

First, navigate to a small folder in Terminal that you want ST to open and enter the following command: /Applications/Sublime\ Text. app/Contents/SharedSupport/bin/subl . NOTE: You may need to replace Sublime\ Text.


2 Answers

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.

like image 83
Paul Byrne Avatar answered Nov 29 '22 08:11

Paul Byrne


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
like image 42
Victor Choy Avatar answered Nov 29 '22 08:11

Victor Choy