🔗 tmuxのすすめ|catatsuyのBlog

こちらの記事を参考に tmux を試していたら、なんか PATH がおかしい。調べてみたら、むしろ GNU Screen の方がおかしくて、~/.zprofile が読み込まれていないことが分かった。

私の ~/.zprofile は以下のとおり。

#
# /etc/zprofile and ~/.zprofile are run for login shells
#

# all bourne shells should source /etc/profile
source /etc/profile

/etc/profile は以下のとおり。

# System-wide .profile for sh(1)

if [ -x /usr/libexec/path_helper ]; then
  eval `/usr/libexec/path_helper -s`
fi

if [ "${BASH-no}" != "no" ]; then
  [ -r /etc/bashrc ] && . /etc/bashrc
fi

結果的に以下が原因で、PATHMANPATH が異なっていた。

  • GNU Screen: eval `/usr/libexec/path_helper -s` が実行されない
  • tmux: eval `/usr/libexec/path_helper -s` が実行される

[2007-01-22-1] 見ると、GNU Screen の挙動が変だよなあ。。。

環境:

  • OSX 10.8.2 Mountain LION
  • zsh 4.3.11 (i386-apple-darwin12.0) # OSX付属
  • Screen version 4.00.03 (FAU) 23-Oct-06 # OSX付属

ひとまず ~/.zprofile を空っぽにして対応。OSX で新規ユーザを作っても、それ系のファイルは作られなかったので、Debian の名残なんでしょう。

追記(2012-11-20):

今回も @cvmat さんからアドバイス頂きました。