Sublime Forum

Subl not working consistently under OS X

#1

I have the VISUAL env set to subl -w, but it never works. I end up with an appropriate looking file open in Sublime, but find that chsh immediately printed “no changes made” and exited.

I’ve also run into general issues with spawning blank windows instead of opening the file I specified.

I’m on 10.8.2, my shell is zsh but bash fared no better.

0 Likes

#2

I don’t know if this is the proper solution, but I found that the environment variable doesn’t like spaces. So what I did was to set

export EDITOR=sublw

and then create sublw in my path as

[code]#!/bin/sh

subl -w $*[/code]

That makes it work for me.

1 Like

#3

I use the Bash shell on my Mac OS 10.8.2. I have the following in my login script

export EDITOR=“subl -w”

Note the quotes. Works fine for me.

1 Like

#4

[quote=“meltonlow”]I use the Bash shell on my Mac OS 10.8.2. I have the following in my login script

export EDITOR=“subl -w”

Note the quotes. Works fine for me.[/quote]

Same here.

0 Likes

#5

[quote=“meltonlow”]I use the Bash shell on my Mac OS 10.8.2. I have the following in my login script

export EDITOR=“subl -w”

Note the quotes. Works fine for me.[/quote]

I also did that at first, however:

$ export EDITOR="subl -w" $ crontab -e crontab: subl -w: No such file or directory crontab: "subl -w" exited with status 1

0 Likes

#6

For me, under bash or zsh chsh always fails. Under zsh the file does open, but chsh has already given up and exited.

I’m using both zsh and bash from Fink, but they are in the /etc/shells file.

Edit: I should note, when I say “always fails” I mean with subl set as my editor. Vim behaves as normal.

0 Likes

#7

same here…

0 Likes

#8

I tried setting Sublime as my default bash editor.

sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/bin/subl
export EDITOR="subl -w"

While it works fine to launch file, it won’t always save.

In particular, I couldn’t get Sublime to edit CRON jobs. Compare:

VISUAL=/usr/bin/vim crontab -e
# works fine, the list of CRON jobs shows up and I can edit it.

VISUAL=/usr/bin/subl crontab -e
# does launch Sublime, however this just creates a new file /tmp/crontab.‹randomstring› file
# does not show me the list of CRON jobs, and won't reflect any change made there.

It’s as if whatever changes made in Sublime were not sent back to Bash.

Suggestions welcome.

0 Likes

#9

“subl -w” didn’t work, your answer helped, thanks!
MacOS 10.13.3

0 Likes