Bug 436902 - vi (vim-minimal) loses file name
vi (vim-minimal) loses file name
Product: Fedora
Classification: Fedora
Component: vim (Show other bugs)
All Linux
low Severity high
: ---
: ---
Assigned To: Karsten Hopp
Fedora Extras Quality Assurance
: Reopened
Depends On:
  Show dependency treegraph
Reported: 2008-03-10 21:38 EDT by JW
Modified: 2008-03-12 09:04 EDT (History)
0 users

See Also:
Fixed In Version: vim-7.1.273
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2008-03-12 09:03:35 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 JW 2008-03-10 21:38:41 EDT
Description of problem:
When editing a file with vi (vim-minimal) the filename can become unavailable. 
This is relatively new behavior (since FC7?).

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1. vim test
2. ... add some content ...
3. :w
3. touch test
4. :w 

Actual results:
E32: No file name 

Expected results:
Same as with full vim.
>> WARNING: The file has been changed since reading it!!!
>> Do you really want to write to it (y/n)?n

Additional info:
This is new behavior in vim-minimal.  It used to do the same thing as full vim
and prompt user.  It never used to simply discard the filename.

A similar thing happens if the mode of the file changes (eg chmod +x).  However
it does show a different error message, but it still drops the filename.
Comment 1 Karsten Hopp 2008-03-11 07:02:23 EDT
are you sure about vim-7.1.242 and F8 ? I've never released 7.1.242 for F8, only
for F9.

If you're running F9/Rawhide, please update to vim-7.1.269 as I couldn't 
reproduce it with that version (assuming that I understood your steps correctly);
- I've opened a new file test with /bin/vi and added some content
- wrote that content to the file with :w
- in another terminal I've run 'touch test'
- wrote content again with :w
  /bin/vi correctly asked for confirmation:
WARNING: The file has been changed since reading it!!!
Do you really want to write to it (y/n)?

the latest /bin/vi doesn't complain at all when the mode of the file changes,
I've tested that as well.

Please reopen with your .vimrc attached if this is reproducable with either
vim-7.1.211 (latest-F8) or vim-7.1.269 (latest-F9)
Comment 2 JW 2008-03-11 08:14:01 EDT
I have compiled vim-7.1.266-1 (I would have tried .269 but it isn't on any
mirrors and I don't know the magic incantation that will allow me to
successfully connect to the extremely overloaded redhat ftp servers) and the
problem is the same. I couldn't use pre-compiled vim-minimal because it was full
of selinux linkage and I don't have selinux on my system.

You have followed the correct steps.  The same problem occurs whether I have a
.vimrc or not.
Comment 3 JW 2008-03-11 08:33:27 EDT
I have since found that the problem only happens after putting vi in background
with ^Z or by using ":!touch test".

That is why you need to follow my precise instructions, otherwise the problem
might not occur.

So don;t go to another "terminal" to touch the file - either do ":!touch test"
or put vi job in background and touch the file then fg vi and attempt ":w"
Comment 4 Karsten Hopp 2008-03-11 09:10:08 EDT
I can reproduce this now, !touch was the missing information.

btw: even if a package isn't isn't in the latest downloadable tree, it is
available at http://koji.fedoraproject.org/packages/<packagename>, p.e.
Comment 5 Karsten Hopp 2008-03-12 09:03:35 EDT
This will be fixed in vim-7.1.273

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