Description of Problem: When starting a login shell the definition of mc from /etc/profile.d/mc.sh appears on the screen! Also the extended completion seems to be broken. Version-Release number of selected component (if applicable): zsh-4.0.4-4 How Reproducible: every time Steps to Reproduce: 1. zsh --login Actual Results: mc () { mkdir -p $HOME/.mc/tmp 2> /dev/null chmod 700 $HOME/.mc/tmp MC=$HOME/.mc/tmp/mc-$$ /usr/bin/mc -P "$@" > "$MC" cd "`cat $MC`" /bin/rm -f "$MC" unset MC } hostname% Expected Results: hostname% Additional Information: With: autoload -U compinit compinit in .zshrc, zsh extended completion system seems to be broken too.
sorry, zsh's extended completion stuff is working fine, it's just the mc thing at startup that's wrong I think. I was trying to use in an old zsh invocation...
This is caused by the export -f at the end of that function. This is interpreted as "typeset -f". "With no attribute flags, all parameters (or functions with the -f flag) with matching names are printed." Is that export really necesarry in MC?
Unless I'm mistaken, the scripts in profile.d are sourced by every shell (even secondary shells), so there's no need to export the function definition.
Resolving as a duplicate of 62716. *** This bug has been marked as a duplicate of 62716 ***
I was mistaken. zsh doesn't source the scriptlets in /etc/profile.d in its /etc/zshenv file, while bash does in /etc/bashrc. Fixing the discrepancy will allow us to remove the "export -f mc" from /etc/profile.d/mc.sh.