Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't open folders in Sublime when I'm using TMUX

OS: Yosemite iterm2, zsh

When I run "subl ." on my terminal, I can open the file folder, but if I run tmux and "subl project-folder" the folder isn't opened.

➜  ~  whereis subl
/usr/bin/subl

➜  ~  which subl
/usr/local/bin/subl

➜  ~  subl -v
Sublime Text Build 3083

➜  ~  cat .bashrc
export PATH=~/bin:/Users/olleh/bin:/Users/olleh/bin:/Users/olleh/.rbenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

➜  ~  cat .bash_profile
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH=/usr/local/node/bin:$PATH
export MANPATH=/usr/local/node/share/man:$MANPATH

➜  ~  ls -l /usr/local/bin/subl
lrwxr-xr-x  1 root  staff  62 Jul 13 09:51 /usr/local/bin/subl -> /Applications/Sublime Text.app/Contents/SharedSupport/bin/subl

tmux.conf

# Use vim keybindings in copy mode
set -g mode-mouse on
set -g mouse-resize-pane on
set -g mouse-select-pane on
set -g mouse-select-window on


# Setup 'v' to begin selection as in Vim

# Update default binding of `Enter` to also use copy-pipe

.zshrc

PATH=$PATH:/usr/local/bin/; export PATH
like image 334
olleh Avatar asked Jul 13 '15 02:07

olleh


1 Answers

Okay I figured it out. This is because Tmux does not have root access to the file system.

However you can grant access to Tmux, https://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.

Here are the steps.

  1. Install this package.brew install reattach-to-user-namespace

  2. Add this to ~/.tmux.conf set-option -g default-command "reattach-to-user-namespace -l zsh" (change zsh according to your shell)

Hope that helps.

like image 199
Daniel Rasmuson Avatar answered Sep 21 '22 10:09

Daniel Rasmuson