Sublime Forum

[solved] -Subl command does not open a new sublime window

#1
reisraff@reisraff:~$ which subl
/usr/local/bin/subl
reisraff@reisraff:~$ ls -l /usr/local/bin/subl
lrwxrwxrwx 1 root root 30 Jun 16 13:01 /usr/local/bin/subl -> /opt/sublime_text/sublime_text
reisraff@reisraff:~$ ls -l /opt/sublime_text/sublime_text
-rwxr-xr-x 1 root root 8429232 May 20 06:03 /opt/sublime_text/sublime_text

This is my setup, when I subl it does not open a new window.

reisraff@reisraff:~$ cat /usr/share/applications/sublime_text.desktop
[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
Exec=/opt/sublime_text/sublime_text %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=new-window;new-file;
[Desktop Action new-window]
Name=New Window
Exec=/opt/sublime_text/sublime_text --launch-or-new-window
OnlyShowIn=Unity;
[Desktop Action new-file]
Name=New File
Exec=/opt/sublime_text/sublime_text --command new_file
OnlyShowIn=Unity;

When I open sublime by the *desktop now I can use subl -a to append folders to the current Sublime window opened.

What should I do in order to use subl to open a new window of Sublime

Sublime version:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                                        Version                                    Architecture Description
+++-===========================================================-==========================================-============-======================================================================
ii  sublime-text                                                4107                                       amd64        Sublime Text is a sophisticated text editor for code, markup and prose

reisraff@reisraff:~$ cat /etc/issue
Ubuntu 20.04.2 LTS \n \l
0 Likes

#2

Is Sublime already running when you execute subl? If it’s not, then you should see Sublime starting and restoring the previous session. If instead you subl while Sublime is already running, all it will do is focus the Sublime Text window.

You can subl -n or subl --new-window to tell a running copy of Sublime to create a new window. You can also combine that with -a , like subl -n -a bob to create a new window and populate it with the folder bob.

In addition to that, subl bob would create a new window and open the folder bob in it OR focus an existing window that already has that folder open.

0 Likes

#3

I was a environment issue by snap https://github.com/alacritty/alacritty/issues/5247.

Already solved.

0 Likes