Skip to content

Instantly share code, notes, and snippets.

@scottstanfield
Forked from ekreutz/tmux_conda_fix.md
Created January 12, 2020 21:59
Show Gist options
  • Select an option

  • Save scottstanfield/f82a344f42df3f4b068e8c0e3554d569 to your computer and use it in GitHub Desktop.

Select an option

Save scottstanfield/f82a344f42df3f4b068e8c0e3554d569 to your computer and use it in GitHub Desktop.

Revisions

  1. @ekreutz ekreutz revised this gist Jun 7, 2019. 1 changed file with 2 additions and 6 deletions.
    8 changes: 2 additions & 6 deletions tmux_conda_fix.md
    Original file line number Diff line number Diff line change
    @@ -7,16 +7,12 @@
    If using bash, edit `/etc/profile` and add one line. (For `zsh`, edit `/etc/zprofile`)

    ```
    # System-wide .profile for sh(1)
    ...
    if [ -x /usr/libexec/path_helper ]; then
    PATH="" # <- ADD THIS LINE (right before path_helper call)
    eval `/usr/libexec/path_helper -s`
    fi
    if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
    fi
    ...
    ```

    You're welcome :)
  2. @ekreutz ekreutz revised this gist Jun 7, 2019. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion tmux_conda_fix.md
    Original file line number Diff line number Diff line change
    @@ -4,7 +4,7 @@

    ## Solution

    Edit `/etc/profile` and add one line:
    If using bash, edit `/etc/profile` and add one line. (For `zsh`, edit `/etc/zprofile`)

    ```
    # System-wide .profile for sh(1)
  3. @ekreutz ekreutz created this gist Apr 29, 2019.
    22 changes: 22 additions & 0 deletions tmux_conda_fix.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,22 @@
    # Fix `tmux` messing with `conda`

    **Problem:** When running a conda environment and opening tmux on macOS, a utility called `path_helper` is run *again*. Essentially, the shell is initialized twice which messes up the `${PATH}` so that the wrong Python version shows up within `tmux`.

    ## Solution

    Edit `/etc/profile` and add one line:

    ```
    # System-wide .profile for sh(1)
    if [ -x /usr/libexec/path_helper ]; then
    PATH="" # <- ADD THIS LINE (right before path_helper call)
    eval `/usr/libexec/path_helper -s`
    fi
    if [ "${BASH-no}" != "no" ]; then
    [ -r /etc/bashrc ] && . /etc/bashrc
    fi
    ```

    You're welcome :)