New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[OSX] CLI tool stopped working properly under tmux #675

Open
weslly opened this Issue Feb 8, 2015 · 8 comments

Comments

6 participants
@weslly

weslly commented Feb 8, 2015

Since build 3067, the subl command stopped working when used inside Tmux (a popular terminal multiplexer, like GNU Screen). It opens Sublime but ignores any file/folder arguments, such as subl . or subl example.txt.

I'm using OSX Yosemite and Sublime Text 3 build 3069.

@weslly

This comment has been minimized.

Show comment
Hide comment
@weslly

weslly Feb 8, 2015

I had it symlinked already but I deleted the symlink and did it again, just to make sure, but it didn't solve the problem.

weslly commented Feb 8, 2015

I had it symlinked already but I deleted the symlink and did it again, just to make sure, but it didn't solve the problem.

@weslly

This comment has been minimized.

Show comment
Hide comment
@weslly

weslly Feb 8, 2015

I found an external workaround to it, as this bug seems to affect some OSX apps using tmux (or non-apple screen/byobu builds):
https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

Since it used to work before 3067 without the workaround, I guess this can be fixed inside Sublime.

weslly commented Feb 8, 2015

I found an external workaround to it, as this bug seems to affect some OSX apps using tmux (or non-apple screen/byobu builds):
https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard

Since it used to work before 3067 without the workaround, I guess this can be fixed inside Sublime.

@FichteFoll FichteFoll added the tagme label Feb 8, 2015

@FichteFoll FichteFoll added the C: CLI label Mar 25, 2015

@weslly weslly changed the title from CLI tool stopped working properly under tmux to [OSX] CLI tool stopped working properly under tmux Apr 4, 2015

@nathanmarks

This comment has been minimized.

Show comment
Hide comment
@nathanmarks

nathanmarks Jan 14, 2016

FYI, I have encountered the same issue and noticed the following in my OS X console:

2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: Database mapping failed with result -10822, retrying
2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.830 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.830 PM subl[72836]: LaunchServices: Database mapping failed with result -10822, retrying
2016-01-13 7:32:06.831 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database

Note, this does not happen in the console when opening a folder using the CLI when not using tmux. I don't know anything about OS X development but it appears to be connected.

nathanmarks commented Jan 14, 2016

FYI, I have encountered the same issue and noticed the following in my OS X console:

2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: Database mapping failed with result -10822, retrying
2016-01-13 7:32:06.794 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.830 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database
2016-01-13 7:32:06.830 PM subl[72836]: LaunchServices: Database mapping failed with result -10822, retrying
2016-01-13 7:32:06.831 PM subl[72836]: LaunchServices: received XPC_ERROR_CONNECTION_INTERRUPTED trying to map database

Note, this does not happen in the console when opening a folder using the CLI when not using tmux. I don't know anything about OS X development but it appears to be connected.

@mhwinkler

This comment has been minimized.

Show comment
Hide comment
@mhwinkler

mhwinkler May 5, 2016

Also having this issue on OS X 10.11.4 when attempting to launch Sublime Text 3 using something like subl . from within tmux.

I'm not getting the errors mentioned above in Console... in fact no error appears to be thrown. It just opens Sublime Text 3 in a blank document with no tree.

mhwinkler commented May 5, 2016

Also having this issue on OS X 10.11.4 when attempting to launch Sublime Text 3 using something like subl . from within tmux.

I'm not getting the errors mentioned above in Console... in fact no error appears to be thrown. It just opens Sublime Text 3 in a blank document with no tree.

@nathanmarks

This comment has been minimized.

Show comment
Hide comment
@aphearin

This comment has been minimized.

Show comment
Hide comment
@aphearin

aphearin Jan 3, 2017

I have this same issue running on OSX 10.11.6. Has there been any progress on this issue?

aphearin commented Jan 3, 2017

I have this same issue running on OSX 10.11.6. Has there been any progress on this issue?

@mcescalante

This comment has been minimized.

Show comment
Hide comment
@mcescalante

mcescalante Feb 27, 2017

I've always had this issue with tmux on macOS - it silently brings Sublime to the foreground but does not do anything - and it has to do with the user namespace that tmux uses by default. The following config works for me (I'm using zsh, change it to bash or whatever shell you're using):

brew install reattach-to-user-namespace

Add the following line to ~/.tmux.conf:

set-option -g default-command "reattach-to-user-namespace -l zsh"

Kill the tmux server to reload the config (this will kill all active tmux sessions):

tmux kill-server

When you open a tmux shell now the command should work. It won't work if you don't restart the tmux "server".

Note: If you want to test the package without changing the tmux config or restarting, you can try the command reattach-to-user-namespace subl in an existing tmux session after installing the package via brew and it should work properly.

mcescalante commented Feb 27, 2017

I've always had this issue with tmux on macOS - it silently brings Sublime to the foreground but does not do anything - and it has to do with the user namespace that tmux uses by default. The following config works for me (I'm using zsh, change it to bash or whatever shell you're using):

brew install reattach-to-user-namespace

Add the following line to ~/.tmux.conf:

set-option -g default-command "reattach-to-user-namespace -l zsh"

Kill the tmux server to reload the config (this will kill all active tmux sessions):

tmux kill-server

When you open a tmux shell now the command should work. It won't work if you don't restart the tmux "server".

Note: If you want to test the package without changing the tmux config or restarting, you can try the command reattach-to-user-namespace subl in an existing tmux session after installing the package via brew and it should work properly.

atomaka added a commit to atomaka/dotfiles that referenced this issue Jul 10, 2017

Force sublime text to accept file path
SublimeTextIssues/Core#675 (comment)
outlines an issue with tmux that I am affected by.  This fixes it.  I
assume the same thing applies on Linux but don't have a gui to test on.

zydeon added a commit to zydeon/dotfiles that referenced this issue May 3, 2018

SublimeTextIssues/Core#675 (comment)
Enables subl inside tmux
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment