Bug 44050 - vi alias to execute vim not being propagated to subshells
Summary: vi alias to execute vim not being propagated to subshells
Status: CLOSED RAWHIDE
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: vim   
(Show other bugs)
Version: 7.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Bernhard Rosenkraenzer
QA Contact: David Lawrence
URL:
Whiteboard:
Keywords:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2001-06-10 20:04 UTC by Bernie Innocenti
Modified: 2007-04-18 16:33 UTC (History)
0 users

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: ---


Attachments (Terms of Use)

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.



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