Bug 44050

Summary: vi alias to execute vim not being propagated to subshells
Product: [Retired] Red Hat Linux Reporter: Bernie Innocenti <bernie+fedora>
Component: vimAssignee: Bernhard Rosenkraenzer <bero>
Status: CLOSED RAWHIDE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.1   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2001-06-10 20:04:43 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Bernie Innocenti 2001-06-10 20:04:39 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.5-ac1 i686; en-US; rv:0.9)
Gecko/20010507

Description of problem:
the /etc/profile.d/vim.sh script, installed by package vim-enhanced,
tries to replace vi with vim by means of an alias. Aliases in
login scripts have limited usability because they don't get
propagated to subshells (including those spanwned by an X session!).
As the bash man page suggests, assigns are deprecated and should be
replaced with shell functions whenever possible.
Here's my current workaround:

    vi() { /usr/bin/vim $@; }
    export -f vi
 
I suggest using this method to replace _ALL_ aliases created in
/etc/profile.d/.


How reproducible:
Always

Steps to Reproduce:
1. install package vim-enhanced
2. log in as any user
3. spawn a new shell (type "sh")
4. type "vi": the plain vi is run instead of the enhanced version, because
the alias is lost.

Comment 1 Bernhard Rosenkraenzer 2001-06-29 09:08:06 UTC
Fixed in 5.8-3
The reason we aren't doing this for things like colorls is that some users 
will want to use the system-wide profile files, but

unalias colorls

afterwards.
It's not quite that easy for exported functions.