简体   繁体   中英

sublime text not opening from command line tmux

I have Sublime Text as an alias so I can call it from the terminal on MacOS.

Since I started using tmux, Running the following command opens sublime but not on the current directory. It's like aliases are not accepting arguments on tmux.

subl .

Without tmux this command works fine.

Any known issue with tmux alias arguments?

This answer from SuperUser did the trick for me.

brew install reattach-to-user-namespace

And then append the following to your ~/.tmux.conf

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

Lastly, source the config file for tmux

tmux source ~/.tmux.conf

I use subl . all the time! It's a shame you've trained yourself not to use this helpful command.

I ran into this same issue after reinstalling Homebrew. Not sure why it happened but i was able to resolve it but just add the following line to the end of my .bash_profile .

alias subl='open -a "/Applications/Sublime Text.app"'

Then closing and reopening the terminal session or by running source ~/.bash_profile to reload the profile.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM