mpv-wrapper.sh breaks MacOS App bundle since 985e5b1 in some cases

Created on 25 Jul 2017  Β·  40Comments  Β·  Source: mpv-player/mpv

mpv version and platform

mpv.app bundled 0.26
MacOS 10.11.6

Reproduction steps

Open a media a file in Finder with cmd+o or mouse double click.

Expected behavior

Prior to v0.26, open a media file from Finder with cmd+o or double click would play the file instantly.

Actual behavior

Now it just opens the mpv application with a window of "drop files or URLs to play here".

Question

I'm wondering is there an option to set to play the file instantly with cmd+o?

mac upstream

All 40 comments

works as intended here. log file?

This is still the case for me. Without log, it's hard to guess what's wrong on your end.

Many thanks for the prompt reply.
Here's the mpv.log found in the ~/Library/logs/ directory.

Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.
Warning: option --sub-paths was replaced with --sub-file-paths and might be removed in the future.

below is my mpv.conf and I also haves a autoload.lua in the scripts directory.

# vim: syntax=config


###########
# General #
###########

#save-position-on-quit
no-border                               # no window title bar
msg-module                              # prepend module name to log messages
msg-color                               # color log messages on terminal
term-osd-bar                            # display a progress bar on the terminal
use-filedir-conf                        # look for additional config files in the directory of the opened file
# pause                                   # no autoplay
keep-open                               # keep the player open when a file's end is reached
autofit-larger=100%x95%                 # resize window in case it's larger than W%xH% of the screen
deinterlace=auto                        # 'auto' does not imply interlacing-detection
cursor-autohide-fs-only                 # don't autohide the cursor in window mode, only fullscreen
input-media-keys=no                     # enable/disable OSX media keys
cursor-autohide=1000                    # autohide the curser after 1s

screenshot-format=png
screenshot-png-compression=8
screenshot-template='~/Desktop/%F (%P) %n'

hls-bitrate=max                         # use max quality for HLS streams
ytdl-format=bestvideo[height<=?1080][fps<=?30][vcodec!=?vp9][protocol!=http_dash_segments]+bestaudio/best #[protocol!=http_dash_segments][protocol!=rtmp]


#########
# Cache #
#########

cache=yes
cache-default=100000                   # size in KB
cache-backbuffer=25000                  # size in KB
cache-initial=0                         # start playback when your cache is filled up with x kB
cache-secs=10                           # how many seconds of audio/video to prefetch if the cache is active


#############
# OSD / OSC #
#############

osd-level=1                             # enable osd and display --osd-status-msg on interaction
osd-duration=2500                       # hide the osd after x ms
osd-status-msg='${time-pos} / ${duration}${?percent-pos:γ€€(${percent-pos}%)}${?frame-drop-count:${!frame-drop-count==0:γ€€Dropped: ${frame-drop-count}}}\n${?chapter:Chapter: ${chapter}}'

osd-font='Source Sans Pro'
osd-font-size=32
osd-color='#CCFFFFFF'                   # ARGB format
osd-border-color='#DD322640'            # ARGB format
#osd-shadow-offset=1                    # pixel width for osd text and progress bar
osd-bar-align-y=0.9                       # progress bar y alignment (-1 top, 0 centered, 1 bottom)
osd-border-size=2                       # size for osd text and progress bar
osd-bar-h=2                             # height of osd bar as a fractional percentage of your screen height
osd-bar-w=60                            # width of " " "


#############
# Subtitles #
#############

sub-use-margins
sub-ass-force-margins

demuxer-mkv-subtitle-preroll            # try to correctly show embedded subs when seeking
sub-auto=fuzzy                          # external subs don't have to match the file name exactly to autoload
sub-paths=ass:srt:sub:subs:subtitles    # search for external subs in the listed subdirectories
embeddedfonts=yes                       # use embedded fonts for SSA/ASS subs
sub-fix-timing=no                       # do not try to fix gaps (which might make it worse in some cases)
sub-ass-force-style=Kerning=yes         # allows you to override style parameters of ASS scripts

# the following options only apply to subtitles without own styling (i.e. not ASS but e.g. SRT)
sub-font="Source Sans Pro Semibold"
sub-font-size=48
sub-color="#FFFFFFFF"
sub-border-color="#FF262626"
sub-border-size=3.2
sub-shadow-offset=1
sub-shadow-color="#33000000"
sub-spacing=0.5
# sub-codepage=utf8:gb18030

#############
# Languages #
#############

slang=enm,en,eng,de,deu,ger             # automatically select these subtitles (decreasing priority)
alang=ja,jp,jpn,en,eng,de,deu,ger       # automatically select these audio tracks (decreasing priority)


#########
# Audio #
#########

audio-file-auto=fuzzy                   # external audio doesn't has to match the file name exactly to autoload
audio-pitch-correction=yes              # automatically insert scaletempo when playing with higher speed
volume-max=120                          # maximum volume in %, everything above 100 results in amplification
volume=10                              # default volume, 100 = unchanged


################
# Video Output #
################

# Active VOs (and some other options) are set conditionally
# See here for more information: https://github.com/wm4/mpv-scripts/blob/master/auto-profiles.lua
# The script was modified to import functions from scripts/auto-profiles-functions.lua

# Defaults for all profiles
vo=opengl
tscale=catmull_rom                      # sharp: oversample <-> linear (triangle) <-> catmull_rom <-> mitchell <-> gaussian <-> bicubic : smooth
opengl-early-flush=no
opengl-pbo=yes


[high-quality]
profile-desc=cond:is_desktop() and get('width', math.huge) < 3840
scale=ewa_lanczossharp
cscale=ewa_lanczossoft
dscale=mitchell
scale-antiring=0.7
cscale-antiring=0.7
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes
hwdec=no

[mid-quality]
profile-desc=cond:(is_laptop() and not on_battery() and get('width', math.huge) < 1920) or (is_desktop() and get('width', math.huge) >= 3840)
scale=spline36
cscale=bilinear
dscale=mitchell
scale-antiring=1.0
cscale-antiring=1.0
dither-depth=auto
correct-downscaling=yes
sigmoid-upscaling=yes
deband=yes
hwdec=no

[low-quality]
profile-desc=cond:is_laptop() and (on_battery() or get('width', math.huge) >= 1920)
scale=bilinear
cscale=bilinear
dscale=bilinear
scale-antiring=0.0
cscale-antiring=0.0
dither-depth=no
correct-downscaling=no
sigmoid-upscaling=no
deband=no
hwdec=auto

[60FPS]
profile-desc=cond:is_laptop() and get('container-fps', 0) >= 59
scale=bilinear
cscale=bilinear

[4K]
profile-desc=cond:get('width', -math.huge) >= 3840
vd-lavc-threads=32

[4K-inverted]
profile-desc=cond:get('width', -math.huge) < 3840
vd-lavc-threads=0


[default]


###################################
# Protocol Specific Configuration #
###################################

[protocol.https]
#cache=yes
#cache-default=500000                    # size in KB
#cache-backbuffer=250000                 # size in KB
cache-secs=100                          # how many seconds of audio/video to prefetch
user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0'

[protocol.http]
#cache=yes
#cache-default=500000                    # size in KB
#cache-backbuffer=250000                 # size in KB
cache-secs=100                          # how many seconds of audio/video to prefetch
user-agent='Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:47.0) Gecko/20100101 Firefox/47.0'

[extension.gif]
cache=no
no-pause
loop-file=yes

[extension.webm]
#cache=no
#no-pause
#

make a log with --log-file='/PATH/log.txt', pls. also try without your config/scripts and/or --no-config.

I tried open a video without config/scripts, and it still opens the window of "drop". Attached is the log file.
mpv.txt

Just a quick update.
the 0.26 build by stolendata (linked from mpv.io) has the same problem as my own brew build.
For now, I just use the 0.25 build by stolendata which has no such problem.

the only real change to the macOS part that happened between 0.25 and 0.26 that could affect this is 985e5b1d8a9fb446fc2941c15c2dd4fa1294c550. for testing you can move the mpv.app/Contents/MacOS/mpv-wrapper.sh file from the 0.25 bundle to the 0.26 and see if the 0.26 bundle works for you then.
if not, can you git bisect and see which commit causes the problem for you?

Thanks @Akemi
I replaced the mpv-wrapper.sh from 0.25 to 0.26 and it doesn't help.

I upgraded mpv on another Mac with OSX 10.11.6, it has the same problem.

and I don't know how to build it with the git source as mine was built with homebrew.

brew install mpv --HEAD

the --HEAD flag seems build from the master branch of the latest commit. But how to build from a specific commit, e.g. a commit between release 0.25 and 0.26?

then the only thing you can do is testing it by hand.

  1. navigate to /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula
  2. open mpv.rbin a text editor of your choice
  3. change the line head "https://github.com/mpv-player/mpv.git" to
    head "https://github.com/mpv-player/mpv.git", :revision => "d5517f0d9fb124d30e28724f948fcecb729808e4"
  4. rebuild mpv with brew install mpv --HEAD
  5. test if it works. if it works go back to 3. and replace the hash after revision with the next one in the list below. do this till you find a none working commit.
  6. tell me which commits worked for you and at which point it started to break.

hash list to try:

985e5b1d8a9fb446fc2941c15c2dd4fa1294c550
f2961425e770defe7cedc14ee2d4c9d4a53ab203
1a25f8c9fb92debf8729a12325f065998b07e94a
6489b112ad8f3edf19bc7e741980414d8e93dcbd
da7ae75e2626750bb254ac174b21fecba5eb41cd
54e2b1e9f3e64c1724b2ed52c177508e9b23a404
d8ad8ae0159c0d64e029d9c6f4f42fa6564e405c
300f6a334498059f28ec63406112348c7e00fa64
46dc15a220212326bf691fa142d7ffa5e7072de7
a081c8d372106a4b45b597631968d7774afb5814
4db82f04502cbcd20d9a975df9dfde91d8c389e3

Assuming the list is ordered and the first commit works not while the last one works, I'd advise you perform a binary search and start in the middle to avoid having to test every single revision.

@Akemi and @Argon- Thank you very much!
I tested following the instructions you've provided above. It breaks at the second commit 985e5b1d8a9fb446fc2941c15c2dd4fa1294c550 of the above list. The first d5517f0d9fb124d30e28724f948fcecb729808e4 has no problem.

yeah the list is ordered. first one is the first commit after 0.25 the last one is the release of 0.26. the commits in-between are just the first commits of the github pages, to get a general idea where the bad commit is.

It seems indeed the 985e5b1 commit you pointed out above in one of your comments that breaks. But I tried to replace the mpv-wrapper.sh file, it doesn't work.

then this is the page where it started.

another list to go through now. this time newest commit to oldest, starting at the first commit before 985e5b1d8a9fb446fc2941c15c2dd4fa1294c550.

b5b3aadf40b5a94d79b4ec3f1d3a1892eba01f6a
142b2f23d429389a0b5acd674b376a06953f9129
3f0dcbf51826ce30878b3f9335fe8499325816a9
7f78929050540a243fddcb6c9c74f62436fd3246
afead7a3566e455cd2ceec54010a95387b7b022f
90a1ca02a23608d375d319e5c1208db77427818c
f1c4d20e6577f32018e20efc4ab9da7d4e1ab4ac
f1c4d20e6577f32018e20efc4ab9da7d4e1ab4ac
010c7d499258c1064189b2d149ae6eca859d9ae1
cb25bb5776b30e34ff7aa32c5e0a4f8862774e74
37820827223fcfaf398dbf5009a93ab6df972d6d
9d80c08441edf3e8da5180fb42eda71878e9c411
3fe6b36eb095698ef8f7de9d082dd55d6f575667
18703b55d8db35cf8db2f4342f1b5880014d0a28
6d65ab3a7d4057c844327adfe8e81dcf5ecbaea5
809d160c1ec1c050d1877e66f93fcffc98fe4e83
f34de634501f0fd95ac6ea26b3ed643183222165
f59371de2170141fc28540d03c4e7ecc62844ebf
1d0a858447cee977c9b4faa65d163100f20d4047
3526b95aafe11bb829c924a1f69877ec72406068

so you can confirm that everything works with commit 24f568c06858146681decb1d4be50ef68865d136, the one directly before the mpv-wrapper.sh change? if yes just ignore the list above.

It is indeed the mpv-wrapper.sh file that caused the problem.

Last time when I edited the mpv-wrapper.sh of 0.26.0, I forgot to remove the -l flag in line 1, so it looks like:

#!/bin/bash -l
export MPVBUNDLE="true"
$SHELL -l -c "$(dirname "$0")/mpv --player-operation-mode=pseudo-gui"

After removing the -l flag, the 0.26 with edited mpv-wrapper.sh works as expected.

@Akemi @Argon-
Many thanks for your help!

though there is still the problem why this causes problems for you. maybe @downthomas has an idea.

do you have any other shells installed than the standard one provided by macOS? what does echo $SHELL in your terminal return?

I use zsh installed with brew.

β†’ echo $SHELL
/bin/zsh
[~]
β†’ which zsh
/usr/local/bin/zsh
[~]
β†’ zsh --version
zsh 5.3.1 (x86_64-apple-darwin15.6.0)

For the record, I use brewed zsh too and no problems.

@samumist Have you added zsh as your shell in /etc/shells and then properly set it with chsh -s /path/to/shell?

Thanks @Argon-

I didn't add the brewed zsh in the /etc/shells file. But I did add the brewed bash in that file. I changed from bash to zsh a few years ago and it is very likely I forgot to change it. Below is the content of my current /etc/shells :

# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/bash

I'll remove the /usr/local/bin/bash line and add /usr/local/bin/zsh at the end of line and set it with chsh -s and test the non-edited 0.26 build again.

It's just a guess, I'm not sure if this will help. But there must be something different between us.

Yes, I think it's my local environment that has caused the problem since yours are working properly.

I just did the following:

  • uninstalled the brewed bash
  • modified the /etc/shells file
  • chsh -s /usr/local/bin/zsh
  • rebuild the mpv.app without the mpv-wrapper.sh edit.

the problem is still there.

β†’ echo $SHELL                                                                                                                                                                                                                               ⍉
/usr/local/bin/zsh
[~]
β†’ cat /etc/shells
# List of acceptable shells for chpass(1).
# Ftpd will not allow users to connect who are not using
# one of these shells.

/bin/bash
/bin/csh
/bin/ksh
/bin/sh
/bin/tcsh
/bin/zsh
/usr/local/bin/zsh

I'm using iTerm2 and have both python2 and python3 installed with brew.

I've tested again. It is this -l flag on #!/bin/bash -l causing the problem for me.

The -l flat on this line $SHELL -l -c "$(dirname "$0")/mpv --player-operation-mode=pseudo-gui" doesn't matter, i.e. with or without -l.

does this also fix your issue @samumist?

#!/bin/sh
export MPVBUNDLE="true"

# use the shell's profile init and execute a command string
args="-c"  # good enough for zsh/[t]csh
case "$SHELL" in
    *bash) args="-l $args";;  # bash needs -l for using profile file[s]
    *zsh) args="-l -i $args";; # interactive login shell
esac

$SHELL $args "$(dirname "$0")/mpv --player-operation-mode=pseudo-gui"

@Akemi Sorry, this doesn't fix it.

it works by removing the -i flag from *zsh) args="-l -i $args";; # interactive login shell this line.

Now that doesn't make sense. Removing this flag only decreases the set of sourced files.

Can you please check which ZSH config files you are using and where you are specifying your PATH?

@Argon- You're absolutely right!

There must be some conflict with my zsh configuration. When the .zshrc file is removed, the code from @Akemi above works fine.

I need to figure out what code in my .zshrc causes this conflict.

@Akemi and @Argon- Really really appreciate your help here!

I've found the culprit. The nvm loading script seems creating some sort of conflict. The above code works fine when these nvm lines disabled.

# NODE: NVM Environment
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

It seems like this script is using export PATH twice. Not sure what exactly it is exporting though but it must export a "shorter" PATH that overwrites your normal one.
You can use zsh -l -i -o SOURCE_TRACE to trace what files are sourced.

The reason why I put -l -i is that OSX users usually only use shells in a terminal and both, iTerm2 and Terminal, open a interactive login shell. Consequently, this means users edit their shell configs (and their PATH) for use with "interactive login shells", unlike Linux users that often maintain separate setups for interactive and login shells.

I don't know where it went wrong but a part of the PATH seems duplicated after running the SOURCE_TRAE commend.

My .zshrc PATH related part

# use custom termcolor with italic support
export TERM=xterm-256color-italic

# NODE: NVM Environment
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"  # This loads nvm

# calling nvm use automatically in a directory with a .nvmrc file
autoload -U add-zsh-hook
load-nvmrc() {
  local node_version="$(nvm version)"
  local nvmrc_path="$(nvm_find_nvmrc)"

  if [ -n "$nvmrc_path" ]; then
    local nvmrc_node_version=$(nvm version "$(cat "${nvmrc_path}")")

    if [ "$nvmrc_node_version" = "N/A" ]; then
      nvm install
    elif [ "$nvmrc_node_version" != "$node_version" ]; then
      nvm use
    fi
  elif [ "$node_version" != "$(nvm version default)" ]; then
    echo "Reverting to nvm default version"
    nvm use default
  fi
}
add-zsh-hook chpwd load-nvmrc
load-nvmrc

# set nodejs mirror for nvm
export NVM_NODEJS_ORG_MIRROR=https://npm.taobao.org/mirrors/node

# RUBY: rbenv initialisation for ruby
eval "$(rbenv init -)"

# ITERM2: Enable iterm2 shell integration
test -e "${HOME}/.iterm2_shell_integration.zsh" && source "${HOME}/.iterm2_shell_integration.zsh"

# PERL5 Environment
PATH="/Users/sam/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/sam/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/sam/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/sam/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/sam/perl5"; export PERL_MM_OPT;

# Setting PATH
export PATH=$HOME/bin/app:/usr/local/sbin:$PATH:~/.composer/vendor/bin

β†’ echo $PATH (This looks correct with my config)
/Users/sam/bin/app:/usr/local/sbin:/Users/sam/perl5/bin:/Users/sam/.rbenv/shims:/Users/sam/.nvm/versions/node/v6.11.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/TeX/texbin:/usr/local/opt/fzf/bin:/Users/sam/.composer/vendor/bin

**zsh -l -i -o SOURCE_TRACE** 

β†’ zsh -l -i -o SOURCE_TRACE
+/etc/zprofile:1>
+/etc/zshrc:1>
+/Users/sam/.zshrc:1>
+/Users/sam/bin/dotfiles/config/zsh-config/env.zsh:1>
+/Users/sam/.oh-my-zsh/oh-my-zsh.sh:1>
+/Users/sam/.oh-my-zsh/lib/bzr.zsh:1>
+/Users/sam/.oh-my-zsh/lib/clipboard.zsh:1>
+/Users/sam/.oh-my-zsh/lib/compfix.zsh:1>
+/Users/sam/.oh-my-zsh/lib/completion.zsh:1>
+/Users/sam/.oh-my-zsh/lib/correction.zsh:1>
+/Users/sam/.oh-my-zsh/lib/diagnostics.zsh:1>
+/Users/sam/.oh-my-zsh/lib/directories.zsh:1>
+/Users/sam/.oh-my-zsh/lib/functions.zsh:1>
+/Users/sam/.oh-my-zsh/lib/git.zsh:1>
+/Users/sam/.oh-my-zsh/lib/git.zsh:1>
+/Users/sam/.oh-my-zsh/lib/grep.zsh:1>
+/Users/sam/.oh-my-zsh/lib/history.zsh:1>
+/Users/sam/.oh-my-zsh/lib/key-bindings.zsh:1>
+/Users/sam/.oh-my-zsh/lib/misc.zsh:1>
+/Users/sam/.oh-my-zsh/lib/nvm.zsh:1>
+/Users/sam/.oh-my-zsh/lib/prompt_info_functions.zsh:1>
+/Users/sam/.oh-my-zsh/lib/spectrum.zsh:1>
+/Users/sam/.oh-my-zsh/lib/termsupport.zsh:1>
+/Users/sam/.oh-my-zsh/lib/theme-and-appearance.zsh:1>
+/Users/sam/.zcompdump-sam-5.3.1:1>
+/Users/sam/.oh-my-zsh/plugins/git/git.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/colored-man-pages/colored-man-pages.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/bower/bower.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/npm/npm.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/cache/npm_completion:1>
+/Users/sam/.oh-my-zsh/plugins/gulp/gulp.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/sudo/sudo.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/osx/osx.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/web-search/web-search.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/history/history.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/vi-mode/vi-mode.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/z/z.plugin.zsh:1>
+/Users/sam/.oh-my-zsh/plugins/z/z.sh:1>
+/Users/sam/bin/dotfiles/config/themes/odin.zsh-theme:1>
+/Users/sam/.fzf.zsh:1>
+/usr/local/opt/fzf/shell/key-bindings.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/dev-env.zsh:1>
+/Users/sam/.nvm/nvm.sh:1>
+/usr/local/Cellar/rbenv/1.1.1/libexec/../completions/rbenv.zsh:1>
+/Users/sam/.iterm2_shell_integration.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/aliases.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/functions.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/gitaliases.zsh:1>
+/Users/sam/bin/config/local.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/fzf.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/misc.zsh:1>
+/Users/sam/bin/dotfiles/config/zsh-config/plugins.zsh:1>
+/usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/brackets//brackets-highlighter.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/cursor//cursor-highlighter.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/line//line-highlighter.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/main//main-highlighter.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/pattern//pattern-highlighter.zsh:1>
+/usr/local/Cellar/zsh-syntax-highlighting/0.5.0/share/zsh-syntax-highlighting/highlighters/root//root-highlighter.zsh:1>
+/usr/local/share/zsh-autosuggestions/zsh-autosuggestions.zsh:1>
+/usr/local/Cellar/zsh-history-substring-search/1.0.1/zsh-history-substring-search.zsh:1>
+/Users/sam/.zlogin:1>

After `zsh -l -i -o SOURCE_TRACE`, then `echo $PATH`, the result is as following. 

It is the same if I open a tmux window and run echo $PATH

β†’ echo $PATH ⍉
/Users/sam/bin/app:/usr/local/sbin:/Users/sam/perl5/bin:/Users/sam/.rbenv/shims:/Users/sam/.nvm/versions/node/v6.11.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:/Library/TeX/texbin:/Users/sam/bin/app:/usr/local/sbin:/Users/sam/perl5/bin:/Users/sam/.rbenv/shims:/usr/local/opt/fzf/bin:/Users/sam/.composer/vendor/bin:/Users/sam/.composer/vendor/bin

i consider this not our bug from what i can gather. sry that i can't help you more with this.

Nowhere in the posted config are you adding /usr/local/bin to the PATH yourself, yet it ends up in your PATH. And i can't see where tex gets added either.

Anyway, this is rather confusing. You said it works when you remove the npm script and it also worked when you prevented bash from sourcing its config. So a lot of stuff seems to interfere with your zsh PATH/config and it shouldn't.
I can't tell if the node script is broken or if your config is doing stuff it can't deal with.

I'd recommend you collect all config files of zsh and bash and delete the ones you don't need. Then clean up creation of your PATH: let scripts add their stuff first and then add your stuff last. Try not to use dozens of export declarations but rather just one. Make sure you actually add the important bits of your PATH yourself and don't rely on the side-effects of scripts (them adding stuff for you).

Yes, it is rather confusing. I'll try to sort it out.
Thank you all very much for your help!

just the same problem. I'm looking forward any news on this issue.

Same issue with the latest mpv sources and the latest macOS.

Well unless you expect us to guess a few more details are in order.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

olivergondza picture olivergondza  Β·  3Comments

paper9oll picture paper9oll  Β·  3Comments

WoLpH picture WoLpH  Β·  3Comments

SPDurkee picture SPDurkee  Β·  3Comments

lightonflux picture lightonflux  Β·  4Comments