Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
14
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?