Sublime Forum

Subl -w does not wait on OS X

#1

hi

I can’t say for sure when this starts to happen but right now I’m on build 3103 and OS X 10.11.3, and this can be reproduced just by calling subl -w from the os x terminal app.

I symlinked the subl command from /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl. I am not using tmux(which seems to be the issue in another thread).

Any help is welcome. Thanks

0 Likes

Subl --wait never completes if SublimeText is quit
#2

I have build 3143 and I don’t have this issue. I can subl -w setup.py, which blocks, then close that file within SublimeText using Cmd+W, and the subl process exits.

If I however use subl -w setup.py and then quit SublimeText with Cmd+Q, the process continues to block, even if I subsequently restart SublimeText and close the once-again-open file. Since my experience is distinctly different from what the OP has described, I’ll file a separate issue.

0 Likes

#3

I’m using build 3211 on OS X 10.14.6, and am finding that subl --wait doesn’t block. Anybody else running into this problem? Thanks!

0 Likes

#4

This issue makes it impossible to use st3 as an external editor for a variety of tools. Does anyone know if it might be possible to work around it by running st3 within a wrapper script that would block? (fwiw --wait works as expected on the linux version)

0 Likes

#5

This how I have my EDITOR variable set. works for me
export EDITOR=(/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl --wait)
export VISUAL="/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl"

0 Likes

#6

Thanks, that’s working for you on OS X? What build/version are you running?

0 Likes

#7

macOS Catalina 10.15.4 (19E287)
zsh

0 Likes

#8

Thanks for the info, I’ll upgrade and see if that solves my problem.

0 Likes

#9

Unfortunately upgrading to 10.15.4 didn’t fix the problem for me. Using ST3 build 3211, subl --wait still returns control immediately to the terminal. I wonder if it has something to do with using zsh, but I see you’re using zsh as well. I’m stumped.

UPDATE: Ah, I figured out what I’m doing wrong. If you invoke without a file name, it returns immediately—which makes sense I suppose if it’s waiting for a specific file to close, and there is no such file. I was misunderstanding --wait to mean simply “don’t background the process.” If you invoke with a filename, even a new empty one, it blocks as expected.

It’s still not working as the external editor for another specific application (houdini), but now I know to look elsewhere for that problem.

1 Like

#10

did you try the $EDITOR assignment with the parens?

0 Likes