Sublime Forum

Subl command not working on Ubuntu 18.04

#1

Hi All:
Have enjoyed ver3 on a windows10 machine (as a licensed user) and decided to install on a Ubuntu 18.04 box from the command line (CLI). Am not a linux expert…know just enough to be dangerous.

Followed installation instructions, all went well w/o errors (into /opt/sublime_text). Per various on-line suggestions, I then created a link called subl to /opt/sublime_text/sublime_text located in /usr/local/bin. To confirm the installation, apt-get listed sublime as being installed. (All operations described were performed as a non-root user with admin rights.)

From the command line $subl did nothing. No response nor error message…only responded with a new CLI prompt. As if I hit the Enter key. Really strange. I then navigated to the folder with the link and typed subl. Same response. I then created an alias in .bashrc to define subl to point to the executable(?) at /opt/sublime_text/sublime_text. Typed subl…same result. I then navigated to the executable folder /opt/sublime_text and via ls -al saw the executable file. Ran the executable name sublime_text at the CLI. It responded that the command was not found. I’ve also checked $PATH and confirmed that /usr/local/bin is in it.

I’ve also removed sublime and reinstalled it. No luck.

Any thoughts as to what could be going on?

Thanks in advance.

sanderson

0 Likes

#2

CORRECTION…Ubuntu 18.04…NOT 10.04. Sorry.

0 Likes

#3

Problem solved. I’ll relate the solution for the next user.

First, I mistakenly thought that from the Ubuntu command line, Sublime would create an edit session over an SSH connection…not unlike how the native/simple nano editor does. This misunderstanding was the basis for my original post. Such a session is (apparently) not possible with Sublime…which is why the $subl command didn’t seem to work on the Ubuntu box.

While debugging this on Ubuntu, I typed the version command ($subl -v) and the help command ($subl -h). Sublime responded to both, so I concluded that Sublime was installed correctly on the linux box. But since it did not respond with a nano-like edit session in my SSH session window I figured a different configuration must be needed to use Sublime over an SSH connection.

After some Google searching I found the solution to be:
a) install the Plug-in RSub in Sublime previously installed on the Windows box. This listens to localhost port 52698 on the Windows machine.
b) install rmate on Ubuntu. This handles the handshake over SSH with RSub over port 52698.
c) configure the SSH client on the Windows box (Putty for me) to forward the remote port 52698 (from the linux box) to localhost:52698 (on the windows box).

To edit a file using Sublime on the Ubuntu box over the SSH session, type: “$rmate FileToEdit” on the command line of the Ubuntu box. The file instantly opens for editing on the local Sublime on the windows box! Make changes like normal on the file and save when finished. The edited local copy of the file is xferred back from the windows box to the linux box.

There may be other pros/cons to this solution which will come out as I use it. But, on the surface, the solution is very slick and very easy!

I’ve not listed the commands here…a bit of Google searching can find them.

Many thanks to the author of the add-in and of the rmate package. It brings the power of Sublime over an SSH remote session!

sanderso

Reference: Windows10 Pro / Ubuntu 18.04 / Sublime v3 Build 3207

0 Likes