vim unable to write or quit

Asked by lee

History/Origin of issue:

This issue started a month ago, but in the terminal. It was enough time ago that I don't remember the issue, but it might have been my terminal window freezing. A restart fixed it only for a moment. This prompted me to upgrade, and when that didn't help, major upgrade to Xenial.

My present issue:

When I open the vim terminal, at times it will not let me write or quit. If I close the terminal and vim back into the document, changes are not saved.

If I type "top" in bash while this problem is occurring, gnome-s+ is the process using the most resources. 0.7 CPU.

Ubuntu release:
Ubuntu 20.04.3 LTS, Release 20.04

vim version:
  Installed: 2:8.1.2269-1ubuntu5
  Candidate: 2:8.1.2269-1ubuntu5
  Version table:
 *** 2:8.1.2269-1ubuntu5 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages
        100 /var/lib/dpkg/status

Expected: vim to save and quit
Happened: vim showed that it was still in insert mode. Upon reopening the document, changes weren't saved.

Since I've considered that the problem could be gnome-s+ or bash, I've included version info. I didn't for gnome-s+ because of how long it was.

bash version v:
  Installed: 5.0-6ubuntu1.1
  Candidate: 5.0-6ubuntu1.1
  Version table:
 *** 5.0-6ubuntu1.1 500
        500 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     5.0-6ubuntu1 500
        500 http://us.archive.ubuntu.com/ubuntu focal/main amd64 Packages

Question information

Language:
English Edit question
Status:
Needs information
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

If you open a normal terminal using CTRL + ALT + T then run:

vi /path/to/some/file

does it open OK and exit as you expect? or is this what you call the "vim terminal" ?

Revision history for this message
lee (leelemur) said (last edit ):
#2

That is what I call the vim terminal, if I use vim instead of vi. It opens normally. It will exit normally at times. It does seem the freeze issue is more of a problem the longer that the window is open. However, this is the matter of minutes, not hours.

Revision history for this message
Bernard Stafford (bernard010) said :
#3

While you were in vim you typed: wq
To save and quit on a new line.
My suggestion would be to file a bug report.
Please use apport in the terminal.
ubuntu-bug vim
Otherwise it may be considered incomplete.

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

"If I type "top" in bash while this problem is occurring, gnome-s+ is the process using the most resources. 0.7 CPU."

"gnome-s+" most probably stands for "gnome-shell" (cut off to fit the window). This usually is the process that uses most CPU and has nothing to do with vim.

"When I open the vim terminal, at times it will not let me write or quit."

1. In such case, can you quit without saving (q!)?
2. Do you have write access rights to the file(s) in question?
If you do not have write access to the file, then you definitely cannot save changes (nor in any other editor that I know). If you want to modify a system file where you do not have write access, you have to start vim with root privileges, e.g. "sudo vim filename"

Revision history for this message
lee (leelemur) said :
#5

To answer in order:

1. Quit without saving does not work. Any mode shifting or changing of the document does not work. I can still navigate by cursor, and type, so I wouldn't call it freeze either.
2. I have the same outcome if using root.

Revision history for this message
Manfred Hampl (m-hampl) said :
#6

"Quit without saving does not work"

"does not work" in which sense?
Error message?
Program crash?
No effect at all?
...?

"Happened: vim showed that it was still in insert mode"
Maybe a broken escape key on the keyboard?

Revision history for this message
Bernard Stafford (bernard010) said (last edit ):
#7

Please answer last question.
"Happened: vim showed that it was still in insert mode"
'Maybe a broken escape key on the keyboard?'
Do you have another external keyboard?
You can also exit as q or wq (q =quit)
(qw=Quit & Save)
ESC Key= back to previous terminal screen.
You are presently on focal 20.04 LTS.
Could you open Terminal and paste output here:
cat /etc/os-release; uname -r
'"This issue started a month ago, but in the terminal. It was enough time ago that I don't remember the issue, but it might have been my terminal window freezing. A restart fixed it only for a moment."' : Quote]

Can you help with this problem?

Provide an answer of your own, or ask lee for more information if necessary.

To post a message you must log in.