LoginSignup
14
9

More than 5 years have passed since last update.

Yosemite + tmuxでsublコマンドでファイルが開かない

Last updated at Posted at 2015-09-05

そもそも

Sublime Textではコマンドラインからファイルやディレクトリを開くことができます。

$ sudo ln -s /Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl /usr/local/bin/subl
$ echo "export PATH='/usr/local/bin:$PATH'

とかしておくと…

$ subl hoge.txt

とかコマンド打つと
スクリーンショット 2015-09-05 18.46.01.png

みたいに、ファイルとかディレクトリが開けます。
confいじるときとか、かなり便利です。

問題

Yosemite + tmux 環境だとコマンドライン引数のファイル・ディレクトリが開かない!!
(Sublime Text自体は起動する)

動けばいい人の解決策

$ brew install reattach-to-user-namespace
$ vim ~/.zshrc
~/.zshrc
alias subl='reattach-to-user-namespace subl'

とりあえず動く!

なぜ動かないのか知りたい人向け

自分動けばよかったので、各自下記の参考リンクをご覧になってください。

参考リンク

osx - Unable to launch application in tmux - Super User
http://superuser.com/questions/834525/unable-to-launch-application-in-tmux

[OSX] CLI tool stopped working properly under tmux · Issue #675 · SublimeTextIssues/Core
https://github.com/SublimeTextIssues/Core/issues/675#issuecomment-73426588

14
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
14
9