Disembodied emails when composed via vim on macOS

Emails composed using vim on macOS are sent without any body. If I use an $EDITOR other than vim (i.e Emacs) then it's fine.

I've tested this using vim (8.0) and neovim, both installed via Homebrew, and using each editor's default configuration.

Assigned to
1 year, 3 months ago
1 year, 2 months ago

~eval 1 year, 3 months ago

Seeing this as well (vim 8.0 and 8.1). Having a wrapper-script that prevents any initialization fixes it: /usr/bin/vim -u NONE "$@".

Adding 'No-compatible mode' (-N) make it fail again.

~sircmpwn closed duplicate ticket #203 1 year, 3 months ago

~ibutra 1 year, 3 months ago

I really can't figure this out. File.read returns EOF for the temporary file written by vim but I don't know why. Looking at the file with 'cat' looks normal. I even looked at it with a hex-Editor and it looks fine i.e. no 0 at the beginning of the file or something like that. I also looked at the permissions and my user owns the file and it belongs to the 'staff' group.

Then I used nano as editor and tried to see any differences between a file created by nano and vim. And again there is no difference I can spot with a hex-Editor. So I looked at the metadata recorded by macOS with 'mdls' and again no difference.

~ibutra 1 year, 3 months ago

Also there is no difference in permissions between the nano version and the vim version

~ibutra 1 year, 3 months ago

Anybody any idea what else it could be? I was thinking about the file being still open by vim. But if I breakpoint it and confirm the vim process is quit before continuing it still doesn't work.

~eval 1 year, 3 months ago

When adding the following to my vimrc, it works:

autocmd filetype mail setlocal nobackup nowritebackup

Crontab needs this as well. The reason is described here: http://vimdoc.sourceforge.net/htmldoc/options.html#crontab

So aerc might be doing something similar (ie look at the backup-file). Unfortunately my go-knowledge is null.

~ake 1 year, 3 months ago

I can confirm that adding the above line fixed the issue for me too.

Maybe this ticket can be solved by adding a note to the documentation?

~ibutra 1 year, 3 months ago

~cmpadden 1 year, 3 months ago

I also experienced this issue, and resolved it by setting the following in my aerc.conf to start vim without loading my vimrc.

editor=vim -u NONE

~eval 1 year, 3 months ago

Thanks ~ibutra for fixing the issue!

~ibutra 1 year, 2 months ago

I didn't encounter this anymore with the merged fix, and it lookes like others are fine as well. So I think we can close this issue.

~yankcrime 1 year, 2 months ago

Yup, can confirm that this is resolved. Thanks ~ibutra.

Register here or Log in to comment, or comment via email.