Bug 62764 - zsh show mc () definition on starting login shell
Summary: zsh show mc () definition on starting login shell
Keywords:
Status: CLOSED DUPLICATE of bug 62716
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: mc
Version: 7.3
Hardware: i386
OS: Linux
high
medium
Target Milestone: ---
Assignee: Havoc Pennington
QA Contact: Aaron Brown
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-04-05 08:09 UTC by Jens Petersen
Modified: 2007-03-27 03:52 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-04-05 16:39:17 UTC
Embargoed:


Attachments (Terms of Use)

Description Jens Petersen 2002-04-05 08:09:00 UTC
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.

Comment 1 Jens Petersen 2002-04-05 08:32:25 UTC
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 16:22:11 UTC
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 16:39:13 UTC
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 16:41:56 UTC
Resolving as a duplicate of 62716.

*** This bug has been marked as a duplicate of 62716 ***

Comment 5 Nalin Dahyabhai 2002-04-05 16:56:16 UTC
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.