Bug 44050 - vi alias to execute vim not being propagated to subshells
vi alias to execute vim not being propagated to subshells
Product: Red Hat Linux
Classification: Retired
Component: vim (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Bernhard Rosenkraenzer
David Lawrence
Depends On:
  Show dependency treegraph
Reported: 2001-06-10 16:04 EDT by Bernie Innocenti
Modified: 2007-04-18 12:33 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2001-06-10 16:04:43 EDT
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 Bernie Innocenti 2001-06-10 16:04:39 EDT
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux 2.4.5-ac1 i686; en-US; rv:0.9)

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

How reproducible:

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 05:08:06 EDT
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

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.