Bug 62764 - zsh show mc () definition on starting login shell
zsh show mc () definition on starting login shell
Status: CLOSED DUPLICATE of bug 62716
Product: Red Hat Linux
Classification: Retired
Component: mc (Show other bugs)
i386 Linux
high Severity medium
: ---
: ---
Assigned To: Havoc Pennington
Aaron Brown
Depends On:
  Show dependency treegraph
Reported: 2002-04-05 03:09 EST by Jens Petersen
Modified: 2007-03-26 23:52 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-04-05 11:39:17 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Jens Petersen 2002-04-05 03:09:00 EST
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):

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
	/usr/bin/mc -P "$@" > "$MC"
	cd "`cat $MC`"
	/bin/rm -f "$MC"
	unset MC

Expected Results:

Additional Information:
autoload -U compinit

in .zshrc, zsh extended completion system seems to be broken too.
Comment 1 Jens Petersen 2002-04-05 03:32:25 EST
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...
Comment 2 Trond Eivind Glomsrxd 2002-04-05 11:22:11 EST
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?
Comment 3 Nalin Dahyabhai 2002-04-05 11:39:13 EST
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.
Comment 4 Nalin Dahyabhai 2002-04-05 11:41:56 EST
Resolving as a duplicate of 62716.

*** This bug has been marked as a duplicate of 62716 ***
Comment 5 Nalin Dahyabhai 2002-04-05 11:56:16 EST
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.

Note You need to log in before you can comment on or make changes to this bug.