Whenever I open a new TMux session, I'm greeted with this:

/home/foo/.oh-my-zsh/oh-my-zsh.sh:3: command not found: env
env_default:1: command not found: env
env_default:1: command not found: grep
env_default:1: command not found: env
env_default:1: command not found: grep

I've removed my .tmux.conf file and here's the lines from the oh-my-zsh.sh file:

  1 # Check for updates on initial load...                                                                                                                     
  2 if [ "$DISABLE_AUTO_UPDATE" != "true" ]; then
  3   env ZSH=$ZSH DISABLE_UPDATE_PROMPT=$DISABLE_UPDATE_PROMPT zsh -f $ZSH/tools/check_for_upgrade.sh
  4 fi

A regular terminal session does not have this problem...But, for some reason, this does...well, I should say, it doesn't display these errors. There may still be a problem that I don't know about. Now that I think about it, it has been awhile since oh-my-zsh asked to update itself.

Also, it seems like Vim is not loading .vimrc in Tmux either...Is this a PATH problem?

Any thoughts on what could be wrong here?

EDIT Here's my .tmux.conf

# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix

# split panes using | and -
bind \ split-window -h
bind - split-window -v
unbind '"'
unbind %

# reload config file (change file location to your the tmux.conf you want to use)
#bind r source-file ~/.tmux.conf

# switch panes using Alt-arrow without prefix
bind h select-pane -L
bind l select-pane -R
bind k select-pane -U
bind j select-pane -D

# Enable mouse mode (tmux 2.1 and above)
set -g mouse on

#  Fix lag when switching modes in Vim
#set -sg escape-time 0
  • OMZ is, as always, the main problem. Don't use it. Paste your tmux conf for a sanity check.
    – jasonwryan
    Jan 21, 2017 at 19:06
  • updated my question. Jan 21, 2017 at 19:19
  • 3
    Set the default-shell or default-command option, ie., set -g default-command /bin/zsh. See the man page for the details.
    – jasonwryan
    Jan 21, 2017 at 19:35
  • where? in oh-my-zsh.sh or in .tmux.conf? Jan 21, 2017 at 19:54
  • 1
    That's a tmux option.
    – jasonwryan
    Jan 21, 2017 at 19:56

1 Answer 1


As mentioned in a comment by @jsonwryan:

Set the default-shell or default-command option in your .tmux.conf file:

set -g default-command /bin/zsh

(I'll never understand why people give answers in the comments instead of as answers)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .