Bug 1907800 - installing 'vim' doesn't shut down the "No vim found, using vi, ..." message
Summary: installing 'vim' doesn't shut down the "No vim found, using vi, ..." message
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: vim
Version: 33
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Karsten
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-12-15 09:37 UTC by Pavel Raiskup
Modified: 2021-01-21 05:26 UTC (History)
4 users (show)

Fixed In Version: vim-8.2.2146-2.fc33 vim-8.2.2146-2.fc32
Clone Of:
Environment:
Last Closed: 2020-12-22 01:29:40 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Pavel Raiskup 2020-12-15 09:37:27 UTC
On normal cloud fedora install now, vim isn't available so we see
message like:

   # vim /etc/sudoers
   No vim found, using vi, press ENTER to continue...

When I do 'dnf install -y vim', it is still shown.  The cure is to
log-out and log-in.

Expected results:
Installing 'vim' should be enough and no re-login should be needed.

Comment 1 Zdenek Dohnal 2020-12-15 09:52:56 UTC
Hi Pavel,

thank you for reporting the issue!

'vim' is an alias since 8.2.1885-1 if only vim-minimal is installed to meet the requirements of community and mine - see thread https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/2DLBCPWOQDDB7MW26NMDBCEMYHQQWA47/#FJIVXUWGEMU4PGC5DTPAAJHPT2X7DOOX

(To sum it up - community wanted alias vim=vi, which I found misleading, so the current alias is used)

So the cure is to restart shell as you found out, because it loads scripts from /etc/profile.d again.

If you know a way how to change alias without restarting shell/or get the same behavior without aliases, please let me know.

I'll close this as NOTABUG for now, I'll reopen it if there is a way how to do it differently.

Comment 2 Pavel Raiskup 2020-12-15 10:07:10 UTC
Some possible solutions:

- don't use alias, but some shell function instead
- revert the change, the "Command not found" is clear enough, and I can
  fix that by simply installing vim-enhanced
- make the alias work so it doesn't interactively interrupt me with
  the question "No vim found, using vi, press ENTER to continue..."

Let's call this RFE if it is not a bug :-)

Comment 3 Pavel Raiskup 2020-12-15 14:57:26 UTC
Compromise solution after 1:1 irc chat could be this:
https://src.fedoraproject.org/rpms/vim/pull-request/16

But personal preference is to entirely avoid the warning which
is super annoying during my day-to-day work.

Comment 4 Fedora Update System 2020-12-16 16:20:34 UTC
FEDORA-2020-eb6fb0541e has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-eb6fb0541e

Comment 5 Fedora Update System 2020-12-16 16:21:14 UTC
FEDORA-2020-c24b468d7f has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-c24b468d7f

Comment 6 Fedora Update System 2020-12-17 01:15:16 UTC
FEDORA-2020-eb6fb0541e has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-eb6fb0541e`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-eb6fb0541e

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 7 Fedora Update System 2020-12-17 02:06:45 UTC
FEDORA-2020-c24b468d7f has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-c24b468d7f`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-c24b468d7f

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 8 Fedora Update System 2020-12-18 08:37:06 UTC
FEDORA-2020-08ff42d667 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2020-08ff42d667

Comment 9 Fedora Update System 2020-12-18 09:01:24 UTC
FEDORA-2020-971fd35017 has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2020-971fd35017

Comment 10 Fedora Update System 2020-12-19 01:15:45 UTC
FEDORA-2020-08ff42d667 has been pushed to the Fedora 33 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-08ff42d667`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-08ff42d667

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 11 Fedora Update System 2020-12-19 01:20:03 UTC
FEDORA-2020-971fd35017 has been pushed to the Fedora 32 testing repository.
Soon you'll be able to install the update with the following command:
`sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2020-971fd35017`
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2020-971fd35017

See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.

Comment 12 Fedora Update System 2020-12-22 01:29:40 UTC
FEDORA-2020-08ff42d667 has been pushed to the Fedora 33 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 13 Fedora Update System 2020-12-27 01:16:07 UTC
FEDORA-2020-971fd35017 has been pushed to the Fedora 32 stable repository.
If problem still persists, please make note of it in this bug report.

Comment 14 Glenn Zazulia 2020-12-27 23:26:12 UTC
Please reconsider this fix!  I read through this bug and the referenced thread and understand the previous complaints, but the fix that was recently committed & pushed is ugly:  bash now reports the running job as "( test -f /usr/bin/vim && exec /usr/bin/vim "$@"; test -f /usr/bin/vi && exec /usr/bin/vi "$@" )".  That appears anytime someone stops an editor session or runs the "jobs" shell builtin.  Previously (for years and years), only "vim" would be reported as the running job, which is so much cleaner and easier to read.  The original reported bug might have been an annoyance for a certain (arguably small) subset of the user base, while this recent fix now impacts every user of the vim-enhanced/vim-minimal packages.

Actually, I wonder if it was intentional to use parentheses instead of curly-braces in those two new functions added to /etc/profile.d/vim.sh (__vi_internal_vim_alias).  Did you really want to have to fork/exec a subshell?  That doesn't seem necessary, and more importantly, when using the more common curly-braces to contain the function body, bash doesn't report the entire function body as the running job as it does when running within a subshell.  If you would at least change the parens to braces, bash would only report the actual process running, which is much less ugly than the current approach.

Comment 15 Zdenek Dohnal 2021-01-21 05:18:25 UTC
Hi Glenn,

you're absolutely right, the curly brackets does the trick too and it is less messy.

Thank you for checking it!

Actually, the current solution doesn't work when you use vi/vim with sudo, so I'm working on the version using alternatives.

Currently, I'm stuck with writing %triggerin scriptlet to ensure the change is propagated even during upgrade.

Comment 16 Zdenek Dohnal 2021-01-21 05:26:24 UTC
I created a bug for tracking the intention to use alternatives in vim here https://bugzilla.redhat.com/show_bug.cgi?id=1918575


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